From 26c0af40404e60d738d8a6dbf20a6f88bcfefe77 Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 4 Dec 2024 01:38:25 +0100 Subject: [PATCH] chore: cleanup telescope keybinds --- lua/keybinds.lua | 41 +++++++++++++---------------------------- 1 file changed, 13 insertions(+), 28 deletions(-) diff --git a/lua/keybinds.lua b/lua/keybinds.lua index 1649d0a..96c5ef7 100644 --- a/lua/keybinds.lua +++ b/lua/keybinds.lua @@ -116,43 +116,28 @@ end function KEYBINDS:set_telescope_keys(opts) local telescope = require('telescope.builtin') local theme = require('telescope.themes') - -- File navigation - vim.keymap.set('n', 'p', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) - vim.keymap.set('n', 'p', telescope.find_files, opts) - vim.keymap.set('n', '', telescope.find_files, opts) -- fallback for windows - vim.keymap.set('n', '', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) - vim.keymap.set('n', '', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) -- fallback for windows - vim.keymap.set('n', '', wrap(telescope.lsp_references, theme.get_cursor()), opts) - vim.keymap.set('n', '', wrap(telescope.jumplist, theme.get_dropdown()), opts) - vim.keymap.set('n', '', telescope.git_bcommits, opts) - vim.keymap.set('n', '', telescope.git_bcommits, opts) -- fallback for windows - vim.keymap.set('n', '', wrap(telescope.registers, theme.get_dropdown()), opts) -- fallback for windows - -- Marks and buffers with telescope - vim.keymap.set('n', '', telescope.buffers, opts) - vim.keymap.set('n', '', wrap(telescope.marks, theme.get_dropdown()), opts) - vim.keymap.set('n', '', wrap(telescope.marks, theme.get_dropdown()), opts) -- fallback for windows - vim.keymap.set('n', '', wrap(telescope.current_buffer_fuzzy_find, {layout_strategy = 'vertical'}), opts) - vim.keymap.set('n', '', wrap(telescope.current_buffer_fuzzy_find, {layout_strategy = 'vertical'}), opts) -- fallback for windows - -- Symbols with telescope - vim.keymap.set('n', '', telescope.lsp_document_symbols, opts) - vim.keymap.set('n', '/', telescope.lsp_document_symbols, opts) - vim.keymap.set('n', 's', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts) - vim.keymap.set('n', '', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts) - vim.keymap.set('n', '', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts) - -- Resule last - vim.keymap.set('n', '', telescope.resume, opts) - vim.keymap.set('n', '', telescope.resume, opts) - -- Error list with telescope - vim.keymap.set('n', '', wrap(telescope.diagnostics, theme.get_ivy({bufnr=0})), opts) + + vim.keymap.set('n', 'p', telescope.find_files, opts) + vim.keymap.set('n', '', wrap(telescope.lsp_dynamic_workspace_symbols, {layout_strategy = 'vertical'}), opts) + vim.keymap.set('n', '/', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) + vim.keymap.set('n', ']', wrap(telescope.lsp_references, theme.get_dropdown()), opts) + vim.keymap.set('n', 'r', wrap(telescope.lsp_references, theme.get_dropdown()), opts) -- overrule lsp bind + vim.keymap.set('n', ';', telescope.git_bcommits, opts) + if not vim.g.disable_legacy_keybinds then -- File navigation + vim.keymap.set('n', '|', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) vim.keymap.set('n', '', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) vim.keymap.set('n', '', wrap(telescope.oldfiles, {layout_strategy = 'vertical' }), opts) -- fallback for windows... even is used + vim.keymap.set('n', '', telescope.find_files, opts) vim.keymap.set('n', '', telescope.find_files, opts) -- fallback for windows + vim.keymap.set('n', '', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) vim.keymap.set('n', '', wrap(telescope.live_grep, {layout_strategy = 'vertical'}), opts) -- fallback for windows + vim.keymap.set('n', '', wrap(telescope.lsp_references, theme.get_cursor()), opts) + vim.keymap.set('n', '', wrap(telescope.jumplist, theme.get_dropdown()), opts) vim.keymap.set('n', '', telescope.git_bcommits, opts) vim.keymap.set('n', '', telescope.git_bcommits, opts) -- fallback for windows