aboutsummaryrefslogtreecommitdiff
path: root/nvim/lua/plugins.lua
blob: b67c00763f2c6e74f0c9b2147efa5a42fc8229f3 (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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
require('lazy').setup({
	{
		'cranberry-clockworks/coal.nvim',
		lazy = false,
		priority = 1000,
		config = function()
			vim.cmd.colorscheme('coal')
			vim.cmd('highlight Normal guibg=NONE ctermbg=NONE')
			vim.cmd('highlight LineNr guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE')
			vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE')
			vim.cmd('highlight CursorLine guibg=NONE ctermbg=NONE')
			-- completion menu transparent
			vim.cmd('highlight Pmenu guibg=NONE ctermbg=NONE')
			vim.cmd('highlight PmenuSel guibg=NONE ctermbg=NONE')
			-- vertical lines transparent
			vim.cmd('highlight WinSeparator guibg=None ctermbg=None')
			vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE')

			vim.cmd('highlight SignColumn guibg=NONE ctermbg=None')
		end
	},
	-- 
	{
		'jesseleite/nvim-noirbuddy',
		enabled = false,
		lazy = false,
		priority = 1000,
		dependencies = { 'tjdevries/colorbuddy.nvim' },
		config = function()
			require('noirbuddy').setup({
			  preset = 'minimal',
			})
			vim.cmd('colorscheme noirbuddy')
			-- nvim transparent
			vim.cmd('highlight Normal guibg=NONE ctermbg=NONE')
			vim.cmd('highlight LineNr guifg=NONE guibg=NONE ctermfg=NONE ctermbg=NONE')
			vim.cmd('highlight NormalNC guibg=NONE ctermbg=NONE')
			vim.cmd('highlight CursorLine guibg=NONE ctermbg=NONE')
			-- completion menu transparent
			vim.cmd('highlight Pmenu guibg=NONE ctermbg=NONE')
			vim.cmd('highlight PmenuSel guibg=NONE ctermbg=NONE')
			-- vertical lines transparent
			vim.cmd('highlight VertSplit guibg=NONE ctermbg=NONE')
		end
	},
	-- Portable package manager to install and manage LSP servers, DAP servers, linters, and formatters.
  {
    'williamboman/mason.nvim',
		dependencies = { 'williamboman/mason-lspconfig.nvim' },
    config = function()
      require('mason').setup()
			require('mason-lspconfig').setup({
				automatic_installation = true,
			})
    end
  },
  -- A completion engine plugin for neovim written in Lua.
  {
    'hrsh7th/nvim-cmp',
    lazy = false,
		dependencies = {
			{
				'neovim/nvim-lspconfig',
				config = function()
					local signs = {
						Error = " ",
						Warn= " ",
						Hint = " ",
						Info= " "
					}
					for type, icon in pairs(signs) do
    				local hl = "DiagnosticSign" .. type
    				vim.fn.sign_define(hl, {text = icon, texthl = hl, numhl = hl})
					end

					local lsp = require('lspconfig')
          	local capabilities = require('cmp_nvim_lsp').default_capabilities()
          	lsp.pyright.setup{
        	  	capabilities = capabilities,
            	settings = {
              	update_in_insert = true,
              }
            }
            lsp.lua_ls.setup {
              capabilities = capabilities,
              settings = {
              	Lua = {
                	diagnostics = {
                  	-- Get the language server to recognize the 'vim' global
                    globals = { 'vim' },
                  },
									workspace = {
                  	-- make the server aware of the neovim runtime files
                    libary = vim.api.nvim_get_runtime_file('', true)
                  },
                  telemetry = {
                  	-- do not send telemetry data containing a randomized but unique identifier
                    enable = false,
                  }
								}
              }
            }
        end
      },
      'hrsh7th/cmp-nvim-lsp',
      'hrsh7th/cmp-buffer',
      'hrsh7th/cmp-path',
      'hrsh7th/cmp-cmdline',
      'L3MON4D3/LuaSnip',
    },
    config = function()
        local has_words_before = function()
            unpack = unpack or table.unpack
            local line, col = unpack(vim.api.nvim_win_get_cursor(0))
            return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
        end

        local cmp = require('cmp')
        local luasnip = require("luasnip")
        cmp.setup( {
            snippet = {
                expand = function(args)
                    luasnip.lsp_expand(args.body)
                end
            },
            mapping = {
            ['<C-d>'] = cmp.mapping.scroll_docs(-4),
            ['<C-f>'] = cmp.mapping.scroll_docs(4),
            ['<C-Space>'] = cmp.mapping.complete(),
            ['<C-e>'] = cmp.mapping.close(),
            ['<CR>'] = cmp.mapping.confirm {
                    behavior = cmp.ConfirmBehavior.Insert,
                    select = true,
            },
            ["<Tab>"] = cmp.mapping(function(fallback)
                if cmp.visible() then
                  cmp.select_next_item()
                  -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
                  -- this way you will only jump inside the snippet region
                elseif luasnip.expand_or_jumpable() then
                  luasnip.expand_or_jump()
                elseif has_words_before() then
                  cmp.complete()
                else
                  fallback()
                end
              end, { "i", "s" }),
              ["<S-Tab>"] = cmp.mapping(function(fallback)
                if cmp.visible() then
                  cmp.select_prev_item()
                elseif luasnip.jumpable(-1) then
                  luasnip.jump(-1)
                else
                  fallback()
                end
              end, { "i", "s" }),
            },
            sources = cmp.config.sources({
                { name = 'nvim_lsp' },
                { name = 'luasnip' },
                { name = 'buffer' },
                { name = 'nvim_lua' },
                { name = 'path' },
            }),
        })
    end
  },
  -- A super powerful autopair plugin for Neovim that supports multiple characters.
  {
  	'windwp/nvim-autopairs',
		config = function()
      require("nvim-autopairs").setup()
      -- inserts `(` after selecting a function or method item
      require('cmp').event:on('confirm_done', require('nvim-autopairs.completion.cmp').on_confirm_done())
  	end
  },
  -- Adds indentation guides to all lines.
  {
  	'lukas-reineke/indent-blankline.nvim',
  	main = "ibl",
		opt = {
			filetypes = {
				"help",
				"terminal",
				"alpha",
				"lazy",
				"NvimTree"
			}
		}
  },
  --
  {
    'nvim-treesitter/nvim-treesitter',
    build = ':TSUpdate',
    config = function()
    	require('nvim-treesitter.configs').setup({
				auto_install = true,
				ensure_installed = { 'c', 'lua', 'vim'},
        highlight = {
        	enable = true,
        	use_languagetree = true
      	},
      	indent = { enable=true },
    	})
    end
  },
  -- A File Explorer for Neovim written in Lua
  {
		'nvim-tree/nvim-tree.lua',
    config = function ()
      -- disable netrw (inbuild file explorer)
      require('nvim-tree').setup({
				view = {
					width = 20,
					side = 'left',
				},
				disable_netrw = true,
				hijack_cursor = true,
				update_cwd = true,
				hijack_directories = {
					auto_open = true,
				},
				renderer = {
          root_folder_label = false,
					indent_markers = {
						enable = true,
						icons = {
							corner = "└ ",
        			edge = "│ ",
        			none = "  ",
						}
					}
				}
			})
    end
  },
  -- 
  {
		'nvim-telescope/telescope.nvim',
		dependencies = {
			'nvim-lua/plenary.nvim'
		},
		config = function()
			require('telescope').setup({
				defaults = {
					mapping = {
					}
				},
				pickers = {
				},
				extensions = {
				}
			})
			vim.api.nvim_set_keymap('n', '<C-s>', ':Telescope current_buffer_fuzzy_find<CR>', { noremap = true, silent = true })
		end
	},
	--
	{
		'numToStr/Comment.nvim',
		config = function()
			require('Comment').setup({})
		end
	},
	-- Customize start up screen
	{
		'goolord/alpha-nvim',
		event = 'VimEnter',
		dependencies = { 'nvim-tree/nvim-web-devicons' },
		config = function ()
			local mew = {
				'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡴⠞⢳⠀⠀⠀⠀⠀',
				'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡔⠋⠀⢰⠎⠀⠀⠀⠀⠀',
				'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢆⣤⡞⠃⠀⠀⠀⠀⠀⠀',
				'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⢠⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀',
				'⠀⠀⠀⠀⢀⣀⣾⢳⠀⠀⠀⠀⢸⢠⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀',
				'⣀⡤⠴⠊⠉⠀⠀⠈⠳⡀⠀⠀⠘⢎⠢⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀',
				'⠳⣄⠀⠀⡠⡤⡀⠀⠘⣇⡀⠀⠀⠀⠉⠓⠒⠺⠭⢵⣦⡀⠀⠀⠀',
				'⠀⢹⡆⠀⢷⡇⠁⠀⠀⣸⠇⠀⠀⠀⠀⠀⢠⢤⠀⠀⠘⢷⣆⡀⠀',
				'⠀⠀⠘⠒⢤⡄⠖⢾⣭⣤⣄⠀⡔⢢⠀⡀⠎⣸⠀⠀⠀⠀⠹⣿⡀',
				'⠀⠀⢀⡤⠜⠃⠀⠀⠘⠛⣿⢸⠀⡼⢠⠃⣤⡟⠀⠀⠀⠀⠀⣿⡇',
				'⠀⠀⠸⠶⠖⢏⠀⠀⢀⡤⠤⠇⣴⠏⡾⢱⡏⠁⠀⠀⠀⠀⢠⣿⠃',
				'⠀⠀⠀⠀⠀⠈⣇⡀⠿⠀⠀⠀⡽⣰⢶⡼⠇⠀⠀⠀⠀⣠⣿⠟⠀',
				'⠀⠀⠀⠀⠀⠀⠈⠳⢤⣀⡶⠤⣷⣅⡀⠀⠀⠀⣀⡠⢔⠕⠁⠀⠀',
				'⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠙⠫⠿⠿⠿⠛⠋⠁⠀⠀⠀⠀',
				'',
			}
			local alpha = require('alpha')
			local dashboard = require('alpha.themes.dashboard')
			dashboard.section.header.val = mew
			dashboard.section.buttons.val = {
        dashboard.button('f', '  Find Files', ':Telescope find_files <CR>'),
        dashboard.button('r', '󱔗  Recent Files', ':Telescope oldfiles <CR>'),
        dashboard.button('u', '  Update Plugins', ':Lazy update <CR>'),
        dashboard.button('q', '  Quit Neovim', ':q! <CR>'),
			}
      dashboard.section.buttons.opts.spacing = 1
			dashboard.section.footer.val = 'Never knows best'
			dashboard.opts.opts.noautocmd = true
			alpha.setup(dashboard.opts)
		end
	},
	--
	{
		'tamton-aquib/staline.nvim',
		dependencies = { 'nvim-tree/nvim-web-devicons' },
		config = function ()
      require "staline".setup {
        sections = {
          left = { ' ' },
          mid = {'lsp'},
          right = { 'line_column' }
        },
				lsp_symbols = { Error=" ", Info=" ", Warn=" ", Hint="" },
        defaults = {
          true_colors = true,
          line_column = ' ☰ %l/%L %c',
          branch_symbol = " ",
					exclude_fts = { 'NvimTree', 'Alpha' },
        },
      }
			-- remove background color
			vim.cmd('highlight Statusline guibg=none')
			vim.cmd('highlight StatuslineNC guibg=none')
    end
	},
})