diff --git a/src/home/shell/neovim/config/init.lua b/src/home/shell/neovim/config/init.lua index db19913..7f6b305 100644 --- a/src/home/shell/neovim/config/init.lua +++ b/src/home/shell/neovim/config/init.lua @@ -1,68 +1,38 @@ --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) vim.g.mapleader = " " vim.g.maplocalleader = " " - --- Set to true if you have a Nerd Font installed and selected in the terminal vim.g.have_nerd_font = true - --- [[ Setting options ]] --- See `:help vim.opt` --- NOTE: You can change these options as you wish! --- For more options, you can see `:help option-list` - --- Make line numbers default vim.opt.number = true -- vim.opt.relativenumber = true - --- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = "a" - --- Don't show the mode, since it's already in the status line vim.opt.showmode = false - -- Sync clipboard between OS and Neovim. vim.schedule(function() vim.opt.clipboard = "unnamedplus" end) - -- Enable break indent vim.opt.breakindent = true - -- Save undo history vim.opt.undofile = true - -- Case-insensitive searching UNLESS \C or one or more capital letters in the search term vim.opt.ignorecase = true vim.opt.smartcase = true - -- Keep signcolumn on by default vim.opt.signcolumn = "yes" - -- Decrease update time vim.opt.updatetime = 250 - -- Decrease mapped sequence wait time -- Displays which-key popup sooner vim.opt.timeoutlen = 300 - -- Configure how new splits should be opened vim.opt.splitright = true vim.opt.splitbelow = true - -- Sets how neovim will display certain whitespace characters in the editor. --- See `:help 'list'` --- and `:help 'listchars'` vim.opt.list = true vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } - -- Preview substitutions live, as you type! vim.opt.inccommand = "split" - -- Show which line your cursor is on vim.opt.cursorline = true - -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 @@ -84,12 +54,6 @@ vim.keymap.set("n", "q", vim.diagnostic.setloclist, { desc = "Open diagn -- or just use to exit terminal mode vim.keymap.set("t", "", "", { desc = "Exit terminal mode" }) --- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') - -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows -- @@ -188,7 +152,8 @@ require("lazy").setup({ { "s", group = "[S]earch" }, { "w", group = "[W]orkspace|[W]indow" }, { "t", group = "[T]oggle" }, - { "h", group = "Git [H]unk", mode = { "n", "v" } }, + -- { "h", group = "Git [H]unk", mode = { "n", "v" } }, + { "h", group = "[H]arpoon" }, }, }, }, @@ -883,6 +848,101 @@ require("lazy").setup({ hl(0, "MultiCursorDisabledSign", { link = "SignColumn" }) end, }, + + { + "ThePrimeagen/harpoon", + branch = "harpoon2", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = {}, + config = function(_, opts) + local harpoon = require("harpoon") + harpoon:setup(opts) + end, + keys = { + { + "ha", + function() + local harpoon = require("harpoon") + harpoon:list():add() + end, + desc = "[H]arpoon [A]dd", + }, + { + "he", + function() + local harpoon = require("harpoon") + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = "[H]arpoon [E]dit", + }, + { + "hl", + function() + local harpoon = require("harpoon") + 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 + toggle_telescope(harpoon:list()) + end, + desc = "[H]arpoon [L]list", + }, + { + "h1", + function() + local harpoon = require("harpoon") + harpoon:list():select(1) + end, + desc = "[H]arpoon [1]st entry", + }, + { + "h2", + function() + local harpoon = require("harpoon") + harpoon:list():select(2) + end, + desc = "[H]arpoon [2]nd entry", + }, + { + "h3", + function() + local harpoon = require("harpoon") + harpoon:list():select(3) + end, + desc = "[H]arpoon [3]rd entry", + }, + { + "h4", + function() + local harpoon = require("harpoon") + harpoon:list():select(4) + end, + desc = "[H]arpoon [4]th entry", + }, + { + "h5", + function() + local harpoon = require("harpoon") + harpoon:list():select(5) + end, + desc = "[H]arpoon [5]th entry", + }, + }, + }, }, { ui = { -- If you are using a Nerd Font: set icons to an empty table which will use the @@ -916,12 +976,12 @@ vim.keymap.set("n", "x", "!chmod +x %", { desc = "Chmod File E[ vim.keymap.set("n", "lz", "Lazy", { desc = "[L]azy", silent = true }) vim.keymap.set("n", "lp", "Lazy profile", { desc = "[L]azy [P]rofile", silent = true }) -vim.keymap.set("n", "l", "tablast", { desc = "Last Tab" }) -vim.keymap.set("n", "f", "tabfirst", { desc = "First Tab" }) vim.keymap.set("n", "n", "tabnew", { desc = "New Tab" }) -vim.keymap.set("n", "]", "tabnext", { desc = "Next Tab" }) -vim.keymap.set("n", "d", "tabclose", { desc = "Close Tab" }) -vim.keymap.set("n", "[", "tabprevious", { desc = "Previous Tab" }) +vim.keymap.set("n", "j", "tabfirst", { desc = "First Tab" }) +vim.keymap.set("n", "k", "tablast", { desc = "Last Tab" }) +vim.keymap.set("n", "l", "tabnext", { desc = "Next Tab" }) +vim.keymap.set("n", "h", "tabprevious", { desc = "Previous Tab" }) +vim.keymap.set("n", "q", "tabclose", { desc = "[Q]uit Tab" }) vim.keymap.set("n", "mx", "!chmod +x %", { desc = "Chmod File E[x]ecutable", silent = true }) diff --git a/src/home/shell/neovim/config/lazy-lock.json b/src/home/shell/neovim/config/lazy-lock.json index 4c05656..39fe159 100644 --- a/src/home/shell/neovim/config/lazy-lock.json +++ b/src/home/shell/neovim/config/lazy-lock.json @@ -7,7 +7,8 @@ "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, "friendly-snippets": { "branch": "main", "commit": "de8fce94985873666bd9712ea3e49ee17aadb1ed" }, "gitsigns.nvim": { "branch": "main", "commit": "ac5aba6dce8c06ea22bea2c9016f51a2dbf90dc7" }, - "gruvbox.nvim": { "branch": "main", "commit": "49d9c0b150ba70efcd831ec7b3cb8ee740067045" }, + "gruber-darker.nvim": { "branch": "main", "commit": "a2dda61d9c1225e16951a51d6b89795b0ac35cd6" }, + "harpoon": { "branch": "harpoon2", "commit": "a84ab829eaf3678b586609888ef52f7779102263" }, "lazy.nvim": { "branch": "main", "commit": "7967abe55752aa90532e6bb4bd4663fe27a264cb" }, "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" }, "luvit-meta": { "branch": "main", "commit": "ce76f6f6cdc9201523a5875a4471dcfe0186eb60" },