summary refs log tree commit diff
path: root/.vim/lua/plugins.lua
blob: a0fac91098b7fa436e689b58b5f183f1ff5d7358 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
-- load by calling `lua require('plugins')` from your init.vim
local g = vim.g
local u = require('utils')

-- local install_path = fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
-- if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
--   vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
--   vim.api.nvim_command 'packadd packer.nvim'
-- end

function disable_distribution_plugins()
  g.loaded_gzip              = 1
  g.loaded_tar               = 1
  g.loaded_tarPlugin         = 1
  g.loaded_zip               = 1
  g.loaded_zipPlugin         = 1
  g.loaded_getscript         = 1
  g.loaded_getscriptPlugin   = 1
  g.loaded_vimball           = 1
  g.loaded_vimballPlugin     = 1
  g.loaded_matchit           = 1
  -- g.loaded_matchparen        = 1
  g.loaded_2html_plugin      = 1
  g.loaded_logiPat           = 1
  g.loaded_rrhelper          = 1
  g.loaded_netrw             = 1
  g.loaded_netrwPlugin       = 1
  g.loaded_netrwSettings     = 1
  g.loaded_netrwFileHandlers = 1
end

-- enable to bootstrap packer from ~/.local/share/nvim/site/pack/packer/opt/packer.nvim
-- vim.cmd [[packadd packer.nvim]]

return require'packer'.startup(function()
  -- disable built-in plugins
  disable_distribution_plugins()

  -- manage packer itself
  use {'wbthomason/packer.nvim'}

  -- git status in the sign column
  use {'mhinz/vim-signify',
    config = "require('plugins._signify')"
  }

  use {'tpope/vim-commentary'}   -- auto-comment using `gcc`
  use {'cohama/lexima.vim'}      -- auto-close parens, brackets, etc.
  use {'tpope/vim-surround'}     -- edit surroundings in pairs
  -- use {'neomake/neomake'}        -- async job runner
  use {'sbdchd/neoformat'}       -- async code formatter
  use {'justinmk/vim-dirvish'}   -- folder browser
  use {'justinmk/vim-sneak',
    config = "vim.g['sneak#label'] = true"
  }

  use {'neovim/nvim-lspconfig',
    requires = {
      {'nvim-lua/completion-nvim',
        requires = {'steelsojka/completion-buffers'},
        config = "require('plugins._completion')"},
      {'kosayoda/nvim-lightbulb', config = "require('plugins._lightbulb')"},
    },
    config = "require('plugins._lsp')"
  }

  use {'nvim-treesitter/nvim-treesitter',
    requires = {
      'nvim-lua/completion-nvim',
      'nvim-treesitter/completion-treesitter',
      'nvim-treesitter/nvim-treesitter-refactor',
    },
    config = "require('plugins._treesitter')",
    run = ':TSUpdate'
  }

  use {'nvim-telescope/telescope.nvim',
    requires = {
      'nvim-lua/popup.nvim',
      'nvim-lua/plenary.nvim',
      -- telescope plugins:
      'nvim-telescope/telescope-fzf-writer.nvim',
    },
    config = "require('plugins._telescope')"
  }

  -- polyfill for some missing stuff
  use {'tjdevries/astronauta.nvim'}

  -- snippets
  use {'SirVer/ultisnips',
    requires = {'honza/vim-snippets'},
    config = "require('plugins._ultisnips')"
  }

  use {'junegunn/vim-easy-align'}

  use {'editorconfig/editorconfig-vim',
    config = "require('plugins._editorconfig')"
  }
  -- use {'tpope/vim-sleuth'}                -- detect indentation
  use {'nathanaelkane/vim-indent-guides',
    disable = true,
    config = "require('plugins._indent-guides')"
  }

  use {'tpope/vim-repeat'}                -- extend '.' to plugins
  use {'michaeljsmith/vim-indent-object'} -- adds indentation text-objects
  use {'kshenoy/vim-signature', disable = true}           -- toggle, display and navigate marks
  use {'norcalli/nvim-colorizer.lua',
    config = "require('plugins._colorizer')"
  }

  use {'rhysd/git-messenger.vim',
    config = "require('plugins._git-messenger')"
  }

  use {'TimUntersberger/neogit'}

  use {'rhysd/conflict-marker.vim', disable = true}
  -- use {'liuchengxu/vista.vim'}            -- sidebar populated by lsp, ctags, etc.
  use {'kassio/neoterm', disable = true}

  -- zettelkasten via neuron
  -- NOTE: needs telescope.nvim and plenary.nvim
  use {'oberblastmeister/neuron.nvim',
    branch = 'unstable',
    requires = {'nvim-telescope/telescope.nvim'},
    config = "require('.plugins._neuron')"
  }

  -- languages
  -- NOTE: these should only be loaded when they are required...
  -- use {'rhysd/vim-grammarous',
  --  ft = {'markdown', 'latex', 'tex'}
  -- }
  use {'lervag/vimtex',
    ft = {'latex', 'tex'},
    config = "require('plugins._vimtex')"
  }
  use {'plasticboy/vim-markdown',
    ft = {'markdown'},
    config = "require('plugins._markdown')"
  }
  use {'masukomi/vim-markdown-folding',
    ft = {'markdown'}
  }
  use {'jjo/vim-cue',
    ft = {'cue'}
  }
  use {'gentoo/gentoo-syntax'}

  -- multi-language support with lazy loading
  -- NOTE: put language specific plugs before this to avoid conflicsts
  g.polyglot_disabled = { 'autoindent' }
  use {'sheerun/vim-polyglot'}

  -- minimal ux
  use {'junegunn/goyo.vim',
    cmd = 'Goyo',
    config = "require('plugins._goyo')"
  }
  use {'junegunn/limelight.vim',
    cmd = 'Limelight',
    config = "require('plugins._limelight')"
  }

  use {'rktjmp/lush.nvim',}
    -- config="require('colors')"}

  -- vim config debugging
  use {'dstein64/vim-startuptime', disable = true}

  -- local
  use {'~/devel/upstream/github.com/knsh14/vim-github-link'}
end)