From f011aa49f11c8a11cd951077be50b9634e87bb6f Mon Sep 17 00:00:00 2001 From: Pablu23 Date: Tue, 21 May 2024 09:53:41 +0200 Subject: [PATCH] Added comment and toggle to neotree --- lazy-lock.json | 1 + lua/plugins/comment.lua | 7 ++++ lua/plugins/harpoon.lua | 72 ++++++++++++++++++++--------------------- lua/plugins/neotree.lua | 40 +++++++++++------------ 4 files changed, 64 insertions(+), 56 deletions(-) create mode 100644 lua/plugins/comment.lua diff --git a/lazy-lock.json b/lazy-lock.json index fddc9e7..cb2494f 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -1,4 +1,5 @@ { + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, "LuaSnip": { "branch": "master", "commit": "de1a287c9cb525ae52bc846e8f6207e5ef1da5ac" }, "catppuccin": { "branch": "main", "commit": "d97387aea8264f484bb5d5e74f2182a06c83e0d8" }, "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, diff --git a/lua/plugins/comment.lua b/lua/plugins/comment.lua new file mode 100644 index 0000000..e6b597d --- /dev/null +++ b/lua/plugins/comment.lua @@ -0,0 +1,7 @@ +return { + 'numToStr/Comment.nvim', + opts = { + -- add any options here + }, + lazy = false, +} diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua index 6f2000a..4db8a5b 100644 --- a/lua/plugins/harpoon.lua +++ b/lua/plugins/harpoon.lua @@ -1,44 +1,44 @@ return { - "ThePrimeagen/harpoon", - branch = "harpoon2", - dependencies = { "nvim-lua/plenary.nvim" }, - config = function() - local harpoon = require("harpoon") + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local harpoon = require("harpoon") -- Setup Harpoon with Telescope - local conf = require("telescope.config").values - local function toggle_telescope(harpoon_files) - local file_paths = {} - for _, item in ipairs(harpoon_files.items) do - table.insert(file_paths, item.value) - end + local conf = require("telescope.config").values + local function toggle_telescope(harpoon_files) + local file_paths = {} + for _, item in ipairs(harpoon_files.items) do + table.insert(file_paths, item.value) + end - require("telescope.pickers") - .new({}, { - prompt_title = "Harpoon", - finder = require("telescope.finders").new_table({ - results = file_paths, - }), - previewer = conf.file_previewer({}), - sorter = conf.generic_sorter({}), - }) - :find() - end + require("telescope.pickers") + .new({}, { + prompt_title = "Harpoon", + finder = require("telescope.finders").new_table({ + results = file_paths, + }), + previewer = conf.file_previewer({}), + sorter = conf.generic_sorter({}), + }) + :find() + end -- Setup Harpoon keybinds - harpoon:setup() - vim.keymap.set("n", "a", function() - harpoon:list():add() - end) - vim.keymap.set("n", "", function() - toggle_telescope(harpoon:list()) - end) + harpoon:setup() + vim.keymap.set("n", "a", function() + harpoon:list():add() + end) + vim.keymap.set("n", "", function() + toggle_telescope(harpoon:list()) + end) - vim.keymap.set("n", "", function() - harpoon:list():prev() - end) - vim.keymap.set("n", "", function() - harpoon:list():next() - end) - end, + -- vim.keymap.set("n", "", function() + -- harpoon:list():prev() + -- end) + -- vim.keymap.set("n", "", function() + -- harpoon:list():next() + -- end) + end, } diff --git a/lua/plugins/neotree.lua b/lua/plugins/neotree.lua index 7fdb8bf..24a1034 100644 --- a/lua/plugins/neotree.lua +++ b/lua/plugins/neotree.lua @@ -1,22 +1,22 @@ return { - "nvim-neo-tree/neo-tree.nvim", - branch = "v3.x", - dependencies = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", - "MunifTanjim/nui.nvim", - }, - config = function() - require("neo-tree").setup({ - event_handlers = { - { - event = "file_opened", - handler = function(file_path) - require("neo-tree.command").execute({ action = "close" }) - end, - }, - }, - }) - vim.keymap.set("n", "", ":Neotree filesystem reveal right", {}) -- toggle - end, + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + require("neo-tree").setup({ + event_handlers = { + { + event = "file_opened", + handler = function(file_path) + require("neo-tree.command").execute({ action = "close" }) + end, + }, + }, + }) + vim.keymap.set("n", "", ":Neotree filesystem reveal right toggle", {}) + end, }