From 05907aa17dd4163d42a9abc64d0fa79aefc2f1bc Mon Sep 17 00:00:00 2001 From: omagdy7 Date: Fri, 9 Dec 2022 15:59:12 +0200 Subject: Added some new aliases and added some new keymaps to my nvim config --- nvim/.config/nvim/init.lua | 2 ++ nvim/.config/nvim/lua/user/keymaps.lua | 12 +++++++++++- nvim/.config/nvim/lua/user/lsp/handlers.lua | 2 +- nvim/.config/nvim/lua/user/plugins.lua | 26 ++++++++++++++++++++++++++ nvim/.config/nvim/lua/user/telescope.lua | 4 ++++ nvim/.config/nvim/plugin/packer_compiled.lua | 5 +++++ 6 files changed, 49 insertions(+), 2 deletions(-) (limited to 'nvim') diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index 3d15c1d..1e33b39 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -11,6 +11,8 @@ require('material').setup{ } } +require("telescope").load_extension('harpoon') + require('catppuccin').setup({ transparent_background = true, }) diff --git a/nvim/.config/nvim/lua/user/keymaps.lua b/nvim/.config/nvim/lua/user/keymaps.lua index 07e8a49..f74ac25 100644 --- a/nvim/.config/nvim/lua/user/keymaps.lua +++ b/nvim/.config/nvim/lua/user/keymaps.lua @@ -64,7 +64,7 @@ keymap("x", "", ":move '<-2gv-gv", opts) -- Jumping quickly between two files -keymap("n", "", ":bprevious", opts) +--[[ keymap("n", "", ":bprevious", opts) ]] -- Centering after page moves or searching for something keymap("n", "", "zz", opts) @@ -79,6 +79,16 @@ keymap("n", "", ":CompetiTestRun", opts) --sourcing luasnips keymap("n", "s", " source ~/.config/nvim/lua/user/luasnip.lua", opts) +--telescope harpoon +keymap("n", "H", ":Telescope harpoon marks", opts) + +--harpoon +keymap("n", "h", ":lua require('harpoon.ui').toggle_quick_menu()", opts) -- show harpoon menu +keymap("n", "a", ":lua require('harpoon.mark').add_file()", opts) -- adding a file +keymap("n", "n", ":lua require('harpoon.ui').nav_next()", opts) -- next file +keymap("n", "b", ":lua require('harpoon.ui').nav_prev()", opts) -- prev file + + -- luasnips vim.keymap.set({ "i", "s" }, "", function () diff --git a/nvim/.config/nvim/lua/user/lsp/handlers.lua b/nvim/.config/nvim/lua/user/lsp/handlers.lua index 2baf039..c45f2a9 100644 --- a/nvim/.config/nvim/lua/user/lsp/handlers.lua +++ b/nvim/.config/nvim/lua/user/lsp/handlers.lua @@ -76,7 +76,7 @@ local function lsp_keymaps(bufnr) bufnr, "n", "gl", - 'lua vim.diagnostic.open_float({ border = "rounded" })', + 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts ) vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) diff --git a/nvim/.config/nvim/lua/user/plugins.lua b/nvim/.config/nvim/lua/user/plugins.lua index 2924fe6..2aba7e9 100644 --- a/nvim/.config/nvim/lua/user/plugins.lua +++ b/nvim/.config/nvim/lua/user/plugins.lua @@ -88,6 +88,9 @@ return packer.startup(function(use) use 'ellisonleao/gruvbox.nvim' use { "catppuccin/nvim", as = "catppuccin" } + -- harpoon + use "ThePrimeagen/harpoon" + -- cmp plugins use "hrsh7th/nvim-cmp" -- The completion plugin use "hrsh7th/cmp-buffer" -- buffer completions @@ -108,6 +111,29 @@ return packer.startup(function(use) use "jose-elias-alvarez/null-ls.nvim" -- for formatters and linters + --harpoon setup + require("harpoon").setup({ + global_settings = { + -- sets the marks upon calling `toggle` on the ui, instead of require `:w`. + save_on_toggle = false, + + -- saves the harpoon file upon every change. disabling is unrecommended. + save_on_change = true, + + -- sets harpoon to run the command immediately as it's passed to the terminal when calling `sendCommand`. + enter_on_sendcmd = false, + + -- closes any tmux windows harpoon that harpoon creates when you close Neovim. + tmux_autoclose_windows = false, + + -- filetypes that you want to prevent from adding to the harpoon list menu. + excluded_filetypes = { "harpoon" }, + + -- set marks specific to each git branch inside git repository + mark_branch = false, + }}) + + --compitest require('competitest').setup { local_config_file_name = ".competitest.lua", diff --git a/nvim/.config/nvim/lua/user/telescope.lua b/nvim/.config/nvim/lua/user/telescope.lua index 0706b51..9e6b240 100644 --- a/nvim/.config/nvim/lua/user/telescope.lua +++ b/nvim/.config/nvim/lua/user/telescope.lua @@ -87,6 +87,10 @@ telescope.setup { -- builtin picker }, extensions = { + harpoon = { + + + } -- Your extension configuration goes here: -- extension_name = { -- extension_config_key = value, diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua index 5efe217..03eea64 100644 --- a/nvim/.config/nvim/plugin/packer_compiled.lua +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -160,6 +160,11 @@ _G.packer_plugins = { path = "/home/pengu/.local/share/nvim/site/pack/packer/start/gruvbox.nvim", url = "https://github.com/ellisonleao/gruvbox.nvim" }, + harpoon = { + loaded = true, + path = "/home/pengu/.local/share/nvim/site/pack/packer/start/harpoon", + url = "https://github.com/ThePrimeagen/harpoon" + }, ["impatient.nvim"] = { loaded = true, path = "/home/pengu/.local/share/nvim/site/pack/packer/start/impatient.nvim", -- cgit v1.2.3