@@ -73,42 +73,42 @@ return {
73
73
vim .keymap .set (mode , keys , func , { buffer = event .buf , desc = ' LSP: ' .. desc })
74
74
end
75
75
76
- -- Jump to the definition of the word under your cursor.
77
- -- This is where a variable was first declared, or where a function is defined, etc.
78
- -- To jump back, press <C-t>.
79
- map (' gd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
76
+ -- Rename the variable under your cursor.
77
+ -- Most Language Servers support renaming across files, etc.
78
+ map (' grn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
79
+
80
+ -- Execute a code action, usually your cursor needs to be on top of an error
81
+ -- or a suggestion from your LSP for this to activate.
82
+ map (' gra' , vim .lsp .buf .code_action , ' [G]oto Code [A]ction' , { ' n' , ' x' })
80
83
81
84
-- Find references for the word under your cursor.
82
- map (' gr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
85
+ map (' grr ' , require (' telescope.builtin' ).lsp_references , ' [G]oto [R]eferences' )
83
86
84
87
-- Jump to the implementation of the word under your cursor.
85
88
-- Useful when your language has ways of declaring types without an actual implementation.
86
- map (' gI ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
89
+ map (' gri ' , require (' telescope.builtin' ).lsp_implementations , ' [G]oto [I]mplementation' )
87
90
88
- -- Jump to the type of the word under your cursor.
89
- -- Useful when you're not sure what type a variable is and you want to see
90
- -- the definition of its *type*, not where it was *defined*.
91
- map (' <leader>D' , require (' telescope.builtin' ).lsp_type_definitions , ' Type [D]efinition' )
91
+ -- Jump to the definition of the word under your cursor.
92
+ -- This is where a variable was first declared, or where a function is defined, etc.
93
+ -- To jump back, press <C-t>.
94
+ map (' grd' , require (' telescope.builtin' ).lsp_definitions , ' [G]oto [D]efinition' )
95
+
96
+ -- WARN: This is not Goto Definition, this is Goto Declaration.
97
+ -- For example, in C this would take you to the header.
98
+ map (' grD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
92
99
93
100
-- Fuzzy find all the symbols in your current document.
94
101
-- Symbols are things like variables, functions, types, etc.
95
- map (' <leader>cs ' , require (' telescope.builtin' ).lsp_document_symbols , ' Document Symbols' )
102
+ map (' gO ' , require (' telescope.builtin' ).lsp_document_symbols , ' Open Document Symbols' )
96
103
97
104
-- Fuzzy find all the symbols in your current workspace.
98
105
-- Similar to document symbols, except searches over your entire project.
99
- map (' <leader>cS' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' Workspace Symbols' )
100
-
101
- -- Rename the variable under your cursor.
102
- -- Most Language Servers support renaming across files, etc.
103
- map (' <leader>rn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
104
-
105
- -- Execute a code action, usually your cursor needs to be on top of an error
106
- -- or a suggestion from your LSP for this to activate.
107
- map (' <leader>ca' , vim .lsp .buf .code_action , ' Code Action' , { ' n' , ' x' })
106
+ map (' gW' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' Open Workspace Symbols' )
108
107
109
- -- WARN: This is not Goto Definition, this is Goto Declaration.
110
- -- For example, in C this would take you to the header.
111
- map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
108
+ -- Jump to the type of the word under your cursor.
109
+ -- Useful when you're not sure what type a variable is and you want to see
110
+ -- the definition of its *type*, not where it was *defined*.
111
+ map (' grt' , require (' telescope.builtin' ).lsp_type_definitions , ' [G]oto [T]ype Definition' )
112
112
113
113
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
114
114
--- @param client vim.lsp.Client
0 commit comments