From b0e03a69edb99fb0248c9107c20fba60a01fda93 Mon Sep 17 00:00:00 2001 From: lew Date: Mon, 3 Nov 2025 14:19:42 +0000 Subject: [PATCH] Update .config/nvim/init.lua Update .config/nvim/lazy-lock.json Update .config/nvim/lua/plugin/10_hop.lua Add .config/nvim/lua/plugin/11_eyeliner.lua --- private_dot_config/nvim/init.lua | 2 + private_dot_config/nvim/lazy-lock.json | 3 +- private_dot_config/nvim/lua/plugin/10_hop.lua | 50 +++++++++++++++---- .../nvim/lua/plugin/11_eyeliner.lua | 11 ++++ 4 files changed, 54 insertions(+), 12 deletions(-) create mode 100644 private_dot_config/nvim/lua/plugin/11_eyeliner.lua diff --git a/private_dot_config/nvim/init.lua b/private_dot_config/nvim/init.lua index 3c8b303..f3165a1 100644 --- a/private_dot_config/nvim/init.lua +++ b/private_dot_config/nvim/init.lua @@ -14,10 +14,12 @@ -- ├──── 03_treesitter.lua Does anybody know what this does? -- ├──── 05_fzf.lua Pickers with fzf-lua -- ├──── 10_hop.lua Enables hopping to words in the current buffer +-- ├──── 11_eyeliner.lua Highligts unique chars in words on f/F -- ├──── 15_lsp.lua Mason, LSP configurations -- ├──── 20_completion.lua Autocompletion with blink.cmp, and mini.snippets -- ├──── 25_git.lua Gitsigns -- ├──── 30_formatting.lua vim-sleuth and conform formatting configs +-- ├──── 35_yanky.lua Yank and Put improvements -- ├ snippets/ Snippets definitions are in here -- ├── package.json Snippet repository metadata -- ├── global.json Global text snippets diff --git a/private_dot_config/nvim/lazy-lock.json b/private_dot_config/nvim/lazy-lock.json index 26474fe..30d5dea 100644 --- a/private_dot_config/nvim/lazy-lock.json +++ b/private_dot_config/nvim/lazy-lock.json @@ -1,7 +1,7 @@ { "blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" }, "conform.nvim": { "branch": "master", "commit": "02736cf359a3235c6d7d601a2f6bdc909e557513" }, - "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, + "eyeliner.nvim": { "branch": "main", "commit": "8f197eb30cecdf4c2cc9988a5eecc6bc34c0c7d6" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, "fzf-lua": { "branch": "main", "commit": "a8458b79a957a6e3e217d84106a0fd4b9470ff4c" }, "gitsigns.nvim": { "branch": "main", "commit": "20ad4419564d6e22b189f6738116b38871082332" }, @@ -11,6 +11,7 @@ "lazydev.nvim": { "branch": "main", "commit": "371cd7434cbf95606f1969c2c744da31b77fcfa6" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" }, "mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" }, + "mini.ai": { "branch": "main", "commit": "11c57180bc9084089206e211ac7aa598bedc9673" }, "mini.icons": { "branch": "main", "commit": "284798619aed9f4c1ac1b9417b9a5e3b4b85ef3a" }, "mini.pairs": { "branch": "main", "commit": "b9aada8c0e59f2b938e98fbf4eae0799eba96ad9" }, "mini.snippets": { "branch": "main", "commit": "7610dc3aaf7fb09b9cc428273a8ba15ef8aef495" }, diff --git a/private_dot_config/nvim/lua/plugin/10_hop.lua b/private_dot_config/nvim/lua/plugin/10_hop.lua index 6a94c80..43abece 100644 --- a/private_dot_config/nvim/lua/plugin/10_hop.lua +++ b/private_dot_config/nvim/lua/plugin/10_hop.lua @@ -2,16 +2,44 @@ return { { "smoka7/hop.nvim", version = "*", - opts = { - keys = "etovxqpdygfblzhckisuran", - }, - -- stylua: ignore - keys = { - { "gw", "HopWordMW", mode = { "n", "x", "o" }, desc = "hop to word" }, - { "gc", "HopChar1MW", mode = { "n", "x", "o" }, desc = "hop to char" }, - { "gl", "HopLineStartMW", mode = { "n", "x", "o" }, desc = "hop to word" }, - { "gn", "HopNodes", mode = { "n", "x", "o" }, desc = "hop nodes" }, - { "gp", "HopPatternMW", mode = { "n", "x", "o" }, desc = "hop to pattern" }, - }, + config = function() + local hop = require("hop") + + hop.setup({ + keys = "etovxqpdygfblzhckisuran", + }) + + -- Runs vim cmds ... if in visual mode + local function run_if_visual(...) + local mode = vim.fn.mode() + if mode == "v" then + for _, cmd in ipairs({ ... }) do + vim.cmd(cmd) + end + end + end + + -- HopWordMW, and include whole word if in visual mode. + local function hop_word_smart() + ---@diagnostic disable-next-line: missing-fields + hop.hint_words({ multi_windows = true }) + run_if_visual("normal! iw") + end + + -- HopPatternMW, and include whole word if in visual mode. + local function hop_pattern_smart() + ---@diagnostic disable-next-line: missing-fields + hop.hint_patterns({ multi_windows = true }) + run_if_visual("normal! iw") + end + + -- stylua: ignore start + vim.keymap.set({ "n", "x", "o" }, "gw", hop_word_smart, { desc = "hop to word" }) + vim.keymap.set({ "n", "x", "o" }, "gl", "HopChar1MW", { desc = "hop to char" }) + vim.keymap.set({ "n", "x", "o" }, "g:", "HopLineStartMW", { desc = "hop to line" }) + vim.keymap.set({ "n", "x", "o" }, "gn", "HopNodes", { desc = "hop nodes" }) + vim.keymap.set({ "n", "x", "o" }, "gp", hop_pattern_smart, { desc = "hop to pattern" }) + -- stylua: ignore end + end, }, } diff --git a/private_dot_config/nvim/lua/plugin/11_eyeliner.lua b/private_dot_config/nvim/lua/plugin/11_eyeliner.lua new file mode 100644 index 0000000..c8f7c53 --- /dev/null +++ b/private_dot_config/nvim/lua/plugin/11_eyeliner.lua @@ -0,0 +1,11 @@ +return { + { + "jinh0/eyeliner.nvim", + opts = { + highlight_on_key = true, + dim = true, + max_length = 9000, + default_keymaps = true, + }, + }, +}