nvim: telescope mappings + config

This commit is contained in:
Daniel Lundin 2021-04-19 19:18:59 +02:00
parent 1c57c77a3f
commit d3c122a310
2 changed files with 10 additions and 6 deletions

View file

@ -8,7 +8,7 @@ telescope.setup {
layout_strategy = "flex",
-- layout_defaults = {flip_columns = 160},
preview_cutoff = 10,
results_height = 1,
results_height = 10,
mappings = {
i = {
["<CR>"] = actions.select_default + actions.center,
@ -25,7 +25,7 @@ telescope.setup {
-- TODO: Reduce preview ratio
-- Override flex layout
--[[ local layout_strategies = require("telescope.pickers.layout_strategies")
local layout_strategies = require("telescope.pickers.layout_strategies")
local config = require("telescope.config")
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"]
return layout_strategies.horizontal(self, max_columns, max_lines)
end
end ]]
end
-- Extensions
telescope.load_extension("fzy_native")

View file

@ -75,10 +75,7 @@ return require('packer').startup(function()
local map = require('dln.utils').map
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<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', '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>')
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>s', '<cmd>lua require("telescope.builtin").lsp_document_symbols()<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
}