add plugins
This commit is contained in:
		
							parent
							
								
									5aeddfdd5d
								
							
						
					
					
						commit
						55c959d4da
					
				
							
								
								
									
										114
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										114
									
								
								init.lua
								
								
								
								
							|  | @ -1,6 +1,6 @@ | ||||||
| --[[ | --[[ | ||||||
| 
 | 
 | ||||||
| ===================================================================== | =================================================================== | ||||||
| ==================== READ THIS BEFORE CONTINUING ==================== | ==================== READ THIS BEFORE CONTINUING ==================== | ||||||
| ===================================================================== | ===================================================================== | ||||||
| ========                                    .-----.          ======== | ========                                    .-----.          ======== | ||||||
|  | @ -160,19 +160,17 @@ vim.opt.scrolloff = 10 | ||||||
| -- Set highlight on search, but clear on pressing <Esc> in normal mode | -- Set highlight on search, but clear on pressing <Esc> in normal mode | ||||||
| vim.opt.hlsearch = true | vim.opt.hlsearch = true | ||||||
| vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') | vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') | ||||||
| 
 |  | ||||||
| -- Diagnostic keymaps | -- Diagnostic keymaps | ||||||
| vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) | vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) | ||||||
| vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) | vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) | ||||||
| vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) | vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) | ||||||
| vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) | vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) | ||||||
| 
 |  | ||||||
| -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier | -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier | ||||||
| -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which | -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which | ||||||
| -- is not what someone will guess without a bit more experience. | -- is not what someone will guess without a bit more experience. | ||||||
| -- | -- | ||||||
| -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping | -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping | ||||||
| -- or just use <C-\><C-n> to exit terminal mode | -- or just use <C-\><C-n> to exit terminal modej | ||||||
| vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) | vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }) | ||||||
| 
 | 
 | ||||||
