modofied configs
This commit is contained in:
		
							parent
							
								
									6b3424c590
								
							
						
					
					
						commit
						00e032f378
					
				| 
						 | 
				
			
			@ -54,6 +54,7 @@ vim.keymap.set('n', '<leader>/', function()
 | 
			
		|||
    winblend = 10,
 | 
			
		||||
    previewer = false,
 | 
			
		||||
  })
 | 
			
		||||
  -- require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes'))
 | 
			
		||||
end, { desc = '[/] Fuzzily search in current buffer' })
 | 
			
		||||
 | 
			
		||||
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
 | 
			
		||||
| 
						 | 
				
			
			@ -72,7 +73,27 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
 | 
			
		|||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
 | 
			
		||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next 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' })
 | 
			
		||||
 | 
			
		||||
-- Open the diagnostics location list
 | 
			
		||||
vim.keymap.set('n', '<leader>q', function()
 | 
			
		||||
  vim.diagnostic.setloclist()
 | 
			
		||||
  vim.cmd('lopen')
 | 
			
		||||
end, {
 | 
			
		||||
  noremap = true,
 | 
			
		||||
  silent = true,
 | 
			
		||||
  expr = false,
 | 
			
		||||
  desc = 'Open the diagnostics location list'
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- Close the diagnostics location list
 | 
			
		||||
vim.keymap.set('n', '<leader>qq', function()
 | 
			
		||||
  vim.cmd('lclose')
 | 
			
		||||
end, {
 | 
			
		||||
  noremap = true,
 | 
			
		||||
  silent = true,
 | 
			
		||||
  expr = false,
 | 
			
		||||
  desc = 'Close the diagnostics location list'
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- [[ Highlight on yank ]]
 | 
			
		||||
-- See `:help vim.highlight.on_yank()`
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,12 @@ return {
 | 
			
		|||
      end
 | 
			
		||||
 | 
			
		||||
      nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
 | 
			
		||||
      nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
 | 
			
		||||
      nmap('<leader>ca', function()
 | 
			
		||||
        vim.lsp.buf.code_action(require('telescope.themes').get_dropdown {
 | 
			
		||||
          winblend = 10,
 | 
			
		||||
          previewer = false,
 | 
			
		||||
        })
 | 
			
		||||
      end, '[C]ode [A]ction')
 | 
			
		||||
 | 
			
		||||
      nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
 | 
			
		||||
      nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
 | 
			
		||||
| 
						 | 
				
			
			@ -58,17 +63,17 @@ return {
 | 
			
		|||
      end, '[W]orkspace [L]ist Folders')
 | 
			
		||||
 | 
			
		||||
      -- Create a command `:Format` local to the LSP buffer
 | 
			
		||||
      vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
 | 
			
		||||
        vim.lsp.buf.format()
 | 
			
		||||
      end, { desc = 'Format current buffer with LSP and lint' })
 | 
			
		||||
      -- vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
 | 
			
		||||
      --   vim.lsp.buf.format()
 | 
			
		||||
      -- end, { desc = 'Format current buffer with LSP and lint' })
 | 
			
		||||
 | 
			
		||||
      -- Enable auto-formatting on save
 | 
			
		||||
      -- vim.api.nvim_command([[
 | 
			
		||||
      --   augroup AutoFormatOnSave
 | 
			
		||||
      --     autocmd!
 | 
			
		||||
      --     autocmd BufWritePre * :Format
 | 
			
		||||
      --   augroup END
 | 
			
		||||
      -- ]])
 | 
			
		||||
      vim.api.nvim_command([[
 | 
			
		||||
        augroup AutoFormatOnSave
 | 
			
		||||
          autocmd!
 | 
			
		||||
          autocmd BufWritePre * :Format
 | 
			
		||||
        augroup END
 | 
			
		||||
      ]])
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    -- Setup neovim lua configuration
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue