From a552a1e8a7910f876c03a264912922bcc1ef588a Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 26 Feb 2026 01:45:57 +0200 Subject: [PATCH] config --- .config/nvim/init.lua | 10 +- .config/nvim/lazy-lock.json | 35 - .config/nvim/lua/autocmd.lua | 21 +- .config/nvim/lua/config/lazy.lua | 23 - .config/nvim/lua/keymaps.lua | 8 +- .config/nvim/lua/options.lua | 4 +- .config/nvim/lua/plugins/aerial.lua | 100 +-- .config/nvim/lua/plugins/autopairs.lua | 12 +- .config/nvim/lua/plugins/blink.lua | 131 ++- .config/nvim/lua/plugins/conform.lua | 61 +- .config/nvim/lua/plugins/cursor.lua | 3 + .config/nvim/lua/plugins/flash.lua | 43 +- .config/nvim/lua/plugins/hardtime.lua | 14 - .config/nvim/lua/plugins/i18n.lua | 36 +- .config/nvim/lua/plugins/init.lua | 18 + .config/nvim/lua/plugins/kanagawa.lua | 3 + .config/nvim/lua/plugins/lazydev.lua | 25 +- .config/nvim/lua/plugins/lspconfig.lua | 35 + .config/nvim/lua/plugins/lualine.lua | 12 +- .config/nvim/lua/plugins/luasnip.lua | 65 +- .config/nvim/lua/plugins/markdown.lua | 4 - .config/nvim/lua/plugins/mason.lua | 126 +-- .config/nvim/lua/plugins/mentor.lua | 9 - .config/nvim/lua/plugins/minuet.lua | 58 -- .config/nvim/lua/plugins/neotest.lua | 58 -- .config/nvim/lua/plugins/nord.lua | 5 + .config/nvim/lua/plugins/session.lua | 17 +- .config/nvim/lua/plugins/smear_cursor.lua | 4 - .config/nvim/lua/plugins/snacks.lua | 798 ++++++++++-------- .config/nvim/lua/plugins/surround.lua | 11 +- .config/nvim/lua/plugins/tokyonight.lua | 14 +- .config/nvim/lua/plugins/treesitter.lua | 115 ++- .config/nvim/lua/plugins/typescript.lua | 5 - .../plugins/{which_key.lua => whichkey.lua} | 14 +- .config/nvim/nvim-pack-lock.json | 103 +++ .config/nvim/spell/en.utf-8.add | 7 - .config/wezterm/wezterm.lua | 4 +- 37 files changed, 937 insertions(+), 1074 deletions(-) delete mode 100644 .config/nvim/lazy-lock.json delete mode 100644 .config/nvim/lua/config/lazy.lua create mode 100644 .config/nvim/lua/plugins/cursor.lua delete mode 100644 .config/nvim/lua/plugins/hardtime.lua create mode 100644 .config/nvim/lua/plugins/init.lua create mode 100644 .config/nvim/lua/plugins/kanagawa.lua create mode 100644 .config/nvim/lua/plugins/lspconfig.lua delete mode 100644 .config/nvim/lua/plugins/markdown.lua delete mode 100644 .config/nvim/lua/plugins/mentor.lua delete mode 100644 .config/nvim/lua/plugins/minuet.lua delete mode 100644 .config/nvim/lua/plugins/neotest.lua create mode 100644 .config/nvim/lua/plugins/nord.lua delete mode 100644 .config/nvim/lua/plugins/smear_cursor.lua delete mode 100644 .config/nvim/lua/plugins/typescript.lua rename .config/nvim/lua/plugins/{which_key.lua => whichkey.lua} (89%) create mode 100644 .config/nvim/nvim-pack-lock.json delete mode 100644 .config/nvim/spell/en.utf-8.add diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 083aac1..759349d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -1,5 +1,11 @@ require("options") -require("config.lazy") require("keymaps") require("autocmd") -require("snippets") +require("plugins") + +-- TODO: +-- Treesitter update + treesitter movements +-- Aerial needs new treesitter, not always showing symbols for lua files +-- Buffers management: delete others, select in picker (keybindings for pickers) +-- Autoclose explorer on file open +-- https://github.com/tduyng/nvim/tree/main diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json deleted file mode 100644 index 9523e5c..0000000 --- a/.config/nvim/lazy-lock.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, - "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, - "aerial.nvim": { "branch": "master", "commit": "7a6a42791eb2b54a7115c7db4488981f93471770" }, - "auto-session": { "branch": "main", "commit": "dcbc339a1a0e6505f755d980ad11f892b6a8d492" }, - "blink.cmp": { "branch": "main", "commit": "4b18c32adef2898f95cdef6192cbd5796c1a332d" }, - "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, - "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, - "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, - "hardtime.nvim": { "branch": "main", "commit": "b4e431934af1fe224a3a801f632c008278cb7628" }, - "js-i18n.nvim": { "branch": "main", "commit": "5157a1c1a47b14aa77fa6e50626dc1add4d1a618" }, - "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, - "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, - "lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21c2a84ce368e99b18f52ab348c4c02c32c02fcf" }, - "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, - "mentor.nvim": { "branch": "main", "commit": "54733a923072d57e50f3acc0d850fbd0b3b95f8a" }, - "minuet-ai.nvim": { "branch": "main", "commit": "3d25c24487876676d29d325c01ce108cbdbd0753" }, - "neotest": { "branch": "master", "commit": "deadfb1af5ce458742671ad3a013acb9a6b41178" }, - "neotest-jest": { "branch": "main", "commit": "3f0cc2cff1ee05394081805c622dc2551b54d8c4" }, - "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, - "nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" }, - "nvim-lspconfig": { "branch": "master", "commit": "44acfe887d4056f704ccc4f17513ed41c9e2b2e6" }, - "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-surround": { "branch": "main", "commit": "1098d7b3c34adcfa7feb3289ee434529abd4afd1" }, - "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, - "nvim-web-devicons": { "branch": "master", "commit": "746ffbb17975ebd6c40142362eee1b0249969c5c" }, - "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, - "render-markdown.nvim": { "branch": "main", "commit": "48b4175dbca8439d30c1f52231cbe5a712c8f9d9" }, - "smear-cursor.nvim": { "branch": "main", "commit": "c85bdbb25db096fbcf616bc4e1357bd61fe2c199" }, - "snacks.nvim": { "branch": "main", "commit": "da230e3ca8146da4b73752daaf0a1d07d343c12d" }, - "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, - "typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" }, - "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } -} diff --git a/.config/nvim/lua/autocmd.lua b/.config/nvim/lua/autocmd.lua index f33b63d..08c63ac 100644 --- a/.config/nvim/lua/autocmd.lua +++ b/.config/nvim/lua/autocmd.lua @@ -46,10 +46,25 @@ vim.api.nvim_create_autocmd("BufReadPost", { end, }) +local group = vim.api.nvim_create_augroup("AutoRestartOnConfigChange", { clear = true }) +local notify_file = vim.fn.stdpath("cache") .. "/.restart_notify" + vim.api.nvim_create_autocmd("VimEnter", { - desc = "Clear jump list when vim starts", - group = vim.api.nvim_create_augroup("clear-jumps", { clear = true }), + group = group, callback = function() - vim.cmd.clearjumps() + if vim.fn.filereadable(notify_file) == 1 then + vim.notify("Neovim restarted successfully!", vim.log.levels.INFO) + os.remove(notify_file) + end + end, +}) + +vim.api.nvim_create_autocmd("BufWritePost", { + group = group, + pattern = vim.fn.stdpath("config") .. "/**", + callback = function() + vim.fn.writefile({}, notify_file) + vim.cmd("AutoSession save") + vim.cmd("restart") end, }) diff --git a/.config/nvim/lua/config/lazy.lua b/.config/nvim/lua/config/lazy.lua deleted file mode 100644 index 801b5d1..0000000 --- a/.config/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,23 +0,0 @@ --- [[ Install `lazy.nvim` plugin manager ]] --- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info - -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" - -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "--branch=stable", - lazyrepo, - lazypath, - }) - if vim.v.shell_error ~= 0 then - error("Error cloning lazy.nvim:\n" .. out) - end -end - -vim.opt.rtp:prepend(lazypath) - -require("lazy").setup({ import = "plugins" }, { install = { colorscheme = { "tokyonight-storm" } } }) diff --git a/.config/nvim/lua/keymaps.lua b/.config/nvim/lua/keymaps.lua index 81521d1..87244db 100644 --- a/.config/nvim/lua/keymaps.lua +++ b/.config/nvim/lua/keymaps.lua @@ -18,10 +18,10 @@ vim.keymap.set("v", "p", '"_dP', { desc = "do not overwrite 0 register when past 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!!"') +vim.keymap.set("n", "", function() vim.notify("Use h to move!!") end) +vim.keymap.set("n", "", function() vim.notify("Use l to move!!") end) +vim.keymap.set("n", "", function() vim.notify("Use k to move!!") end) +vim.keymap.set("n", "", function() vim.notify("Use j to move!!") end) vim.keymap.set("n", "", "", { silent = true, desc = "go back with mouse" }) vim.keymap.set("n", "", "", { silent = true, desc = "go forward with mouse" }) diff --git a/.config/nvim/lua/options.lua b/.config/nvim/lua/options.lua index ceb3f3c..2d90867 100644 --- a/.config/nvim/lua/options.lua +++ b/.config/nvim/lua/options.lua @@ -86,6 +86,8 @@ vim.opt.cmdheight = 0 -- do not unload closed buffer from jumplist vim.opt.jumpoptions = "" -vim.diagnostic.config({ virtual_text = true, underline = false }) +vim.diagnostic.config({ virtual_text = true, underline = true }) + +vim.opt.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions" vim.cmd.packadd("cfilter") diff --git a/.config/nvim/lua/plugins/aerial.lua b/.config/nvim/lua/plugins/aerial.lua index 62a7115..eb324cf 100644 --- a/.config/nvim/lua/plugins/aerial.lua +++ b/.config/nvim/lua/plugins/aerial.lua @@ -1,55 +1,47 @@ -return { - "stevearc/aerial.nvim", - opts = { - highlight_on_hover = true, - highlight_on_jump = 300, - autojump = true, - post_jump_cmd = "normal! zzl", - filter_kind = { - "Array", - "Boolean", - "Class", - "Constant", - "Constructor", - "Enum", - "EnumMember", - "Event", - "Field", - "File", - "Function", - "Interface", - "Key", - "Method", - "Module", - "Namespace", - "Null", - "Number", - "Object", - "Operator", - "Package", - "Property", - "String", - "Struct", - "TypeParameter", - "Variable", - }, +vim.pack.add({ "https://github.com/stevearc/aerial.nvim" }) + +local Aerial = require("aerial") + +Aerial.setup({ + highlight_on_hover = true, + highlight_on_jump = 300, + autojump = true, + post_jump_cmd = "normal! zzl", + backends = { lua = { "lsp" } }, + filter_kind = { + "Array", + "Boolean", + "Class", + "Constant", + "Constructor", + "Enum", + "EnumMember", + "Event", + "Field", + "File", + "Function", + "Interface", + "Key", + "Method", + "Module", + "Namespace", + "Null", + "Number", + "Object", + "Operator", + "Package", + "Property", + "String", + "Struct", + "TypeParameter", + "Variable", }, - -- Optional dependencies - dependencies = { - "nvim-treesitter/nvim-treesitter", - "nvim-tree/nvim-web-devicons", - }, - keys = { - { - "ss", - function() - require("aerial").snacks_picker({ - layout = { - cycle = true, - }, - }) - end, - desc = "Symbols", - }, - }, -} +}) + +vim.keymap.set("n", "ss", function() + Aerial.snacks_picker({ attach_mode = "window" }) +end, { desc = "Symbols" }) + +vim.keymap.set("n", "sw", function() + Aerial.snacks_picker({ attach_mode = "global" }) +end, { desc = "Workspace Symbols" }) diff --git a/.config/nvim/lua/plugins/autopairs.lua b/.config/nvim/lua/plugins/autopairs.lua index 2f27d9b..dd94d9b 100644 --- a/.config/nvim/lua/plugins/autopairs.lua +++ b/.config/nvim/lua/plugins/autopairs.lua @@ -1,6 +1,8 @@ -return { - "windwp/nvim-autopairs", - event = "InsertEnter", - config = true, -} +vim.pack.add({ "https://github.com/windwp/nvim-autopairs" }) + +local Autopairs = require("nvim-autopairs") + +Autopairs.setup() + + diff --git a/.config/nvim/lua/plugins/blink.lua b/.config/nvim/lua/plugins/blink.lua index 41a5255..7ef9f52 100644 --- a/.config/nvim/lua/plugins/blink.lua +++ b/.config/nvim/lua/plugins/blink.lua @@ -1,75 +1,62 @@ -return { - "saghen/blink.cmp", - dependencies = { - { "L3MON4D3/LuaSnip", version = "v2.*" }, +vim.pack.add({ "https://github.com/saghen/blink.cmp" }) + +local Blink = require("blink.cmp") + +Blink.setup({ + fuzzy = { + implementation = "prefer_rust", + prebuilt_binaries = { force_version = "1.*" }, + frecency = { + enabled = true, + unsafe_no_lock = false, + }, + use_proximity = true, + sorts = { + "exact", + "score", + "sort_text", + "label", + }, }, - version = "1.*", - config = function() - require("blink.cmp").setup({ - fuzzy = { - frecency = { - enabled = true, - unsafe_no_lock = false, - }, - use_proximity = true, - sorts = { - -- "exact", - "score", - "sort_text", - "label", - }, + keymap = { + preset = "enter", + [""] = { "hide", "show", "fallback" }, + }, + completion = { + trigger = { + prefetch_on_insert = false, + -- show_in_snippet = false, + }, + -- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger + -- characters. + -- trigger = { show_on_keyword = false }, + -- Controls whether the documentation window will automatically show when selecting a completion item + documentation = { + auto_show = true, + auto_show_delay_ms = 0, + window = { + border = "rounded", + scrollbar = false, }, - keymap = { - preset = "enter", - [""] = { "hide", "show", "fallback" }, - [""] = require("minuet").make_blink_map(), + }, + menu = { + border = "rounded", + draw = { gap = 2 }, + scrollbar = false, + }, + }, + snippets = { preset = "luasnip" }, + sources = { + -- add lazydev to your completion providers + default = { "lazydev", "lsp", "snippets", "path", "buffer" }, + providers = { + lazydev = { + name = "LazyDev", + module = "lazydev.integrations.blink", + -- make lazydev completions top priority (see `:h blink.cmp`) + score_offset = 100, }, - completion = { - trigger = { - prefetch_on_insert = false, - -- show_in_snippet = false, - }, - -- Disable showing for all alphanumeric keywords by default. Prefer LSP specific trigger - -- characters. - -- trigger = { show_on_keyword = false }, - -- Controls whether the documentation window will automatically show when selecting a completion item - documentation = { - auto_show = true, - auto_show_delay_ms = 500, - window = { - border = "rounded", - scrollbar = false, - }, - }, - menu = { - border = "rounded", - draw = { gap = 2 }, - scrollbar = false, - }, - }, - snippets = { preset = "luasnip" }, - sources = { - -- add lazydev to your completion providers - default = { "lazydev", "lsp", "snippets", "path", "buffer" }, - providers = { - lazydev = { - name = "LazyDev", - module = "lazydev.integrations.blink", - -- make lazydev completions top priority (see `:h blink.cmp`) - score_offset = 100, - }, - minuet = { - name = "minuet", - module = "minuet.blink", - async = true, - -- Should match minuet.config.request_timeout * 1000, - -- since minuet.config.request_timeout is in seconds - timeout_ms = 3000, - score_offset = 50, -- Gives minuet higher priority among suggestions - }, - }, - }, - signature = { enabled = true }, - }) - end, -} + }, + }, + signature = { enabled = true }, +}) diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index b0f7c43..f4503c5 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -1,43 +1,22 @@ --- Autoformat -return { - "stevearc/conform.nvim", - event = { "BufWritePre" }, - cmd = { "ConformInfo" }, - keys = { - { - "f", - function() - require("conform").format({ async = true, lsp_format = "fallback" }) - end, - mode = "", - desc = "[F]ormat buffer", - }, - }, - opts = { - notify_on_error = false, - format_on_save = function(bufnr) - -- Disable "format_on_save lsp_fallback" for languages that don't - -- have a well standardized coding style. You can add additional - -- languages here or re-enable it for the disabled ones. - local disable_filetypes = { c = true, cpp = true } - local lsp_format_opt - if disable_filetypes[vim.bo[bufnr].filetype] then - lsp_format_opt = "never" - end - return { - timeout_ms = 500, - lsp_format = lsp_format_opt, - } - end, +vim.pack.add({ "https://github.com/stevearc/conform.nvim" }) - formatters_by_ft = { - lua = { "stylua" }, - javascript = { "biome", "biome-organize-imports" }, - javascriptreact = { "biome", "biome-organize-imports" }, - typescript = { "biome", "biome-organize-imports" }, - typescriptreact = { "biome", "biome-organize-imports" }, - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, - }, +local Conform = require("conform") + +Conform.setup({ + notify_on_error = false, + format_on_save = { + -- These options will be passed to conform.format() + timeout_ms = 500, + lsp_format = "fallback", }, -} + + formatters_by_ft = { + lua = { "stylua" }, + javascript = { "biome" }, + javascriptreact = { "biome" }, + typescript = { "biome" }, + typescriptreact = { "biome" }, + -- You can use 'stop_after_first' to run the first available formatter from the list + -- javascript = { "prettierd", "prettier", stop_after_first = true }, + }, +}) diff --git a/.config/nvim/lua/plugins/cursor.lua b/.config/nvim/lua/plugins/cursor.lua new file mode 100644 index 0000000..3c50303 --- /dev/null +++ b/.config/nvim/lua/plugins/cursor.lua @@ -0,0 +1,3 @@ +vim.pack.add({ "https://github.com/sphamba/smear-cursor.nvim" }) + +require("smear_cursor").setup() diff --git a/.config/nvim/lua/plugins/flash.lua b/.config/nvim/lua/plugins/flash.lua index e101434..4f2c166 100644 --- a/.config/nvim/lua/plugins/flash.lua +++ b/.config/nvim/lua/plugins/flash.lua @@ -1,12 +1,12 @@ -return { - "folke/flash.nvim", - event = "VeryLazy", - opts = { +vim.pack.add({ "https://github.com/folke/flash.nvim" }) + +local Flash = require("flash") + +Flash.setup({ jump = { autojump = true, }, label = { - -- before = true, after = true, min_pattern_length = 1, style = "overlay", @@ -14,31 +14,8 @@ return { search = { mode = "search", }, - }, - keys = { - { - "s", - mode = { "n", "x", "o" }, - function() - require("flash").jump() - end, - desc = "Flash", - }, - -- { - -- "S", - -- mode = { "n", "x", "o" }, - -- function() - -- require("flash").treesitter() - -- end, - -- desc = "Flash Treesitter", - -- }, - { - "R", - mode = { "o", "x" }, - function() - require("flash").treesitter_search() - end, - desc = "Treesitter Search", - }, - }, -} + }) + +vim.keymap.set({ "n", "x", "o" }, "s", function() require("flash").jump() end, { desc = "Flash" }) +-- TODO: use treesitter objects for vim motions +-- vim.keymap.set({ "o", "x" }, "R", function() require("flash").treesitter_search() end, { desc = "Treesitter Search" }) diff --git a/.config/nvim/lua/plugins/hardtime.lua b/.config/nvim/lua/plugins/hardtime.lua deleted file mode 100644 index 0643a9f..0000000 --- a/.config/nvim/lua/plugins/hardtime.lua +++ /dev/null @@ -1,14 +0,0 @@ -return { - "m4xshen/hardtime.nvim", - lazy = false, - dependencies = { "MunifTanjim/nui.nvim" }, - opts = { - disable_mouse = false, - disabled_keys = { - [""] = false, - [""] = false, - [""] = false, - [""] = false, - }, - }, -} diff --git a/.config/nvim/lua/plugins/i18n.lua b/.config/nvim/lua/plugins/i18n.lua index ca6c349..5e73162 100644 --- a/.config/nvim/lua/plugins/i18n.lua +++ b/.config/nvim/lua/plugins/i18n.lua @@ -1,14 +1,26 @@ -return { - "nabekou29/js-i18n.nvim", - dependencies = { - "neovim/nvim-lspconfig", - "nvim-treesitter/nvim-treesitter", - "nvim-lua/plenary.nvim", +vim.pack.add({ + { src = "https://github.com/nabekou29/js-i18n.nvim", version = "v0.5.4" }, + "https://github.com/nvim-lua/plenary.nvim", +}) + +local I18n = require("js-i18n") + +vim.opt.conceallevel = 2 + +I18n.setup({ + primary_language = { "en" }, -- The default language to display (initial setting for displaying virtual text, etc.) + translation_source = { "**/{messages}/*.json" }, -- Pattern for translation resources + respect_gitignore = true, -- Whether to respect .gitignore when retrieving translation resources and implementation files. Setting to false may improve performance. + -- detect_language = ..., -- Function to detect the language. By default, a function that detects the language heuristically from the file name is used. + key_separator = ".", -- Key separator + virt_text = { + enabled = true, -- Enable virtual text display + conceal_key = true, -- Hide keys and display only translations + max_length = 20, -- Maximum length of virtual text. 0 means unlimited. + max_width = 0, -- Maximum width of virtual text. 0 means unlimited. (`max_length` takes precedence.) }, - event = { "BufReadPre", "BufNewFile" }, - opts = { - virt_text = { - enabled = false, -- Enable virtual text display - }, + diagnostic = { + enabled = true, -- Enable the display of diagnostic information + severity = vim.diagnostic.severity.WARN, -- Severity level of diagnostic information }, -} +}) diff --git a/.config/nvim/lua/plugins/init.lua b/.config/nvim/lua/plugins/init.lua new file mode 100644 index 0000000..293e264 --- /dev/null +++ b/.config/nvim/lua/plugins/init.lua @@ -0,0 +1,18 @@ +require("plugins.nord") +require("plugins.mason") +require("plugins.lspconfig") +require("plugins.lazydev") +require("plugins.luasnip") +require("plugins.surround") +require("plugins.conform") +require("plugins.flash") +require("plugins.autopairs") +require("plugins.treesitter") +require("plugins.lualine") +require("plugins.whichkey") +require("plugins.cursor") +require("plugins.snacks") +require("plugins.aerial") +require("plugins.i18n") +require("plugins.blink") +require("plugins.session") diff --git a/.config/nvim/lua/plugins/kanagawa.lua b/.config/nvim/lua/plugins/kanagawa.lua new file mode 100644 index 0000000..34d0a6e --- /dev/null +++ b/.config/nvim/lua/plugins/kanagawa.lua @@ -0,0 +1,3 @@ +vim.pack.add({ "https://github.com/rebelot/kanagawa.nvim" }) + +vim.cmd("colorscheme kanagawa-dragon") diff --git a/.config/nvim/lua/plugins/lazydev.lua b/.config/nvim/lua/plugins/lazydev.lua index daf97e2..e63406b 100644 --- a/.config/nvim/lua/plugins/lazydev.lua +++ b/.config/nvim/lua/plugins/lazydev.lua @@ -1,15 +1,10 @@ --- lazydev.nvim is a plugin that properly configures LuaLS for editing your Neovim config by --- lazily updating your workspace libraries. -return { - 'folke/lazydev.nvim', - ft = 'lua', - opts = { - library = { - -- See the configuration section for more details - -- Load luvit types when the `vim.uv` word is found - { path = "${3rd}/luv/library", words = { "vim%.uv" } }, - '~/.local/share/nvim/lazy/', - { path = "snacks.nvim", words = { "Snacks", "snacks" } }, - }, - } -} +vim.pack.add({ "https://github.com/folke/lazydev.nvim" }) + +local Lazydev = require("lazydev") + +Lazydev.setup({ + library = { + vim.env.VIMRUNTIME, + { path = "${3rd}/luv/library", words = { "vim%.uv" } }, + }, +}) diff --git a/.config/nvim/lua/plugins/lspconfig.lua b/.config/nvim/lua/plugins/lspconfig.lua new file mode 100644 index 0000000..3a14f53 --- /dev/null +++ b/.config/nvim/lua/plugins/lspconfig.lua @@ -0,0 +1,35 @@ +vim.pack.add({ "https://github.com/neovim/nvim-lspconfig" }) + +vim.lsp.config("lua_ls", { + settings = { + Lua = { + workspace = { + checkThirdParty = false, + library = { + vim.api.nvim_get_runtime_file("", true), + "${3rd}/luv/library", + }, + }, + runtime = { + version = "LuaJIT", + }, + format = { enable = false }, + telemetry = { enable = false }, + -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings + diagnostics = { disable = { "missing-fields" }, globals = { "vim", "require" } }, + hint = { enable = true }, + }, + }, +}) + +vim.lsp.enable({ + "stylua", + "biome", + "tailwindcss", + "html", + "cssls", + "emmet_language_server", + "lua_ls", + "tsgo", + "codebook", +}) diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua index c08bb95..1708163 100644 --- a/.config/nvim/lua/plugins/lualine.lua +++ b/.config/nvim/lua/plugins/lualine.lua @@ -1,7 +1,8 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - opts = { +vim.pack.add({ "https://github.com/nvim-lualine/lualine.nvim", "https://github.com/nvim-lualine/lualine.nvim" }) + +local Lualine = require("lualine") + +Lualine.setup({ options = { icons_enabled = true, theme = "auto", @@ -41,5 +42,4 @@ return { winbar = {}, inactive_winbar = {}, extensions = {}, - }, -} + }) diff --git a/.config/nvim/lua/plugins/luasnip.lua b/.config/nvim/lua/plugins/luasnip.lua index 59c09e1..2f2f318 100644 --- a/.config/nvim/lua/plugins/luasnip.lua +++ b/.config/nvim/lua/plugins/luasnip.lua @@ -1,57 +1,12 @@ -return { - "L3MON4D3/LuaSnip", - -- follow latest release. - version = "v2.*", -- Replace by the latest released major (first number of latest release) - -- install jsregexp (optional!). - build = "make install_jsregexp", - dependencies = { - "rafamadriz/friendly-snippets", - }, - config = function() - require("luasnip").setup({ - update_events = "TextChanged,TextChangedI", - }) +vim.pack.add({ + { src = "https://github.com/L3MON4D3/LuaSnip", version = "v2.4.1" }, + "https://github.com/rafamadriz/friendly-snippets", +}) - require("luasnip.loaders.from_vscode").lazy_load() +local Luasnip = require("luasnip") - require("luasnip").filetype_extend("typescript", { "javascript" }) - require("luasnip").filetype_extend("typescriptreact", { "javascript" }) - end, - -- keys = { - -- { - -- "rs", - -- ":source ~/.config/nvim/lua/snippets.lua", - -- desc = "[R]eload [s]nippets", - -- }, - -- { - -- "", - -- function() - -- if require("luasnip").locally_jumpable(1) then - -- require("luasnip").jump(1) - -- end - -- end, - -- mode = { "i", "s" }, - -- desc = "next snippet placeholder", - -- }, - -- { - -- "", - -- function() - -- if require("luasnip").locally_jumpable(-1) then - -- require("luasnip").jump(-1) - -- end - -- end, - -- mode = { "i", "s" }, - -- desc = "prev snippet placeholder", - -- }, - -- { - -- "", - -- function() - -- if require("luasnip").choice_active() then - -- require("luasnip").change_choice(1) - -- end - -- end, - -- mode = { "i", "s" }, - -- desc = "prev snippet placeholder", - -- }, - -- }, -} +Luasnip.setup({ update_events = "TextChanged,TextChangedI" }) + +require("luasnip.loaders.from_vscode").lazy_load() +require("luasnip").filetype_extend("typescript", { "javascript" }) +require("luasnip").filetype_extend("typescriptreact", { "javascript" }) diff --git a/.config/nvim/lua/plugins/markdown.lua b/.config/nvim/lua/plugins/markdown.lua deleted file mode 100644 index b6264b8..0000000 --- a/.config/nvim/lua/plugins/markdown.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "MeanderingProgrammer/render-markdown.nvim", - ft = { "markdown", "codecompanion" }, -} diff --git a/.config/nvim/lua/plugins/mason.lua b/.config/nvim/lua/plugins/mason.lua index 34700dc..adf6337 100644 --- a/.config/nvim/lua/plugins/mason.lua +++ b/.config/nvim/lua/plugins/mason.lua @@ -1,112 +1,22 @@ --- Automatically install LSPs and related tools to stdpath for neovim -return { - "williamboman/mason.nvim", - dependencies = { - "neovim/nvim-lspconfig", - "williamboman/mason-lspconfig.nvim", - }, - config = function() - local servers = { - harper_ls = { - settings = { - ["harper-ls"] = { - userDictPath = vim.fn.stdpath("config") .. "/spell/en.utf-8.add", - }, - }, - }, - marksman = {}, - -- vtsls = { - -- settings = { - -- complete_function_calls = true, - -- vtsls = { - -- enableMoveToFileCodeAction = true, - -- autoUseWorkspaceTsdk = true, - -- experimental = { - -- completion = { - -- enableServerSideFuzzyMatch = true, - -- }, - -- }, - -- }, - -- javascript = { - -- updateImportsOnFileMove = { enabled = "always" }, - -- suggest = { - -- completeFunctionCalls = true, - -- }, - -- inlayHints = { - -- enumMemberValues = { enabled = true }, - -- functionLikeReturnTypes = { enabled = true }, - -- parameterNames = { enabled = "literals" }, - -- parameterTypes = { enabled = true }, - -- propertyDeclarationTypes = { enabled = true }, - -- variableTypes = { enabled = true }, - -- }, - -- }, - -- typescript = { - -- updateImportsOnFileMove = { enabled = "always" }, - -- suggest = { - -- completeFunctionCalls = true, - -- }, - -- inlayHints = { - -- enumMemberValues = { enabled = true }, - -- functionLikeReturnTypes = { enabled = true }, - -- parameterNames = { enabled = "literals" }, - -- parameterTypes = { enabled = true }, - -- propertyDeclarationTypes = { enabled = true }, - -- variableTypes = { enabled = true }, - -- }, - -- }, - -- }, - -- }, - lua_ls = { - settings = { - Lua = { - telemetry = { enable = false }, - -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings - diagnostics = { disable = { "missing-fields" } }, - hint = { enable = true }, - }, - }, - }, - tailwindcss = {}, - html = {}, - cssls = {}, - emmet_language_server = {}, - } +vim.pack.add({ "https://github.com/mason-org/mason.nvim" }) - -- Special formatted fields cannot be set above - -- servers.vtsls.settings["js/ts"] = { implicitProjectConfig = { checkJs = true } } +local Mason = require("mason") - require("mason").setup() +Mason.setup() - require("mason-lspconfig").setup({ - ensure_installed = vim.tbl_keys(servers or {}), - automatic_installation = false, - handlers = { - function(server_name) - local server = servers[server_name] or {} - -- This handles overriding only values explicitly passed - -- by the server configuration above. Useful when disabling - -- certain features of an LSP (for example, turning off formatting for ts_ls) - server.capabilities = vim.tbl_deep_extend("force", {}, server.capabilities or {}) - require("lspconfig")[server_name].setup(server) - end, - }, - }) - - -- TODO: move to native lsp configs when - -- lspconfig plugin will be merged into core - -- for server, settings in pairs(servers) do - -- vim.lsp.config(server, settings) - -- vim.lsp.enable(server) - -- end - - -- Linters - local linters = { "stylua", "biome" } - - for _, linter in ipairs(linters) do - if not require("mason-registry").is_installed(linter) then - vim.cmd("MasonInstall " .. linter) - end - end - end, +local lsps = { + "stylua", + "biome", + "tailwindcss-language-server", + "html-lsp", + "css-lsp", + "emmet-language-server", + "lua-language-server", + "codebook", } + +for _, lsp in ipairs(lsps) do + if not require("mason-registry").is_installed(lsp) then + vim.cmd("MasonInstall " .. lsp) + end +end diff --git a/.config/nvim/lua/plugins/mentor.lua b/.config/nvim/lua/plugins/mentor.lua deleted file mode 100644 index 04071c7..0000000 --- a/.config/nvim/lua/plugins/mentor.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - "cksidharthan/mentor.nvim", - opts = { - tips = { - "You can use shift+a to jump to end of line in insert mode.", - "Shift+p to paste in visual mode multiple times", - }, - }, -} diff --git a/.config/nvim/lua/plugins/minuet.lua b/.config/nvim/lua/plugins/minuet.lua deleted file mode 100644 index fd96944..0000000 --- a/.config/nvim/lua/plugins/minuet.lua +++ /dev/null @@ -1,58 +0,0 @@ -return { - { - "milanglacier/minuet-ai.nvim", - config = function() - require("minuet").setup({ - provider = "gemini", - provider_options = { - claude = { - max_tokens = 512, - model = "claude-haiku-4-5", - }, - codestral = { - optional = { - max_tokens = 256, - stop = { "\n\n" }, - }, - }, - gemini = { - model = "gemini-2.0-flash", - optional = { - generationConfig = { - maxOutputTokens = 256, - -- When using `gemini-2.5-flash`, it is recommended to entirely - -- disable thinking for faster completion retrieval. - thinkingConfig = { - thinkingBudget = 0, - }, - }, - safetySettings = { - { - -- HARM_CATEGORY_HATE_SPEECH, - -- HARM_CATEGORY_HARASSMENT - -- HARM_CATEGORY_SEXUALLY_EXPLICIT - category = "HARM_CATEGORY_DANGEROUS_CONTENT", - -- BLOCK_NONE - threshold = "BLOCK_ONLY_HIGH", - }, - }, - }, - }, - }, - virtualtext = { - auto_trigger_ft = { "lua", "typescript", "typescriptreact", "javascript" }, - keymap = { - accept = "", - accept_line = "CR", - accept_n_lines = "", - prev = "", - next = "", - dismiss = "", - }, - show_on_completion_menu = true, - }, - }) - end, - }, - { "nvim-lua/plenary.nvim" }, -} diff --git a/.config/nvim/lua/plugins/neotest.lua b/.config/nvim/lua/plugins/neotest.lua deleted file mode 100644 index 107a0a0..0000000 --- a/.config/nvim/lua/plugins/neotest.lua +++ /dev/null @@ -1,58 +0,0 @@ -return { - "nvim-neotest/neotest", - dependencies = { - "nvim-neotest/nvim-nio", - "nvim-lua/plenary.nvim", - "antoinemadec/FixCursorHold.nvim", - "nvim-treesitter/nvim-treesitter", - "nvim-neotest/neotest-jest", - }, - keys = { - { - "tt", - function() - require("neotest").run.run() - end, - mode = "", - desc = "[T]est run under cursor", - }, - { - "ts", - function() - require("neotest").summary.toggle() - end, - mode = "", - desc = "[T]est [s]tatus", - }, - { - "tf", - function() - require("neotest").run.run(vim.fn.expand("%")) - end, - mode = "", - desc = "[T]est [f]ile", - }, - { - "tw", - function() - require("neotest").watch.watch() - end, - mode = "", - desc = "[T]est [w]atch under cursor", - }, - }, - config = function() - require("neotest").setup({ - discovery = { - enabled = false, - }, - adapters = { - require("neotest-jest")({ - cwd = function(path) - return vim.fn.getcwd() - end, - }), - }, - }) - end, -} diff --git a/.config/nvim/lua/plugins/nord.lua b/.config/nvim/lua/plugins/nord.lua new file mode 100644 index 0000000..fd0412e --- /dev/null +++ b/.config/nvim/lua/plugins/nord.lua @@ -0,0 +1,5 @@ +vim.pack.add({ "https://github.com/gbprod/nord.nvim" }) + +require("nord").setup({}) + +vim.cmd.colorscheme("nord") diff --git a/.config/nvim/lua/plugins/session.lua b/.config/nvim/lua/plugins/session.lua index 8ec58b2..a53d357 100644 --- a/.config/nvim/lua/plugins/session.lua +++ b/.config/nvim/lua/plugins/session.lua @@ -1,12 +1,7 @@ -return { - "rmagatti/auto-session", - lazy = false, +vim.pack.add({ "https://github.com/rmagatti/auto-session" }) - ---enables autocomplete for opts - ---@module "auto-session" - ---@type AutoSession.Config - opts = { - suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, - -- log_level = 'debug', - }, -} +require("auto-session").setup({ + suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" }, + auto_restore = true, + auto_save = true, +}) diff --git a/.config/nvim/lua/plugins/smear_cursor.lua b/.config/nvim/lua/plugins/smear_cursor.lua deleted file mode 100644 index 69fd054..0000000 --- a/.config/nvim/lua/plugins/smear_cursor.lua +++ /dev/null @@ -1,4 +0,0 @@ -return { - "sphamba/smear-cursor.nvim", - opts = {}, -} diff --git a/.config/nvim/lua/plugins/snacks.lua b/.config/nvim/lua/plugins/snacks.lua index b820b59..161ef3c 100644 --- a/.config/nvim/lua/plugins/snacks.lua +++ b/.config/nvim/lua/plugins/snacks.lua @@ -1,374 +1,438 @@ -return { - "folke/snacks.nvim", - tag = "v2.23.0", - priority = 1000, - lazy = false, - ---@type snacks.Config - opts = { - bigfile = { enabled = true }, - explorer = { enabled = true, replace_netrw = true }, - indent = { enabled = true }, - input = { enabled = true }, - notifier = { - enabled = true, - timeout = 10000, - width = { min = 40, max = 100 }, - height = { min = 1, max = 1000 }, - }, - image = { enabled = false }, - picker = { - layout = { fullscreen = true }, - matcher = { - fuzzy = true, -- use fuzzy matching - smartcase = true, -- use smartcase - ignorecase = true, -- use ignorecase - sort_empty = false, -- sort results when the search string is empty - filename_bonus = true, -- give bonus for matching file names (last part of the path) - file_pos = true, -- support patterns like `file:line:col` and `file:line` - -- the bonusses below, possibly require string concatenation and path normalization, - -- so this can have a performance impact for large lists and increase memory usage - cwd_bonus = false, -- give bonus for matching files in the cwd - frecency = true, -- frecency bonus - history_bonus = false, -- give more weight to chronological order +vim.pack.add({ "https://github.com/folke/snacks.nvim" }) + +local Snacks = require("snacks") + +local exclude = { + "**/.git/*", + "**/.next/*", + "**/.cursor/*", + "**/node_modules/*", + "**/.yarn/cache/*", + "**/.yarn/install*", + "**/.yarn/releases/*", + "**/.pnpm-store/*", + "**/.idea/*", + "**/.DS_Store", + "build/*", + "coverage/*", + "dist/*", + "hodor-types/*", + "**/target/*", + "**/.node-gyp/**", + "**/claude/debug", + "**/claude/file-history", + "**/claude/plans", + "**/claude/plugins", + "**/claude/projects", + "**/claude/session-env", + "**/claude/shell-snapshots", + "**/claude/statsig", + "**/claude/telemetry", + "**/claude/todos", + "**/claude/history.jsonl", +} + +local files = { ignored = true, hidden = true, exclude = exclude } + +Snacks.setup({ + bigfile = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + notifier = { + enabled = true, + timeout = 10000, + width = { min = 40, max = 100 }, + height = { min = 1, max = 1000 }, + }, + image = { enabled = false }, + picker = { + layout = { fullscreen = true }, + sources = { + select = { layout = { fullscreen = false } }, + files = vim.tbl_deep_extend("force", { layout = { preset = "select", fullscreen = false } }, files), + grep = files, + lsp_symbols = files, + explorer = { + ignored = true, + hidden = true, + exclude = exclude, + replace_netrw = true, + supports_live = true, + auto_close = true, + follow_file = true, + jump = { close = true }, + focus = "list", + layout = { preset = "sidebar", fullscreen = false }, }, }, - quickfile = { enabled = true }, - scroll = { enabled = false }, - statuscolumn = { enabled = true }, - words = { enabled = true }, - styles = { - notification = {}, + matcher = { + fuzzy = true, -- use fuzzy matching + smartcase = true, -- use smartcase + ignorecase = true, -- use ignorecase + sort_empty = false, -- sort results when the search string is empty + filename_bonus = true, -- give bonus for matching file names (last part of the path) + file_pos = true, -- support patterns like `file:line:col` and `file:line` + -- the bonusses below, possibly require string concatenation and path normalization, + -- so this can have a performance impact for large lists and increase memory usage + cwd_bonus = false, -- give bonus for matching files in the cwd + frecency = true, -- frecency bonus + history_bonus = false, -- give more weight to chronological order }, }, - keys = { - -- Top Pickers & Explorer - { - "", - function() - Snacks.picker.buffers({ matcher = { frecency = true } }) - end, - desc = "Buffers", - }, - { - "e", - function() - Snacks.explorer({ layout = { fullscreen = false } }) - end, - desc = "File Explorer", - }, - -- config - { - "cc", - function() - Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) - end, - desc = "Find Config File", - }, - -- search - { - "sf", - function() - Snacks.picker.files({ - matcher = { frecency = true }, - layout = { preset = "select" }, - }) - end, - desc = "Find Files", - }, - { - "/", - function() - Snacks.picker.lines() - end, - desc = "Buffer Lines", - }, - { - "sg", - function() - Snacks.picker.grep() - end, - desc = "Grep", - }, - { - "sB", - function() - Snacks.picker.grep_buffers() - end, - desc = "Grep Open Buffers", - }, - { - "sp", - function() - Snacks.picker.projects() - end, - desc = "Projects", - }, - { - "sc", - function() - Snacks.picker.commands() - end, - desc = "Commands", - }, - { - "sd", - function() - Snacks.picker.diagnostics_buffer({ - matcher = { smartcase = true }, - }) - end, - desc = "Buffer Diagnostics", - }, - { - "sD", - function() - Snacks.picker.diagnostics() - end, - desc = "All Diagnostics", - }, - { - "sh", - function() - Snacks.picker.help() - end, - desc = "Help Pages", - }, - { - "sH", - function() - Snacks.picker.highlights() - end, - desc = "Highlights", - }, - { - "sj", - function() - Snacks.picker.jumps() - end, - desc = "Jumps", - }, - { - "sk", - function() - Snacks.picker.keymaps() - end, - desc = "Keymaps", - }, - { - "sM", - function() - Snacks.picker.man() - end, - desc = "Man Pages", - }, - { - "sq", - function() - Snacks.picker.qflist() - end, - desc = "Quickfix List", - }, - { - "sR", - function() - Snacks.picker.resume() - end, - desc = "Resume", - }, - { - "su", - function() - Snacks.picker.undo() - end, - desc = "Undo History", - }, - { - "co", - function() - Snacks.picker.colorschemes() - end, - desc = "Colorschemes", - }, - -- LSP - { - "gd", - function() - Snacks.picker.lsp_definitions() - end, - desc = "Goto Definition", - }, - { - "gD", - function() - Snacks.picker.lsp_declarations() - end, - desc = "Goto Declaration", - }, - { - "gr", - function() - Snacks.picker.lsp_references() - end, - nowait = true, - desc = "References", - }, - { - "gi", - function() - Snacks.picker.lsp_implementations() - end, - desc = "Goto Implementation", - }, - { - "gy", - function() - Snacks.picker.lsp_type_definitions() - end, - desc = "Goto T[y]pe Definition", - }, - { - "sw", - function() - Snacks.picker.lsp_workspace_symbols() - end, - desc = "LSP Workspace Symbols", - }, - { - "ca", - function() - vim.lsp.buf.code_action() - end, - desc = "Code actions", - }, - { - "rn", - function() - vim.lsp.buf.rename() - end, - desc = "Rename symbols", - }, - -- Other - { - "z", - function() - Snacks.zen() - end, - desc = "Toggle Zen Mode", - }, - { - "Z", - function() - Snacks.zen.zoom() - end, - desc = "Toggle Zoom", - }, - { - ".", - function() - Snacks.scratch() - end, - desc = "Toggle Scratch Buffer", - }, - { - "S", - function() - Snacks.scratch.select() - end, - desc = "Select Scratch Buffer", - }, - { - "mv", - function() - Snacks.rename.rename_file() - end, - desc = "Move File", - }, - { - "gg", - function() - Snacks.lazygit({ win = { width = 0, height = 0 } }) - end, - desc = "Lazygit", - }, - { - "un", - function() - Snacks.notifier.hide() - end, - desc = "Dismiss All Notifications", - }, - { - "", - function() - Snacks.terminal() - end, - desc = "which_key_ignore", - }, - { - "]]", - function() - Snacks.words.jump(vim.v.count1) - end, - desc = "Next Reference", - mode = { "n", "t" }, - }, - { - "[[", - function() - Snacks.words.jump(-vim.v.count1) - end, - desc = "Prev Reference", - mode = { "n", "t" }, - }, - { - "N", - desc = "Neovim News", - function() - Snacks.win({ - file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1], - width = 0.6, - height = 0.6, - wo = { - spell = false, - wrap = false, - signcolumn = "yes", - statuscolumn = " ", - conceallevel = 3, - }, - }) - end, - }, + quickfile = { enabled = true }, + scroll = { enabled = false }, + statuscolumn = { enabled = true }, + words = { enabled = true }, + styles = { + notification = {}, }, - init = function() - vim.api.nvim_create_autocmd("User", { - pattern = "VeryLazy", - callback = function() - -- Setup some globals for debugging (lazy-loaded) - _G.dd = function(...) - Snacks.debug.inspect(...) - end - _G.bt = function() - Snacks.debug.backtrace() - end - vim.print = _G.dd -- Override print to use snacks for `:=` command +}) - -- Create some toggle mappings - Snacks.toggle.option("spell", { name = "Spelling" }):map("us") - Snacks.toggle.option("wrap", { name = "Wrap" }):map("uw") - Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("uL") - Snacks.toggle.diagnostics():map("ud") - Snacks.toggle.line_number():map("ul") - Snacks.toggle - .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) - :map("uc") - Snacks.toggle.treesitter():map("uT") - Snacks.toggle - .option("background", { off = "light", on = "dark", name = "Dark Background" }) - :map("ub") - Snacks.toggle.inlay_hints():map("uh") - Snacks.toggle.indent():map("ug") - Snacks.toggle.dim():map("uD") - end, - }) - end, +local keys = { + -- Top Pickers & Explorer + { + "", + function() + Snacks.picker.buffers() + end, + desc = "Buffers", + }, + { + "e", + function() + Snacks.explorer() + end, + desc = "File Explorer", + }, + -- config + { + "cc", + function() + Snacks.picker.files({ cwd = vim.fn.stdpath("config") }) + end, + desc = "Find Config File", + }, + -- search + { + "sf", + function() + Snacks.picker.files() + end, + desc = "Find Files", + }, + { + "/", + function() + Snacks.picker.lines() + end, + desc = "Buffer Lines", + }, + { + "sg", + function() + Snacks.picker.grep() + end, + desc = "Grep", + }, + { + "sB", + function() + Snacks.picker.grep_buffers() + end, + desc = "Grep Open Buffers", + }, + { + "sp", + function() + Snacks.picker.projects() + end, + desc = "Projects", + }, + { + "sc", + function() + Snacks.picker.commands() + end, + desc = "Commands", + }, + { + "sd", + function() + Snacks.picker.diagnostics_buffer({ + layout = { + layout = { + backdrop = false, + box = "vertical", + border = true, + title = "{title} {live} {flags}", + title_pos = "center", + { win = "input", height = 1, border = "bottom" }, + { win = "list", border = "none" }, + { win = "preview", title = "{preview}", height = 0.7, border = "top" }, + }, + }, + matcher = { fuzzy = false }, + }) + end, + desc = "Buffer Diagnostics", + }, + { + "sD", + function() + Snacks.picker.diagnostics() + end, + desc = "All Diagnostics", + }, + { + "sh", + function() + Snacks.picker.help() + end, + desc = "Help Pages", + }, + { + "sH", + function() + Snacks.picker.highlights() + end, + desc = "Highlights", + }, + { + "sj", + function() + Snacks.picker.jumps() + end, + desc = "Jumps", + }, + { + "sk", + function() + Snacks.picker.keymaps() + end, + desc = "Keymaps", + }, + { + "sM", + function() + Snacks.picker.man() + end, + desc = "Man Pages", + }, + { + "sq", + function() + Snacks.picker.qflist() + end, + desc = "Quickfix List", + }, + { + "sR", + function() + Snacks.picker.resume() + end, + desc = "Resume", + }, + { + "su", + function() + Snacks.picker.undo() + end, + desc = "Undo History", + }, + { + "co", + function() + Snacks.picker.colorschemes() + end, + desc = "Colorschemes", + }, + -- LSP + { + "gd", + function() + Snacks.picker.lsp_definitions() + end, + desc = "Goto Definition", + }, + { + "gD", + function() + Snacks.picker.lsp_declarations() + end, + desc = "Goto Declaration", + }, + { + "gr", + function() + Snacks.picker.lsp_references() + end, + nowait = true, + desc = "References", + }, + { + "gi", + function() + Snacks.picker.lsp_implementations() + end, + desc = "Goto Implementation", + }, + { + "gy", + function() + Snacks.picker.lsp_type_definitions() + end, + desc = "Goto T[y]pe Definition", + }, + { + "ca", + function() + vim.lsp.buf.code_action({ apply = true }) + end, + desc = "Code actions", + }, + { + "rn", + function() + vim.lsp.buf.rename() + end, + desc = "Rename symbols", + }, + -- Other + { + "z", + function() + Snacks.zen() + end, + desc = "Toggle Zen Mode", + }, + { + "Z", + function() + Snacks.zen.zoom() + end, + desc = "Toggle Zoom", + }, + { + ".", + function() + Snacks.scratch() + end, + desc = "Toggle Scratch Buffer", + }, + { + "S", + function() + Snacks.scratch.select() + end, + desc = "Select Scratch Buffer", + }, + { + "mv", + function() + Snacks.rename.rename_file() + end, + desc = "Move File", + }, + { + "gg", + function() + Snacks.lazygit({ win = { width = 0, height = 0 } }) + end, + desc = "Lazygit", + }, + { + "un", + function() + Snacks.notifier.hide() + end, + desc = "Dismiss All Notifications", + }, + { + "", + function() + Snacks.terminal() + end, + desc = "which_key_ignore", + }, + { + "]]", + function() + Snacks.words.jump(vim.v.count1) + end, + desc = "Next Reference", + mode = { "n", "t" }, + }, + { + "[[", + function() + Snacks.words.jump(-vim.v.count1) + end, + desc = "Prev Reference", + mode = { "n", "t" }, + }, + { + "N", + desc = "Neovim News", + function() + Snacks.win({ + file = vim.api.nvim_get_runtime_file("doc/news.txt", false)[1], + width = 0.6, + height = 0.6, + wo = { + spell = false, + wrap = false, + signcolumn = "yes", + statuscolumn = " ", + conceallevel = 3, + }, + }) + end, + }, } + +for _, map in ipairs(keys) do + local opts = { desc = map.desc } + if map.silent ~= nil then + opts.silent = map.silent + end + if map.noremap ~= nil then + opts.noremap = map.noremap + else + opts.noremap = true + end + if map.expr ~= nil then + opts.expr = map.expr + end + + local mode = map.mode or "n" + vim.keymap.set(mode, map[1], map[2], opts) +end + +-- TODO: toggles are not registered +vim.api.nvim_create_autocmd("User", { + callback = function() + -- Setup some globals for debugging (lazy-loaded) + _G.dd = function(...) + Snacks.debug.inspect(...) + end + _G.bt = function() + Snacks.debug.backtrace() + end + vim.print = _G.dd -- Override print to use snacks for `:=` command + + -- Create some toggle mappings + Snacks.toggle.option("spell", { name = "Spelling" }):map("us") + Snacks.toggle.option("wrap", { name = "Wrap" }):map("uw") + Snacks.toggle.option("relativenumber", { name = "Relative Number" }):map("uL") + Snacks.toggle.diagnostics():map("ud") + Snacks.toggle.line_number():map("ul") + Snacks.toggle + .option("conceallevel", { off = 0, on = vim.o.conceallevel > 0 and vim.o.conceallevel or 2 }) + :map("uc") + Snacks.toggle.treesitter():map("uT") + Snacks.toggle.option("background", { off = "light", on = "dark", name = "Dark Background" }):map("ub") + Snacks.toggle.inlay_hints():map("uh") + Snacks.toggle.indent():map("ug") + Snacks.toggle.dim():map("uD") + end, +}) diff --git a/.config/nvim/lua/plugins/surround.lua b/.config/nvim/lua/plugins/surround.lua index 42177d2..f4f9534 100644 --- a/.config/nvim/lua/plugins/surround.lua +++ b/.config/nvim/lua/plugins/surround.lua @@ -1,8 +1,3 @@ -return { - "kylechui/nvim-surround", - version = "*", -- Use for stability; omit to use `main` branch for the latest features - event = "VeryLazy", - config = function() - require("nvim-surround").setup({}) - end, -} +vim.pack.add({ "https://github.com/kylechui/nvim-surround" }) + +require("nvim-surround").setup({}) diff --git a/.config/nvim/lua/plugins/tokyonight.lua b/.config/nvim/lua/plugins/tokyonight.lua index 91dfb50..597a0e1 100644 --- a/.config/nvim/lua/plugins/tokyonight.lua +++ b/.config/nvim/lua/plugins/tokyonight.lua @@ -1,13 +1,3 @@ -return { - "folke/tokyonight.nvim", - priority = 1000, -- Make sure to load this before all the other start plugins. - init = function() - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme("tokyonight-night") +vim.pack.add({ "https://github.com/folke/tokyonight.nvim" }) - -- You can configure highlights by doing something like: - -- vim.cmd.hi("Comment gui=none") - end, -} +-- vim.cmd.colorscheme("tokyonight-night") diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index a47ab28..346db9d 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,41 +1,78 @@ --- Highlight, edit, and navigate code -return { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local configs = require("nvim-treesitter.configs") +vim.pack.add({ { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "master" } }) - configs.setup({ - ensure_installed = { - "bash", - "c", - "diff", - "html", - "lua", - "luadoc", - "markdown", - "markdown_inline", - "query", - "vim", - "vimdoc", - "go", - "typescript", - "javascript", - "tsx", - }, - auto_install = true, - sync_install = true, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = "", - scope_incremental = "", - node_incremental = "", - node_decremental = "", - }, - }, - }) +local configs = require("nvim-treesitter.configs") + +configs.setup({ + ensure_installed = { + "bash", + "blade", + "c", + "comment", + "css", + "diff", + "dockerfile", + "fish", + "gitcommit", + "gitignore", + "go", + "gomod", + "gosum", + "gowork", + "html", + "ini", + "javascript", + "jsdoc", + "json", + "lua", + "luadoc", + "luap", + "make", + "markdown", + "markdown_inline", + "nginx", + "nix", + "proto", + "python", + "query", + "regex", + "rust", + "scss", + "sql", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "xml", + "yaml", + "zig", + }, + auto_install = true, + sync_install = true, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = "", + scope_incremental = "", + node_incremental = "", + node_decremental = "", + }, + }, +}) + +vim.api.nvim_create_autocmd("PackChanged", { + desc = "Handle nvim-treesitter updates", + group = vim.api.nvim_create_augroup("nvim-treesitter-pack-changed-update-handler", { clear = true }), + callback = function(event) + if event.data.kind == "update" then + local ok = pcall(vim.cmd, "TSUpdate") + if ok then + vim.notify("TSUpdate completed successfully!", vim.log.levels.INFO) + else + vim.notify("TSUpdate command not available yet, skipping", vim.log.levels.WARN) + end + end end, -} +}) diff --git a/.config/nvim/lua/plugins/typescript.lua b/.config/nvim/lua/plugins/typescript.lua deleted file mode 100644 index 078ece8..0000000 --- a/.config/nvim/lua/plugins/typescript.lua +++ /dev/null @@ -1,5 +0,0 @@ -return { - "pmizio/typescript-tools.nvim", - dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" }, - opts = {}, -} diff --git a/.config/nvim/lua/plugins/which_key.lua b/.config/nvim/lua/plugins/whichkey.lua similarity index 89% rename from .config/nvim/lua/plugins/which_key.lua rename to .config/nvim/lua/plugins/whichkey.lua index 16e259c..395000f 100644 --- a/.config/nvim/lua/plugins/which_key.lua +++ b/.config/nvim/lua/plugins/whichkey.lua @@ -1,8 +1,8 @@ --- Useful plugin to show you pending keybinds. -return { - "folke/which-key.nvim", - event = "VimEnter", -- Sets the loading event to 'VimEnter' - opts = { +vim.pack.add({ "https://github.com/folke/which-key.nvim" }) + +local WK = require("which-key") + +WK.setup({ icons = { -- set icon mappings to true if you have a Nerd Font mappings = vim.g.have_nerd_font, @@ -49,5 +49,5 @@ return { { "w", group = "[W]orkspace" }, { "h", group = "Git [H]unk", mode = { "n", "v" } }, }, - }, -} + }) + diff --git a/.config/nvim/nvim-pack-lock.json b/.config/nvim/nvim-pack-lock.json new file mode 100644 index 0000000..fdb9245 --- /dev/null +++ b/.config/nvim/nvim-pack-lock.json @@ -0,0 +1,103 @@ +{ + "plugins": { + "LuaSnip": { + "rev": "5a1e39223db9a0498024a77b8441169d260c8c25", + "src": "https://github.com/L3MON4D3/LuaSnip", + "version": "'v2.4.1'" + }, + "aerial.nvim": { + "rev": "645d108a5242ec7b378cbe643eb6d04d4223f034", + "src": "https://github.com/stevearc/aerial.nvim" + }, + "auto-session": { + "rev": "62437532b38495551410b3f377bcf4aaac574ebe", + "src": "https://github.com/rmagatti/auto-session" + }, + "blink.cmp": { + "rev": "b650e976a927be6b46487a0a610b75af111376c5", + "src": "https://github.com/saghen/blink.cmp" + }, + "conform.nvim": { + "rev": "e969e302bced7ffb9a0a0323629f31feb0ca35a6", + "src": "https://github.com/stevearc/conform.nvim" + }, + "flash.nvim": { + "rev": "fcea7ff883235d9024dc41e638f164a450c14ca2", + "src": "https://github.com/folke/flash.nvim" + }, + "friendly-snippets": { + "rev": "6cd7280adead7f586db6fccbd15d2cac7e2188b9", + "src": "https://github.com/rafamadriz/friendly-snippets" + }, + "i18n.nvim": { + "rev": "128959499a9425bb4f1a5574fd92a23be00cb442", + "src": "https://github.com/yelog/i18n.nvim" + }, + "js-i18n.nvim": { + "rev": "124f22f91d51e85641ba10e9a32f3b858394c2dd", + "src": "https://github.com/nabekou29/js-i18n.nvim", + "version": "'v0.5.4'" + }, + "kanagawa.nvim": { + "rev": "aef7f5cec0a40dbe7f3304214850c472e2264b10", + "src": "https://github.com/rebelot/kanagawa.nvim" + }, + "lazydev.nvim": { + "rev": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d", + "src": "https://github.com/folke/lazydev.nvim" + }, + "lualine.nvim": { + "rev": "47f91c416daef12db467145e16bed5bbfe00add8", + "src": "https://github.com/nvim-lualine/lualine.nvim" + }, + "mason.nvim": { + "rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65", + "src": "https://github.com/mason-org/mason.nvim" + }, + "nord.nvim": { + "rev": "07647ad23e5b7fc1599a841dcd8f173b9aeb0419", + "src": "https://github.com/gbprod/nord.nvim" + }, + "nvim-autopairs": { + "rev": "59bce2eef357189c3305e25bc6dd2d138c1683f5", + "src": "https://github.com/windwp/nvim-autopairs" + }, + "nvim-lspconfig": { + "rev": "a40d22e75d951ad2fcf236ceb013d88f81d2cc9a", + "src": "https://github.com/neovim/nvim-lspconfig" + }, + "nvim-surround": { + "rev": "5553dd1fbb3559abb176a8227a12e8f1cab07e93", + "src": "https://github.com/kylechui/nvim-surround" + }, + "nvim-treesitter": { + "rev": "42fc28ba918343ebfd5565147a42a26580579482", + "src": "https://github.com/nvim-treesitter/nvim-treesitter", + "version": "'master'" + }, + "nvim-web-devicons": { + "rev": "737cf6c657898d0c697311d79d361288a1343d50", + "src": "https://github.com/nvim-tree/nvim-web-devicons" + }, + "plenary.nvim": { + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", + "src": "https://github.com/nvim-lua/plenary.nvim" + }, + "smear-cursor.nvim": { + "rev": "c85bdbb25db096fbcf616bc4e1357bd61fe2c199", + "src": "https://github.com/sphamba/smear-cursor.nvim" + }, + "snacks.nvim": { + "rev": "fe7cfe9800a182274d0f868a74b7263b8c0c020b", + "src": "https://github.com/folke/snacks.nvim" + }, + "tokyonight.nvim": { + "rev": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd", + "src": "https://github.com/folke/tokyonight.nvim" + }, + "which-key.nvim": { + "rev": "3aab2147e74890957785941f0c1ad87d0a44c15a", + "src": "https://github.com/folke/which-key.nvim" + } + } +} \ No newline at end of file diff --git a/.config/nvim/spell/en.utf-8.add b/.config/nvim/spell/en.utf-8.add deleted file mode 100644 index 5f452da..0000000 --- a/.config/nvim/spell/en.utf-8.add +++ /dev/null @@ -1,7 +0,0 @@ -neovim -stdpath -tmux -formik -TODO -Autoformat -CTRL diff --git a/.config/wezterm/wezterm.lua b/.config/wezterm/wezterm.lua index fbb82ae..5378219 100644 --- a/.config/wezterm/wezterm.lua +++ b/.config/wezterm/wezterm.lua @@ -6,7 +6,7 @@ local act = wezterm.action local config = wezterm.config_builder() -- For example, changing the color scheme: -config.color_scheme = "tokyonight_night" +config.color_scheme = "nord" config.alternate_buffer_wheel_scroll_speed = 10 -- Change mouse scroll amount config.mouse_bindings = { @@ -22,7 +22,7 @@ config.mouse_bindings = { }, } config.font = wezterm.font({ family = "Iosevka Nerd Font", weight = "Regular", style = "Italic" }) -config.font_size = 11 +config.font_size = 13 config.use_fancy_tab_bar = false config.hide_tab_bar_if_only_one_tab = true