From b3b800c6af593b27ddae059e6aeb888199cf4906 Mon Sep 17 00:00:00 2001 From: Jules Sang Date: Wed, 29 Mar 2023 19:38:00 +0200 Subject: [PATCH] Keymaps --- lua/plugins/harpoon.lua | 19 +++++++++++ lua/plugins/legendary.lua | 10 ++++++ lua/plugins/neotree.lua | 13 +++++++ lua/plugins/notify.lua | 6 ++++ lua/plugins/telescope.lua | 6 ++++ lua/plugins/which-key.lua | 72 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/legendary.lua create mode 100644 lua/plugins/neotree.lua create mode 100644 lua/plugins/notify.lua create mode 100644 lua/plugins/telescope.lua diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..68ed225 --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,19 @@ +return { + "ThePrimeagen/harpoon", + config = function() + local ui = require("harpoon.ui") + + require("harpoon").setup({ + menu = { + width = vim.api.nvim_win_get_width(0) - 24, + }, + global_settings = { + mark_branch = true, + }, + }) + + vim.keymap.set("n", "", function() + ui.nav_next() + end, { desc = "Navigate next" }) + end, +} diff --git a/lua/plugins/legendary.lua b/lua/plugins/legendary.lua new file mode 100644 index 0000000..e71c73b --- /dev/null +++ b/lua/plugins/legendary.lua @@ -0,0 +1,10 @@ +return { + "mrjones2014/legendary.nvim", + dependencies = "stevearc/dressing.nvim", + keys = { + { ",", vim.cmd.Legendary, desc = "Legendary" }, + }, + config = { + which_key = { auto_register = true }, + }, +} diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua new file mode 100644 index 0000000..6d57cf8 --- /dev/null +++ b/lua/plugins/neotree.lua @@ -0,0 +1,13 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + config = { + window = { + position = "right", + mappings = { + l = "toggle_node", + L = "close_all_nodes", + [""] = false, + }, + }, + }, +} diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua new file mode 100644 index 0000000..264fcd2 --- /dev/null +++ b/lua/plugins/notify.lua @@ -0,0 +1,6 @@ +return { + "rcarriga/nvim-notify", + keys = { + { "", require("notify").dismiss }, + }, +} diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..98da00a --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,6 @@ +return { + "nvim-telescope/telescope.nvim", + keys = { + { ",", false }, + }, +} diff --git a/lua/plugins/which-key.lua b/lua/plugins/which-key.lua index 0dc8252..c319596 100644 --- a/lua/plugins/which-key.lua +++ b/lua/plugins/which-key.lua @@ -2,6 +2,9 @@ return { "folke/which-key.nvim", config = function() local wk = require("which-key") + local mark = require("harpoon.mark") + local ui = require("harpoon.ui") + local term = require("harpoon.term") local mappings = { w = { @@ -29,6 +32,75 @@ return { }, d = { "", "which_key_ignore" }, }, + h = { + name = "Harpoon", + a = { mark.add_file, "Add file" }, + h = { ui.toggle_quick_menu, "Toggle quick menu" }, + n = { + function() + ui.nav_next() + end, + "Navigate next", + }, + p = { + function() + ui.nav_prev() + end, + "Navigate previous", + }, + ["1"] = { + function() + ui.nav_file(1) + end, + "Navigate 1", + }, + ["2"] = { + function() + ui.nav_file(2) + end, + "Navigate 2", + }, + ["3"] = { + function() + ui.nav_file(3) + end, + "Navigate 3", + }, + ["4"] = { + function() + ui.nav_file(4) + end, + "Navigate 4", + }, + ["&"] = { + function() + ui.nav_file(1) + end, + "Navigate 1", + }, + ["é"] = { + function() + ui.nav_file(2) + end, + "Navigate 2", + }, + ['"'] = { + function() + ui.nav_file(3) + end, + "Navigate 3", + }, + ["'"] = { + function() + ui.nav_file(4) + end, + "Navigate 4", + }, + }, + -- ["?"] = { + -- vim.cmd.Legendary, + -- "Legendary", + -- }, } wk.register(mappings, { mode = "n", prefix = "" })