diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index cb555ed..1970fd6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -57,6 +57,9 @@ require("lazy").setup({ }, { -- Useful plugin to show you pending keybinds. "folke/which-key.nvim", + dependencies = { + "echasnovski/mini.icons", + }, event = "VimEnter", -- Sets the loading event to 'VimEnter' init = function() vim.o.timeout = true @@ -64,21 +67,15 @@ require("lazy").setup({ end, config = function() -- This is the function that runs, AFTER loading require("which-key").setup() - - -- Document existing key chains - require("which-key").register({ - ["c"] = { name = "[C]ode", _ = "which_key_ignore" }, - ["d"] = { name = "[D]ocument", _ = "which_key_ignore" }, - ["r"] = { name = "[R]ename", _ = "which_key_ignore" }, - ["s"] = { name = "[S]earch", _ = "which_key_ignore" }, - ["w"] = { name = "[W]orkspace", _ = "which_key_ignore" }, - ["t"] = { name = "[T]oggle", _ = "which_key_ignore" }, - ["h"] = { name = "Git [H]unk", _ = "which_key_ignore" }, + require("which-key").add({ + { "c", group = "[C]ode" }, + { "d", group = "[D]ocument" }, + { "r", group = "[R]ename" }, + { "s", group = "[S]earch" }, + { "w", group = "[W]orkspace" }, + { "t", group = "[T]oggle" }, + { "h", group = "Git [H]unk", mode = { "n", "v" } }, }) - -- visual mode - require("which-key").register({ - ["h"] = { "Git [H]unk" }, - }, { mode = "v" }) end, }, @@ -99,7 +96,7 @@ require("lazy").setup({ "liuchengxu/vista.vim", "mhinz/vim-startify", "https://git.mathux.org/mathieu/taglist.git", - "lfilho/cosco.vim", + "MattesGroeger/vim-bookmarks", { "dhananjaylatkar/cscope_maps.nvim", dependencies = { @@ -108,10 +105,10 @@ require("lazy").setup({ "ibhagwan/fzf-lua", -- optional [for picker="fzf-lua"] "nvim-tree/nvim-web-devicons", -- optional [for devicons in telescope or fzf] }, - branch = "feat/db_relpath", opts = { skip_input_prompt = true, - cscope ={ + prefix = ",", + cscope = { skip_picker_for_single_result = true, picker = "telescope", }, @@ -134,6 +131,7 @@ require("lazy").setup({ ensure_installed = { "c", "cpp", + "devicetree", "lua", "vim", "vimdoc", @@ -682,7 +680,6 @@ else vim.cmd("colorscheme kanagawa-wave") end -vim.opt.runtimepath:append("~/.vim/bundle/Vundle.vim/") -- See `:help telescope.builtin` local builtin = require("telescope.builtin") @@ -696,3 +693,10 @@ vim.keymap.set("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iag vim.keymap.set("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) vim.keymap.set("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) +-- Ctags are much better to find definition than cscope +vim.keymap.set( + "n", + "cg", + [[exe "tag" expand("")]], + { desc = "Find this global definition with tags" } +)