| -- TIP: Disable arrow keys in normal mode | -- TIP: Disable arrow keys in normal mode | ||||||
|  | @ -237,8 +235,93 @@ require('lazy').setup({ | ||||||
|   --  This is equivalent to: |   --  This is equivalent to: | ||||||
|   --    require('Comment').setup({}) |   --    require('Comment').setup({}) | ||||||
| 
 | 
 | ||||||
|  |   -- { 'nvim-tree/nvim-web-devicons', lazy = true, enabled = true, opts = { | ||||||
|  |   --   enabled = true, | ||||||
|  |   -- } }, | ||||||
|  | 
 | ||||||
|   -- "gc" to comment visual regions/lines |   -- "gc" to comment visual regions/lines | ||||||
|   { 'numToStr/Comment.nvim', opts = {} }, |   { 'numToStr/Comment.nvim', opts = {} }, | ||||||
|  |   -- | ||||||
|  |   -- Copilot plugin | ||||||
|  |   { | ||||||
|  |     'zbirenbaum/copilot.lua', | ||||||
|  |     opts = { suggestion = { enabled = false }, panel = { enabled = false } }, | ||||||
|  |     cmd = 'Copilot', | ||||||
|  |     event = 'InsertEnter', | ||||||
|  |     build = ':Copilot auth', | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     'zbirenbaum/copilot-cmp', | ||||||
|  |     config = function() | ||||||
|  |       require('copilot_cmp').setup() | ||||||
|  |     end, | ||||||
|  |   }, | ||||||
|  | 
 | ||||||
|  |   -- autopairs plugin | ||||||
|  |   { | ||||||
|  |     'windwp/nvim-autopairs', | ||||||
|  |     event = 'InsertEnter', | ||||||
|  |     config = true, | ||||||
|  |     opts = {}, | ||||||
|  |     -- use opts = {} for passing setup options | ||||||
|  |     -- this is equalent to setup({}) function | ||||||
|  |   }, | ||||||
|  |   -- auto closing tags | ||||||
|  |   { | ||||||
|  |     'windwp/nvim-ts-autotag', | ||||||
|  |     opts = { | ||||||
|  |       enable_close = true, | ||||||
|  |       enable_rename = true, | ||||||
|  |       enable_close_on_slash = true, | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  | 
 | ||||||
|  |   { | ||||||
|  |     'nvim-neo-tree/neo-tree.nvim', | ||||||
|  |     branch = 'v3.x', | ||||||
|  |     dependencies = { | ||||||
|  |       'nvim-lua/plenary.nvim', | ||||||
|  |       { 'nvim-tree/nvim-web-devicons', enabled = true, opts = { enabled = true } }, | ||||||
|  |       -- not strictly required, but recommended | ||||||
|  |       'MunifTanjim/nui.nvim', | ||||||
|  |       -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information | ||||||
|  |     }, | ||||||
|  |     keys = { | ||||||
|  |       { | ||||||
|  |         '<leader>fe', | ||||||
|  |         function() | ||||||
|  |           require('neo-tree.command').execute { toggle = true, dir = vim.fn.getcwd() } | ||||||
|  |         end, | ||||||
|  |         desc = 'Explorer NeoTree (Root Dir)', | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         '<leader>fE', | ||||||
|  |         function() | ||||||
|  |           require('neo-tree.command').execute { toggle = true, dir = vim.uv.cwd() } | ||||||
|  |         end, | ||||||
|  |         desc = 'Explorer NeoTree (cwd)', | ||||||
|  |       }, | ||||||
|  |       { '<leader>e', '<leader>fe', desc = 'Explorer NeoTree (Root Dir)', remap = true }, | ||||||
|  |       { '<leader>E', '<leader>fE', desc = 'Explorer NeoTree (cwd)', remap = true }, | ||||||
|  |       { | ||||||
|  |         '<leader>ge', | ||||||
|  |         function() | ||||||
|  |           require('neo-tree.command').execute { source = 'git_status', toggle = true } | ||||||
|  |         end, | ||||||
|  |         desc = 'Git Explorer', | ||||||
|  |       }, | ||||||
|  |       { | ||||||
|  |         '<leader>be', | ||||||
|  |         function() | ||||||
|  |           require('neo-tree.command').execute { source = 'buffers', toggle = true } | ||||||
|  |         end, | ||||||
|  |         desc = 'Buffer Explorer', | ||||||
|  |       }, | ||||||
|  |     }, | ||||||
|  |     deactivate = function() | ||||||
|  |       vim.cmd [[Neotree close]] | ||||||
|  |     end, | ||||||
|  |   }, | ||||||
| 
 | 
 | ||||||
|   -- Here is a more advanced example where we pass configuration |   -- Here is a more advanced example where we pass configuration | ||||||
|   -- options to `gitsigns.nvim`. This is equivalent to the following Lua: |   -- options to `gitsigns.nvim`. This is equivalent to the following Lua: | ||||||
|  | @ -325,7 +408,7 @@ require('lazy').setup({ | ||||||
|       { 'nvim-telescope/telescope-ui-select.nvim' }, |       { 'nvim-telescope/telescope-ui-select.nvim' }, | ||||||
| 
 | 
 | ||||||
|       -- Useful for getting pretty icons, but requires a Nerd Font. |       -- Useful for getting pretty icons, but requires a Nerd Font. | ||||||
|       { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font }, |       { 'nvim-tree/nvim-web-devicons' }, | ||||||
|     }, |     }, | ||||||
|     config = function() |     config = function() | ||||||
|       -- Telescope is a fuzzy finder that comes with a lot of different things that |       -- Telescope is a fuzzy finder that comes with a lot of different things that | ||||||
|  | @ -565,19 +648,18 @@ require('lazy').setup({ | ||||||
|       --  - settings (table): Override the default settings passed when initializing the server. |       --  - settings (table): Override the default settings passed when initializing the server. | ||||||
|       --        For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ |       --        For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ | ||||||
|       local servers = { |       local servers = { | ||||||
|         -- clangd = {}, |         clangd = {}, | ||||||
|         -- gopls = {}, |         gopls = {}, | ||||||
|         -- pyright = {}, |         pyright = {}, | ||||||
|         -- rust_analyzer = {}, |         rust_analyzer = {}, | ||||||
|         -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs |         -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs | ||||||
|         -- |         -- | ||||||
|         -- Some languages (like typescript) have entire language plugins that can be useful: |         -- Some languages (like typescript) have entire language plugins that can be useful: | ||||||
|         --    https://github.com/pmizio/typescript-tools.nvim |         --    https://github.com/pmizio/typescript-tools.nvim | ||||||
|         -- |         -- | ||||||
|         -- But for many setups, the LSP (`tsserver`) will work just fine |         -- But for many setups, the LSP (`tsserver`) will work just fine | ||||||
|         -- tsserver = {}, |         tsserver = {}, | ||||||
|         -- |         -- | ||||||
| 
 |  | ||||||
|         lua_ls = { |         lua_ls = { | ||||||
|           -- cmd = {...}, |           -- cmd = {...}, | ||||||
|           -- filetypes = { ...}, |           -- filetypes = { ...}, | ||||||
|  | @ -607,6 +689,7 @@ require('lazy').setup({ | ||||||
|       local ensure_installed = vim.tbl_keys(servers or {}) |       local ensure_installed = vim.tbl_keys(servers or {}) | ||||||
|       vim.list_extend(ensure_installed, { |       vim.list_extend(ensure_installed, { | ||||||
|         'stylua', -- Used to format Lua code |         'stylua', -- Used to format Lua code | ||||||
|  |         'prismals', | ||||||
|       }) |       }) | ||||||
|       require('mason-tool-installer').setup { ensure_installed = ensure_installed } |       require('mason-tool-installer').setup { ensure_installed = ensure_installed } | ||||||
| 
 | 
 | ||||||
|  | @ -653,11 +736,12 @@ require('lazy').setup({ | ||||||
|       formatters_by_ft = { |       formatters_by_ft = { | ||||||
|         lua = { 'stylua' }, |         lua = { 'stylua' }, | ||||||
|         -- Conform can also run multiple formatters sequentially |         -- Conform can also run multiple formatters sequentially | ||||||
|         -- python = { "isort", "black" }, |         python = { 'isort', 'black' }, | ||||||
|         -- |         -- | ||||||
|         -- You can use a sub-list to tell conform to run *until* a formatter |         -- You can use a sub-list to tell conform to run *until* a formatter | ||||||
|         -- is found. |         -- is found. | ||||||
|         -- javascript = { { "prettierd", "prettier" } }, |         javascript = { { 'prettierd', 'prettier' } }, | ||||||
|  |         prisma = { { 'prettierd', 'prettier' } }, | ||||||
|       }, |       }, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|  | @ -768,6 +852,8 @@ require('lazy').setup({ | ||||||
|           { name = 'nvim_lsp' }, |           { name = 'nvim_lsp' }, | ||||||
|           { name = 'luasnip' }, |           { name = 'luasnip' }, | ||||||
|           { name = 'path' }, |           { name = 'path' }, | ||||||
|  |           -- Copilot Source | ||||||
|  |           { name = 'copilot', group_index = 2 }, | ||||||
|         }, |         }, | ||||||
|       } |       } | ||||||
|     end, |     end, | ||||||
|  | @ -807,7 +893,7 @@ require('lazy').setup({ | ||||||
| 
 | 
 | ||||||
|       -- Add/delete/replace surroundings (brackets, quotes, etc.) |       -- Add/delete/replace surroundings (brackets, quotes, etc.) | ||||||
|       -- |       -- | ||||||
|       -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren |       -- - saiw) - Surround   [A]dd [I]nner [W]ord [)]Paren | ||||||
|       -- - sd'   - [S]urround [D]elete [']quotes |       -- - sd'   - [S]urround [D]elete [']quotes | ||||||
|       -- - sr)'  - [S]urround [R]eplace [)] ['] |       -- - sr)'  - [S]urround [R]eplace [)] ['] | ||||||
|       require('mini.surround').setup() |       require('mini.surround').setup() | ||||||
|  |  | ||||||
|  | @ -6,7 +6,7 @@ return { | ||||||
|   version = '*', |   version = '*', | ||||||
|   dependencies = { |   dependencies = { | ||||||
|     'nvim-lua/plenary.nvim', |     'nvim-lua/plenary.nvim', | ||||||
|     'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended |     'nvim-tree/nvim-web-devicons', | ||||||
|     'MunifTanjim/nui.nvim', |     'MunifTanjim/nui.nvim', | ||||||
|   }, |   }, | ||||||
|   cmd = 'Neotree', |   cmd = 'Neotree', | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue