From d3c122a310ee0c3aebb7a40f94f22860a92c4b63 Mon Sep 17 00:00:00 2001 From: Daniel Lundin Date: Mon, 19 Apr 2021 19:18:59 +0200 Subject: [PATCH] nvim: telescope mappings + config --- .config/nvim/lua/dln/telescope.lua | 6 +++--- .config/nvim/lua/plugins.lua | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.config/nvim/lua/dln/telescope.lua b/.config/nvim/lua/dln/telescope.lua index 0352ba4..68d9209 100644 --- a/.config/nvim/lua/dln/telescope.lua +++ b/.config/nvim/lua/dln/telescope.lua @@ -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 = { [""] = 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") diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua index af1c914..a334b5e 100644 --- a/.config/nvim/lua/plugins.lua +++ b/.config/nvim/lua/plugins.lua @@ -75,10 +75,7 @@ return require('packer').startup(function() local map = require('dln.utils').map map('n', 'K', 'lua vim.lsp.buf.hover()') map('i', '', 'lua vim.lsp.buf.signature_help()') - map('n', 'gd', 'lua vim.lsp.buf.definition()') map('n', '1gd', 'lua vim.lsp.buf.type_definition()') - map('n', 'gr', 'lua vim.lsp.buf.references()') - map('n', 'g0', 'lua vim.lsp.buf.document_symbol()') map('n', 'gf', 'lua vim.lsp.buf.formatting()') end } @@ -100,6 +97,13 @@ return require('packer').startup(function() map('n', 'e', 'lua require("telescope.builtin").git_files()') map('n', 's', 'lua require("telescope.builtin").lsp_document_symbols()') map('n', 't', 'lua require("telescope.builtin").treesitter()') + map('n', '/', 'lua require("telescope.builtin").live_grep()') + map('n', '.', 'lua require("telescope.builtin").file_browser()') + map('n', 'gr', 'lua require("telescope.builtin").lsp_references()') + map('n', 'gd', 'lua require("telescope.builtin").lsp_definitions()') + map('n', 'g/', 'lua require("telescope.builtin").lsp_document_symbols()') + map('n', 'g?', 'lua require("telescope.builtin").lsp_workspace_symbols()') + map('n', 'ge', 'lua require("telescope.builtin").lsp_document_diagnostics()') end }