[nvim] Add some Telescope commands
This commit is contained in:
parent
c5d8d03fd2
commit
09c2619797
1 changed files with 9 additions and 3 deletions
|
@ -20,11 +20,17 @@ require("core.options")
|
||||||
options = { noremap = true }
|
options = { noremap = true }
|
||||||
map('n', '<Leader>ff', ':Telescope find_files<Enter>', options)
|
map('n', '<Leader>ff', ':Telescope find_files<Enter>', options)
|
||||||
map('n', '<Leader>fg', ':Telescope git_files<Enter>', options)
|
map('n', '<Leader>fg', ':Telescope git_files<Enter>', options)
|
||||||
map('n', '<Leader>gc', ':Telescope git_commits<Enter>', options)
|
map('n', '<Leader>fc', ':Telescope git_commits<Enter>', options)
|
||||||
map('n', '<Leader>fl', ':Telescope live_grep<Enter>', options)
|
map('n', '<Leader>fl', ':Telescope live_grep<Enter>', options)
|
||||||
map('n', '<Leader><Space>', ':Telescope buffers<Enter>', options)
|
map('n', '<Leader><Space>', ':Telescope buffers<Enter>', options)
|
||||||
map('n', '<Leader>t', ':TagbarToggle<Enter>', options)
|
map('n', '<Leader>t', ':TagbarToggle<Enter>', options)
|
||||||
|
map('n', '<Leader>nv', ':Telescope find_files cwd=~/.config/nvim<Enter>', options)
|
||||||
|
map('n', '<Leader>nc', ':Telescope find_files cwd=~/.config<Enter>', options)
|
||||||
|
|
||||||
|
map('n', '<Leader>gd', ':Telescope lsp_definitions<Enter>', options)
|
||||||
|
map('n', '<Leader>gr', ':Telescope lsp_references<Enter>', options)
|
||||||
|
map('n', '<Leader>gs', ':Telescope lsp_workspace_symbols<Enter>', options)
|
||||||
|
map('n', '<Leader>gS', ':Telescope lsp_dynamic_workspace_symbols<Enter>', options)
|
||||||
|
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
-- Telescope
|
-- Telescope
|
||||||
|
@ -59,11 +65,11 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
local opts = {buffer = event.buf}
|
local opts = {buffer = event.buf}
|
||||||
|
|
||||||
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts)
|
||||||
vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
--vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts)
|
||||||
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
vim.keymap.set('n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<cr>', opts)
|
||||||
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
|
vim.keymap.set('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<cr>', opts)
|
||||||
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
|
vim.keymap.set('n', 'go', '<cmd>lua vim.lsp.buf.type_definition()<cr>', opts)
|
||||||
vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
|
--vim.keymap.set('n', 'gr', '<cmd>lua vim.lsp.buf.references()<cr>', opts)
|
||||||
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
vim.keymap.set('n', 'gs', '<cmd>lua vim.lsp.buf.signature_help()<cr>', opts)
|
||||||
vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
|
vim.keymap.set('n', '<F2>', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
|
||||||
vim.keymap.set({'n', 'x'}, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
|
vim.keymap.set({'n', 'x'}, '<F3>', '<cmd>lua vim.lsp.buf.format({async = true})<cr>', opts)
|
||||||
|
|
Loading…
Reference in a new issue