summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins.lua
blob: 14960eefdc24f248c007e1299b0b2c860c8d9f36 (plain)
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
return {
  -- Packer can manage itself as an optional plugin
  { "wbthomason/packer.nvim" },
  { "neovim/nvim-lspconfig" },
  { "tamago324/nlsp-settings.nvim" },
  { "jose-elias-alvarez/null-ls.nvim" },
  {
    "kabouzeid/nvim-lspinstall",
    event = "VimEnter",
    config = function()
      local lspinstall = require "lspinstall"
      lspinstall.setup()
      if options.builtin.lspinstall.on_config_done then
        options.builtin.lspinstall.on_config_done(lspinstall)
      end
    end,
  },

  { "nvim-lua/popup.nvim" },
  { "nvim-lua/plenary.nvim" },
  { "tjdevries/astronauta.nvim" },

  -- Telescope
  {
    "nvim-telescope/telescope.nvim",
    config = function()
      require("core.telescope").setup()
      if options.builtin.telescope.on_config_done then
        options.builtin.telescope.on_config_done(require "telescope")
      end
    end,
  },

  -- Autocomplete
  {
    "hrsh7th/nvim-compe",
    -- event = "InsertEnter",
    config = function()
      require("core.compe").setup()
      if options.builtin.compe.on_config_done then
        options.builtin.compe.on_config_done(require "compe")
      end
    end,
  },

  -- Autopairs
  {
    "windwp/nvim-autopairs",
    -- event = "InsertEnter",
    config = function()
      require "core.autopairs"
      if options.builtin.autopairs.on_config_done then
        options.builtin.autopairs.on_config_done(require "nvim-autopairs")
      end
    end,
  },

  -- Snippets

  { "hrsh7th/vim-vsnip", event = "InsertEnter" },
  { "rafamadriz/friendly-snippets", event = "InsertEnter" },

  -- Treesitter
  {
    "nvim-treesitter/nvim-treesitter",
    config = function()
      require("core.treesitter").setup()
      if options.builtin.treesitter.on_config_done then
        options.builtin.treesitter.on_config_done(require "nvim-treesitter.configs")
      end
    end,
  },

  -- NvimTree
  {
    "kyazdani42/nvim-tree.lua",
    -- event = "BufWinOpen",
    -- cmd = "NvimTreeToggle",
    -- commit = "fd7f60e242205ea9efc9649101c81a07d5f458bb",
    config = function()
      require("core.nvimtree").setup()
      if options.builtin.nvimtree.on_config_done then
        options.builtin.nvimtree.on_config_done(require "nvim-tree.config")
      end
    end,
  },

  {
    "lewis6991/gitsigns.nvim",
    config = function()
      require("core.gitsigns").setup()
      if options.builtin.gitsigns.on_config_done then
        options.builtin.gitsigns.on_config_done(require "gitsigns")
      end
    end,
    event = "BufRead",
  },

  -- whichkey
  {
    "folke/which-key.nvim",
    config = function()
      require("core.which-key").setup()
      if options.builtin.which_key.on_config_done then
        options.builtin.which_key.on_config_done(require "which-key")
      end
    end,
    event = "BufWinEnter",
  },

  -- Comments
  {
    "terrortylor/nvim-comment",
    event = "BufRead",
    config = function()
      local status_ok, nvim_comment = pcall(require, "nvim_comment")
      if not status_ok then
        local Log = require "core.log"
        Log:get_default().error "Failed to load nvim-comment"
        return
      end
      nvim_comment.setup()
      if options.builtin.comment.on_config_done then
        options.builtin.comment.on_config_done(nvim_comment)
      end
    end,
  },

  {
    "ahmedkhalf/lsp-rooter.nvim",
    config = function()
      if options.builtin.rooter.on_config_done then
        options.builtin.rooter.on_config_done()
      end
    end,
  },

  -- Icons
  { "kyazdani42/nvim-web-devicons" },

  -- Status Line and Bufferline
  {
    "glepnir/galaxyline.nvim",
    config = function()
      require "core.galaxyline"
      if options.builtin.galaxyline.on_config_done then
        options.builtin.galaxyline.on_config_done(require "galaxyline")
      end
    end,
    event = "BufWinEnter",
    disable = not options.builtin.galaxyline.active,
  },

  {
    "romgrk/barbar.nvim",
    config = function()
      require "core.bufferline"
      if options.builtin.bufferline.on_config_done then
        options.builtin.bufferline.on_config_done()
      end
    end,
    event = "BufWinEnter",
  },

  -- Debugging
  {
    "mfussenegger/nvim-dap",
    -- event = "BufWinEnter",
    config = function()
      require("core.dap").setup()
      if options.builtin.dap.on_config_done then
        options.builtin.dap.on_config_done(require "dap")
      end
    end,
    disable = not options.builtin.dap.active,
  },

  -- Debugger management
  {
    "Pocco81/DAPInstall.nvim",
    -- event = "BufWinEnter",
    -- event = "BufRead",
    disable = not options.builtin.dap.active,
  },

  -- Builtins, these do not load by default

  -- Dashboard
  {
    "ChristianChiarulli/dashboard-nvim",
    event = "BufWinEnter",
    config = function()
      require("core.dashboard").setup()
      if options.builtin.dashboard.on_config_done then
        options.builtin.dashboard.on_config_done(require "dashboard")
      end
    end,
    disable = not options.builtin.dashboard.active,
  },

  {
    "akinsho/nvim-toggleterm.lua",
    event = "BufWinEnter",
    config = function()
      require("core.terminal").setup()
      if options.builtin.terminal.on_config_done then
        options.builtin.terminal.on_config_done(require "toggleterm")
      end
    end,
    disable = not options.builtin.terminal.active,
  },
}