From: Samir Benmendil Date: Sun, 17 Dec 2023 17:09:51 +0000 (+0000) Subject: nvim: define all(?) telescope keymaps ourselves X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/7ac6b742a02798ae694b9985081b1ee0172eaee5?ds=sidebyside nvim: define all(?) telescope keymaps ourselves It's otherwise quite hard to figure out what is used. --- diff --git a/nvim/lua/plugins/editor.lua b/nvim/lua/plugins/editor.lua index cea1326..5a9eca2 100644 --- a/nvim/lua/plugins/editor.lua +++ b/nvim/lua/plugins/editor.lua @@ -1,14 +1,85 @@ +local Util = require("lazyvim.util") + ---@type LazyPluginSpec return { { "nvim-telescope/telescope.nvim", keys = { + { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + -- from lazyvim + { ",", "Telescope buffers show_all_buffers=true", desc = "Switch Buffer" }, + { "/", Util.telescope("live_grep"), desc = "Grep (root dir)" }, + { ":", "Telescope command_history", desc = "Command History" }, + { "", Util.telescope("files"), desc = "Find Files (root dir)" }, { "", false }, + -- find + { "fb", "Telescope buffers", desc = "Buffers" }, + -- { "ff", Util.telescope("files"), desc = "Find Files (root dir)" }, + { "ff", false }, -- fswitch + { "fF", Util.telescope("files", { cwd = false }), desc = "Find Files (cwd)" }, + { "fr", "Telescope oldfiles", desc = "Recent" }, + { "fR", Util.telescope("oldfiles", { cwd = vim.loop.cwd() }), desc = "Recent (cwd)" }, + -- git + -- { "gc", "Telescope git_commits", desc = "commits" }, { "gc", false }, + -- { "gs", "Telescope git_status", desc = "status" }, { "gs", false }, - { "ff", false }, -- fswitch - -- use for snippets below - { "ss", false }, + -- search + { "sa", "Telescope autocommands", desc = "Auto Commands" }, + { "sb", "Telescope current_buffer_fuzzy_find", desc = "Buffer" }, + { "sc", "Telescope command_history", desc = "Command History" }, + { "sC", "Telescope commands", desc = "Commands" }, + { "sd", "Telescope diagnostics bufnr=0", desc = "Document diagnostics" }, + { "sD", "Telescope diagnostics", desc = "Workspace diagnostics" }, + { "sg", Util.telescope("live_grep"), desc = "Grep (root dir)" }, + { "sG", Util.telescope("live_grep", { cwd = false }), desc = "Grep (cwd)" }, + { "sh", "Telescope help_tags", desc = "Help Pages" }, + { "sH", "Telescope highlights", desc = "Search Highlight Groups" }, + { "sk", "Telescope keymaps", desc = "Key Maps" }, + { "sM", "Telescope man_pages", desc = "Man Pages" }, + { "sm", "Telescope marks", desc = "Jump to Mark" }, + { "so", "Telescope vim_options", desc = "Options" }, + { "sR", "Telescope resume", desc = "Resume" }, + { "sw", Util.telescope("grep_string"), desc = "Word (root dir)" }, + { "sW", Util.telescope("grep_string", { cwd = false }), desc = "Word (cwd)" }, + { "uC", Util.telescope("colorscheme", { enable_preview = true }), desc = "Colorscheme with preview" }, + -- { + -- "ss", + -- Util.telescope("lsp_document_symbols", { + -- symbols = { + -- "Class", + -- "Function", + -- "Method", + -- "Constructor", + -- "Interface", + -- "Module", + -- "Struct", + -- "Trait", + -- "Field", + -- "Property", + -- }, + -- }), + -- desc = "Goto Symbol", + -- }, + { "ss", false }, -- use for snippets below + { + "sS", + Util.telescope("lsp_dynamic_workspace_symbols", { + symbols = { + "Class", + "Function", + "Method", + "Constructor", + "Interface", + "Module", + "Struct", + "Trait", + "Field", + "Property", + }, + }), + desc = "Goto Symbol (Workspace)", + }, }, }, {