Browse Source

nixpkgs/neovim: add range mapping for code actions

Thomas Dy 2 years ago
parent
commit
efaeb5362e
1 changed files with 1 additions and 0 deletions
  1. 1 0
      .config/nixpkgs/neovim/mappings.lua

+ 1 - 0
.config/nixpkgs/neovim/mappings.lua

@@ -61,6 +61,7 @@ function on_attach(client, bufnr)
   vim.keymap.set('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
   vim.keymap.set('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
   vim.keymap.set('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
+  vim.keymap.set('v', '<space>ca', '<cmd>lua vim.lsp.buf.range_code_action()<CR><ESC>', opts)
   vim.keymap.set('n', 'gr', '<cmd>Telescope lsp_references<CR>', opts)
   vim.keymap.set('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
   vim.keymap.set('n', '<Leader>fs', '<cmd>Telescope lsp_document_symbols<CR>', opts)