@@ -342,11 +342,7 @@ require('lazy').setup({
342
342
343
343
-- Document existing key chains
344
344
spec = {
345
- { ' <leader>c' , group = ' [C]ode' , mode = { ' n' , ' x' } },
346
- { ' <leader>d' , group = ' [D]ocument' },
347
- { ' <leader>r' , group = ' [R]ename' },
348
345
{ ' <leader>s' , group = ' [S]earch' },
349
- { ' <leader>w' , group = ' [W]orkspace' },
350
346
{ ' <leader>t' , group = ' [T]oggle' },
351
347
{ ' <leader>h' , group = ' Git [H]unk' , mode = { ' n' , ' v' } },
352
348
},
@@ -538,42 +534,42 @@ require('lazy').setup({
538
534
vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
539
535
end
540
536
541
- -- Jump to the definition of the word under your cursor.
542
- -- This is where a variable was first declared, or where a function is defined, etc.
543
- -- To jump back, press <C-t>.
544
- map (' gd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
537
+ -- Rename the variable under your cursor.
538
+ -- Most Language Servers support renaming across files, etc.
539
+ map (' grn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
540
+
541
+ -- Execute a code action, usually your cursor needs to be on top of an error
542
+ -- or a suggestion from your LSP for this to activate.
543
+ map (' gra' , vim .lsp .buf .code_action , ' [G]oto Code [A]ction' , { ' n' , ' x' })
545
544
546
545
-- Find references for the word under your cursor.
547
- map (' gr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
546
+ map (' grr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
548
547
549
548
-- Jump to the implementation of the word under your cursor.
550
549
-- Useful when your language has ways of declaring types without an actual implementation.
551
- map (' gI ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
550
+ map (' gri ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
552
551
553
- -- Jump to the type of the word under your cursor.
554
- -- Useful when you're not sure what type a variable is and you want to see
555
- -- the definition of its *type*, not where it was *defined*.
556
- map (' <leader>D' , require (' telescope.builtin' ).lsp_type_definitions , ' Type [D]efinition' )
552
+ -- Jump to the definition of the word under your cursor.
553
+ -- This is where a variable was first declared, or where a function is defined, etc.
554
+ -- To jump back, press <C-t>.
555
+ map (' grd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
556
+
557
+ -- WARN: This is not Goto Definition, this is Goto Declaration.
558
+ -- For example, in C this would take you to the header.
559
+ map (' grD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
557
560
558
561
-- Fuzzy find all the symbols in your current document.
559
562
-- Symbols are things like variables, functions, types, etc.
560
- map (' <leader>ds ' , require (' telescope.builtin' ).lsp_document_symbols , ' [D]ocument [S]ymbols ' )
563
+ map (' gO ' , require (' telescope.builtin' ).lsp_document_symbols , ' Open Document Symbols ' )
561
564
562
565
-- Fuzzy find all the symbols in your current workspace.
563
566
-- Similar to document symbols, except searches over your entire project.
564
- map (' <leader>ws' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' [W]orkspace [S]ymbols' )
565
-
566
- -- Rename the variable under your cursor.
567
- -- Most Language Servers support renaming across files, etc.
568
- map (' <leader>rn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
569
-
570
- -- Execute a code action, usually your cursor needs to be on top of an error
571
- -- or a suggestion from your LSP for this to activate.
572
- map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' , { ' n' , ' x' })
567
+ map (' gW' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' Open Workspace Symbols' )
573
568
574
- -- WARN: This is not Goto Definition, this is Goto Declaration.
575
- -- For example, in C this would take you to the header.
576
- map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
569
+ -- Jump to the type of the word under your cursor.
570
+ -- Useful when you're not sure what type a variable is and you want to see
571
+ -- the definition of its *type*, not where it was *defined*.
572
+ map (' grt' , require (' telescope.builtin' ).lsp_type_definitions , ' [G]oto [T]ype Definition' )
577
573
578
574
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
579
575
--- @param client vim.lsp.Client
0 commit comments