@@ -385,11 +385,7 @@ require('lazy').setup({
385
385
386
386
-- Document existing key chains
387
387
spec = {
388
- { ' <leader>c' , group = ' [C]ode' , mode = { ' n' , ' x' } },
389
- { ' <leader>d' , group = ' [D]ocument' },
390
- { ' <leader>r' , group = ' [R]ename' },
391
388
{ ' <leader>s' , group = ' [S]earch' },
392
- { ' <leader>w' , group = ' [W]orkspace' },
393
389
{ ' <leader>t' , group = ' [T]oggle' },
394
390
{ ' <leader>h' , group = ' Git [H]unk' , mode = { ' n' , ' v' } },
395
391
},
@@ -581,42 +577,42 @@ require('lazy').setup({
581
577
vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
582
578
end
583
579
584
- -- Jump to the definition of the word under your cursor.
585
- -- This is where a variable was first declared, or where a function is defined, etc.
586
- -- To jump back, press <C-t>.
587
- map (' gd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
580
+ -- Rename the variable under your cursor.
581
+ -- Most Language Servers support renaming across files, etc.
582
+ map (' grn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
583
+
584
+ -- Execute a code action, usually your cursor needs to be on top of an error
585
+ -- or a suggestion from your LSP for this to activate.
586
+ map (' gra' , vim .lsp .buf .code_action , ' [G]oto Code [A]ction' , { ' n' , ' x' })
588
587
589
588
-- Find references for the word under your cursor.
590
- map (' gr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
589
+ map (' grr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
591
590
592
591
-- Jump to the implementation of the word under your cursor.
593
592
-- Useful when your language has ways of declaring types without an actual implementation.
594
- map (' gI ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
593
+ map (' gri ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
595
594
596
- -- Jump to the type of the word under your cursor.
597
- -- Useful when you're not sure what type a variable is and you want to see
598
- -- the definition of its *type*, not where it was *defined*.
599
- map (' <leader>D' , require (' telescope.builtin' ).lsp_type_definitions , ' Type [D]efinition' )
595
+ -- Jump to the definition of the word under your cursor.
596
+ -- This is where a variable was first declared, or where a function is defined, etc.
597
+ -- To jump back, press <C-t>.
598
+ map (' grd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
599
+
600
+ -- WARN: This is not Goto Definition, this is Goto Declaration.
601
+ -- For example, in C this would take you to the header.
602
+ map (' grD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
600
603
601
604
-- Fuzzy find all the symbols in your current document.
602
605
-- Symbols are things like variables, functions, types, etc.
603
- map (' <leader>ds ' , require (' telescope.builtin' ).lsp_document_symbols , ' [D]ocument [S]ymbols ' )
606
+ map (' gO ' , require (' telescope.builtin' ).lsp_document_symbols , ' Open Document Symbols ' )
604
607
605
608
-- Fuzzy find all the symbols in your current workspace.
606
609
-- Similar to document symbols, except searches over your entire project.
607
- map (' <leader>ws' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' [W]orkspace [S]ymbols' )
608
-
609
- -- Rename the variable under your cursor.
610
- -- Most Language Servers support renaming across files, etc.
611
- map (' <leader>rn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
612
-
613
- -- Execute a code action, usually your cursor needs to be on top of an error
614
- -- or a suggestion from your LSP for this to activate.
615
- map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' , { ' n' , ' x' })
610
+ map (' gW' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' Open Workspace Symbols' )
616
611
617
- -- WARN: This is not Goto Definition, this is Goto Declaration.
618
- -- For example, in C this would take you to the header.
619
- map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
612
+ -- Jump to the type of the word under your cursor.
613
+ -- Useful when you're not sure what type a variable is and you want to see
614
+ -- the definition of its *type*, not where it was *defined*.
615
+ map (' grt' , require (' telescope.builtin' ).lsp_type_definitions , ' [G]oto [T]ype Definition' )
620
616
621
617
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
622
618
--- @param client vim.lsp.Client
0 commit comments