nvim: telescope mappings + config
This commit is contained in:
parent
1c57c77a3f
commit
d3c122a310
2 changed files with 10 additions and 6 deletions
|
@ -8,7 +8,7 @@ telescope.setup {
|
||||||
layout_strategy = "flex",
|
layout_strategy = "flex",
|
||||||
-- layout_defaults = {flip_columns = 160},
|
-- layout_defaults = {flip_columns = 160},
|
||||||
preview_cutoff = 10,
|
preview_cutoff = 10,
|
||||||
results_height = 1,
|
results_height = 10,
|
||||||
mappings = {
|
mappings = {
|
||||||
i = {
|
i = {
|
||||||
["<CR>"] = actions.select_default + actions.center,
|
["<CR>"] = actions.select_default + actions.center,
|
||||||
|
@ -25,7 +25,7 @@ telescope.setup {
|
||||||
|
|
||||||
-- TODO: Reduce preview ratio
|
-- TODO: Reduce preview ratio
|
||||||
-- Override flex layout
|
-- Override flex layout
|
||||||
--[[ local layout_strategies = require("telescope.pickers.layout_strategies")
|
local layout_strategies = require("telescope.pickers.layout_strategies")
|
||||||
local config = require("telescope.config")
|
local config = require("telescope.config")
|
||||||
|
|
||||||
layout_strategies.flex = function(self, max_columns, max_lines)
|
layout_strategies.flex = function(self, max_columns, max_lines)
|
||||||
|
@ -41,7 +41,7 @@ layout_strategies.flex = function(self, max_columns, max_lines)
|
||||||
self.layout_config = (config.values.layout_defaults or {})["horizontal"]
|
self.layout_config = (config.values.layout_defaults or {})["horizontal"]
|
||||||
return layout_strategies.horizontal(self, max_columns, max_lines)
|
return layout_strategies.horizontal(self, max_columns, max_lines)
|
||||||
end
|
end
|
||||||
end ]]
|
end
|
||||||
|
|
||||||
-- Extensions
|
-- Extensions
|
||||||
telescope.load_extension("fzy_native")
|
telescope.load_extension("fzy_native")
|
||||||
|
|
|
@ -75,10 +75,7 @@ return require('packer').startup(function()
|
||||||
local map = require('dln.utils').map
|
local map = require('dln.utils').map
|
||||||
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>')
|
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>')
|
||||||
map('i', '<C-k>', '<Cmd>lua vim.lsp.buf.signature_help()<CR>')
|
map('i', '<C-k>', '<Cmd>lua vim.lsp.buf.signature_help()<CR>')
|
||||||
map('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>')
|
|
||||||
map('n', '1gd', '<Cmd>lua vim.lsp.buf.type_definition()<CR>')
|
map('n', '1gd', '<Cmd>lua vim.lsp.buf.type_definition()<CR>')
|
||||||
map('n', 'gr', '<Cmd>lua vim.lsp.buf.references()<CR>')
|
|
||||||
map('n', 'g0', '<Cmd>lua vim.lsp.buf.document_symbol()<CR>')
|
|
||||||
map('n', 'gf', '<Cmd>lua vim.lsp.buf.formatting()<CR>')
|
map('n', 'gf', '<Cmd>lua vim.lsp.buf.formatting()<CR>')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -100,6 +97,13 @@ return require('packer').startup(function()
|
||||||
map('n', '<leader>e', '<cmd>lua require("telescope.builtin").git_files()<CR>')
|
map('n', '<leader>e', '<cmd>lua require("telescope.builtin").git_files()<CR>')
|
||||||
map('n', '<leader>s', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>')
|
map('n', '<leader>s', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>')
|
||||||
map('n', '<leader>t', '<cmd>lua require("telescope.builtin").treesitter()<CR>')
|
map('n', '<leader>t', '<cmd>lua require("telescope.builtin").treesitter()<CR>')
|
||||||
|
map('n', '<leader>/', '<cmd>lua require("telescope.builtin").live_grep()<CR>')
|
||||||
|
map('n', '<leader>.', '<cmd>lua require("telescope.builtin").file_browser()<CR>')
|
||||||
|
map('n', 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<CR>')
|
||||||
|
map('n', 'gd', '<cmd>lua require("telescope.builtin").lsp_definitions()<CR>')
|
||||||
|
map('n', 'g/', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<CR>')
|
||||||
|
map('n', 'g?', '<cmd>lua require("telescope.builtin").lsp_workspace_symbols()<CR>')
|
||||||
|
map('n', 'ge', '<cmd>lua require("telescope.builtin").lsp_document_diagnostics()<CR>')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue