add autopairs
This commit is contained in:
		
							parent
							
								
									ea028fe0b5
								
							
						
					
					
						commit
						4bddb73128
					
				
							
								
								
									
										15
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										15
									
								
								init.lua
								
								
								
								
							| 
						 | 
					@ -84,7 +84,7 @@ require('lazy').setup({
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      -- Useful status updates for LSP
 | 
					      -- Useful status updates for LSP
 | 
				
			||||||
      -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
 | 
					      -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})`
 | 
				
			||||||
      { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
 | 
					      { 'j-hui/fidget.nvim',       tag = 'legacy', opts = {} },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      -- Additional lua configuration, makes nvim stuff amazing!
 | 
					      -- Additional lua configuration, makes nvim stuff amazing!
 | 
				
			||||||
      'folke/neodev.nvim',
 | 
					      'folke/neodev.nvim',
 | 
				
			||||||
| 
						 | 
					@ -108,7 +108,7 @@ require('lazy').setup({
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- Useful plugin to show you pending keybinds.
 | 
					  -- Useful plugin to show you pending keybinds.
 | 
				
			||||||
  { 'folke/which-key.nvim', opts = {} },
 | 
					  { 'folke/which-key.nvim',          opts = {} },
 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    -- Adds git releated signs to the gutter, as well as utilities for managing changes
 | 
					    -- Adds git releated signs to the gutter, as well as utilities for managing changes
 | 
				
			||||||
    'lewis6991/gitsigns.nvim',
 | 
					    'lewis6991/gitsigns.nvim',
 | 
				
			||||||
| 
						 | 
					@ -122,7 +122,8 @@ require('lazy').setup({
 | 
				
			||||||
        changedelete = { text = '~' },
 | 
					        changedelete = { text = '~' },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      on_attach = function(bufnr)
 | 
					      on_attach = function(bufnr)
 | 
				
			||||||
        vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk, { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
 | 
					        vim.keymap.set('n', '<leader>gp', require('gitsigns').prev_hunk,
 | 
				
			||||||
 | 
					          { buffer = bufnr, desc = '[G]o to [P]revious Hunk' })
 | 
				
			||||||
        vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
 | 
					        vim.keymap.set('n', '<leader>gn', require('gitsigns').next_hunk, { buffer = bufnr, desc = '[G]o to [N]ext Hunk' })
 | 
				
			||||||
        vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
 | 
					        vim.keymap.set('n', '<leader>ph', require('gitsigns').preview_hunk, { buffer = bufnr, desc = '[P]review [H]unk' })
 | 
				
			||||||
      end,
 | 
					      end,
 | 
				
			||||||
| 
						 | 
					@ -164,7 +165,7 @@ require('lazy').setup({
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- "gc" to comment visual regions/lines
 | 
					  -- "gc" to comment visual regions/lines
 | 
				
			||||||
  { 'numToStr/Comment.nvim', opts = {} },
 | 
					  { 'numToStr/Comment.nvim',         opts = {} },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- Fuzzy Finder (files, lsp, etc)
 | 
					  -- Fuzzy Finder (files, lsp, etc)
 | 
				
			||||||
  { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
 | 
					  { 'nvim-telescope/telescope.nvim', branch = '0.1.x', dependencies = { 'nvim-lua/plenary.nvim' } },
 | 
				
			||||||
| 
						 | 
					@ -194,8 +195,8 @@ require('lazy').setup({
 | 
				
			||||||
  -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
 | 
					  -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
 | 
				
			||||||
  --       These are some example plugins that I've included in the kickstart repository.
 | 
					  --       These are some example plugins that I've included in the kickstart repository.
 | 
				
			||||||
  --       Uncomment any of the lines below to enable them.
 | 
					  --       Uncomment any of the lines below to enable them.
 | 
				
			||||||
  -- require 'kickstart.plugins.autoformat',
 | 
					  require 'kickstart.plugins.autoformat',
 | 
				
			||||||
  -- require 'kickstart.plugins.debug',
 | 
					  require 'kickstart.plugins.debug',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
 | 
					  -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
 | 
				
			||||||
  --    You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
 | 
					  --    You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
 | 
				
			||||||
| 
						 | 
					@ -203,7 +204,7 @@ require('lazy').setup({
 | 
				
			||||||
  --    Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
 | 
					  --    Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
 | 
				
			||||||
  --
 | 
					  --
 | 
				
			||||||
  --    For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
 | 
					  --    For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
 | 
				
			||||||
  -- { import = 'custom.plugins' },
 | 
					  { import = 'custom.plugins' },
 | 
				
			||||||
}, {})
 | 
					}, {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- [[ Setting options ]]
 | 
					-- [[ Setting options ]]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
						"windwp/nvim-autopairs",
 | 
				
			||||||
 | 
						-- Optional dependency
 | 
				
			||||||
 | 
						dependencies = { 'hrsh7th/nvim-cmp' },
 | 
				
			||||||
 | 
						config = function()
 | 
				
			||||||
 | 
							require("nvim-autopairs").setup {}
 | 
				
			||||||
 | 
							-- If you want to automatically add '(' after selecting a function or method
 | 
				
			||||||
 | 
							local cmp_autopairs = require('nvim-autopairs.completion.cmp')
 | 
				
			||||||
 | 
							local cmp = require('cmp')
 | 
				
			||||||
 | 
							cmp.event:on(
 | 
				
			||||||
 | 
								'confirm_done',
 | 
				
			||||||
 | 
								cmp_autopairs.on_confirm_done()
 | 
				
			||||||
 | 
							)
 | 
				
			||||||
 | 
						end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue