refact: add cmp comments, other
This commit is contained in:
		
							parent
							
								
									8a647f4384
								
							
						
					
					
						commit
						8e8ba26a96
					
				
							
								
								
									
										17
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										17
									
								
								init.lua
								
								
								
								
							| 
						 | 
					@ -94,7 +94,17 @@ require('lazy').setup({
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    -- Autocompletion
 | 
					    -- Autocompletion
 | 
				
			||||||
    'hrsh7th/nvim-cmp',
 | 
					    'hrsh7th/nvim-cmp',
 | 
				
			||||||
    dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', 'rafamadriz/friendly-snippets' },
 | 
					    dependencies = {
 | 
				
			||||||
 | 
					      -- Snippet Engine & its associated nvim-cmp source
 | 
				
			||||||
 | 
					      'L3MON4D3/LuaSnip',
 | 
				
			||||||
 | 
					      'saadparwaiz1/cmp_luasnip',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -- Adds LSP completion capabilities
 | 
				
			||||||
 | 
					      'hrsh7th/cmp-nvim-lsp',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      -- Adds a number of user-friendly snippets
 | 
				
			||||||
 | 
					      'rafamadriz/friendly-snippets',
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- Useful plugin to show you pending keybinds.
 | 
					  -- Useful plugin to show you pending keybinds.
 | 
				
			||||||
| 
						 | 
					@ -366,7 +376,7 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos
 | 
				
			||||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
 | 
					vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
 | 
					vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- LSP settings.
 | 
					-- [[ Configure LSP ]]
 | 
				
			||||||
--  This function gets run when an LSP connects to a particular buffer.
 | 
					--  This function gets run when an LSP connects to a particular buffer.
 | 
				
			||||||
local on_attach = function(_, bufnr)
 | 
					local on_attach = function(_, bufnr)
 | 
				
			||||||
  -- NOTE: Remember that lua is a real programming language, and as such it is possible
 | 
					  -- NOTE: Remember that lua is a real programming language, and as such it is possible
 | 
				
			||||||
| 
						 | 
					@ -455,7 +465,8 @@ mason_lspconfig.setup_handlers {
 | 
				
			||||||
  end,
 | 
					  end,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- nvim-cmp setup
 | 
					-- [[ Configure nvim-cmp ]]
 | 
				
			||||||
 | 
					-- See `:help cmp`
 | 
				
			||||||
local cmp = require 'cmp'
 | 
					local cmp = require 'cmp'
 | 
				
			||||||
local luasnip = require 'luasnip'
 | 
					local luasnip = require 'luasnip'
 | 
				
			||||||
require('luasnip.loaders.from_vscode').lazy_load()
 | 
					require('luasnip.loaders.from_vscode').lazy_load()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue