diff options
| author | 2026-09-16 08:47:13 +0200 | |
|---|---|---|
| committer | 2026-09-16 08:47:13 +0200 | |
| commit | a5e8bbeb9d79d905a193e95a39acd29bc37e6c66 (patch) | |
| tree | 5b42d54e6b91d454bcbac89f7aac42b0863a869d /neovim/.config/nvim/lua/plugins | |
| parent | 6906a9d55928c6250ff106d041b73fdd1ac8aae6 (diff) | |
| download | dotfiles-a5e8bbeb9d79d905a193e95a39acd29bc37e6c66.tar.gz dotfiles-a5e8bbeb9d79d905a193e95a39acd29bc37e6c66.tar.bz2 dotfiles-a5e8bbeb9d79d905a193e95a39acd29bc37e6c66.zip | |
Updated dotfiles
Diffstat (limited to 'neovim/.config/nvim/lua/plugins')
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/claude-code.lua | 1 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/colorscheme.lua | 8 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/dap-python.lua | 71 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/dap.lua | 181 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/editing.lua | 10 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/fuzzyfinder.lua | 36 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/git.lua | 5 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/indent-detect.lua | 8 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/langs.lua | 14 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/overseer.lua | 57 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/statusline.lua | 24 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/toggleterm.lua | 18 | ||||
| -rw-r--r-- | neovim/.config/nvim/lua/plugins/which-key.lua | 17 |
13 files changed, 397 insertions, 53 deletions
diff --git a/neovim/.config/nvim/lua/plugins/claude-code.lua b/neovim/.config/nvim/lua/plugins/claude-code.lua index 0390852..b2e881f 100644 --- a/neovim/.config/nvim/lua/plugins/claude-code.lua +++ b/neovim/.config/nvim/lua/plugins/claude-code.lua | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | return { | 1 | return { |
| 2 | "greggh/claude-code.nvim", | 2 | "greggh/claude-code.nvim", |
| 3 | lazy = false, | ||
| 3 | dependencies = { "nvim-lua/plenary.nvim" }, | 4 | dependencies = { "nvim-lua/plenary.nvim" }, |
| 4 | cmd = { "ClaudeCode", "ClaudeCodeContinue", "ClaudeCodeResume", "ClaudeCodeVerbose" }, | 5 | cmd = { "ClaudeCode", "ClaudeCodeContinue", "ClaudeCodeResume", "ClaudeCodeVerbose" }, |
| 5 | config = function() | 6 | config = function() |
diff --git a/neovim/.config/nvim/lua/plugins/colorscheme.lua b/neovim/.config/nvim/lua/plugins/colorscheme.lua index 457dc71..0349cf9 100644 --- a/neovim/.config/nvim/lua/plugins/colorscheme.lua +++ b/neovim/.config/nvim/lua/plugins/colorscheme.lua | |||
| @@ -6,6 +6,14 @@ return { | |||
| 6 | local ok = pcall(vim.cmd.colorscheme, "janah") | 6 | local ok = pcall(vim.cmd.colorscheme, "janah") |
| 7 | if not ok then | 7 | if not ok then |
| 8 | vim.cmd.colorscheme("desert") | 8 | vim.cmd.colorscheme("desert") |
| 9 | return | ||
| 9 | end | 10 | end |
| 11 | |||
| 12 | -- vim-janah predates floating windows and never defines NormalFloat/ | ||
| 13 | -- FloatBorder, so they fall back to Neovim's near-black default and any | ||
| 14 | -- floating UI (:Mason, :Lazy, which-key's popup, ...) renders as a | ||
| 15 | -- mismatched black box. Match them to janah's own Normal/Comment colors. | ||
| 16 | vim.api.nvim_set_hl(0, "NormalFloat", { bg = "#262626", fg = "#dadada" }) | ||
| 17 | vim.api.nvim_set_hl(0, "FloatBorder", { bg = "#262626", fg = "#585858" }) | ||
| 10 | end, | 18 | end, |
| 11 | } | 19 | } |
diff --git a/neovim/.config/nvim/lua/plugins/dap-python.lua b/neovim/.config/nvim/lua/plugins/dap-python.lua new file mode 100644 index 0000000..b61e0f4 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/dap-python.lua | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | -- Python launch configs (nvim-dap-python), wired to the debugpy adapter | ||
| 2 | -- that mason-nvim-dap.nvim installs (dap.lua). Kept in its own file since | ||
| 3 | -- this is the "per-language" half of debugging, parallel to how | ||
| 4 | -- ftplugin/python.lua holds Python-only settings. | ||
| 5 | return { | ||
| 6 | "mfussenegger/nvim-dap-python", | ||
| 7 | -- Not left to lazy-load off `ft = "python"`: dap.lua's <leader>dc picker | ||
| 8 | -- works from any window (not just a Python buffer) and needs | ||
| 9 | -- dap.adapters.python already registered by the time a config is picked, | ||
| 10 | -- even if no .py buffer has been opened yet this session. | ||
| 11 | lazy = false, | ||
| 12 | -- mason.nvim is listed directly (not just transitively via dap.lua) | ||
| 13 | -- because config() below needs require("mason-registry") to be loadable | ||
| 14 | -- from startup, same reasoning as lazy = false above. | ||
| 15 | dependencies = { "mfussenegger/nvim-dap", "mason-org/mason.nvim" }, | ||
| 16 | config = function() | ||
| 17 | local registry = require("mason-registry") | ||
| 18 | local pkg = registry.get_package("debugpy") | ||
| 19 | |||
| 20 | -- debugpy_path is the interpreter that runs the debug *adapter* itself | ||
| 21 | -- (Mason's isolated venv) - it does not control which Python runs your | ||
| 22 | -- script. dap-python defaults that to the active venv/system python3; | ||
| 23 | -- project-specific venvs may need a manual `pythonPath` override in a | ||
| 24 | -- generated launch config later. | ||
| 25 | local debugpy_path = pkg:get_install_path() .. "/venv/bin/python" | ||
| 26 | |||
| 27 | local function setup() | ||
| 28 | require("dap-python").setup(debugpy_path) | ||
| 29 | |||
| 30 | -- nvim-dap-python doesn't expose adapter.options for tuning, and | ||
| 31 | -- nvim-dap's default terminate-request timeout (3s) is tight enough | ||
| 32 | -- that debugpy's real response can arrive just after nvim-dap already | ||
| 33 | -- gave up and moved on ("No callback found" in dap.log) - <leader>dt | ||
| 34 | -- still works, but dap.session() doesn't clear for a few extra | ||
| 35 | -- seconds, so <leader>dc right after can catch it still "active". | ||
| 36 | -- Wrap the adapter dap-python just registered to give it more room. | ||
| 37 | local dap = require("dap") | ||
| 38 | local base_adapter = dap.adapters.python | ||
| 39 | dap.adapters.python = function(cb, config) | ||
| 40 | base_adapter(function(adapter) | ||
| 41 | adapter.options = adapter.options or {} | ||
| 42 | adapter.options.disconnect_timeout_sec = 8 | ||
| 43 | cb(adapter) | ||
| 44 | end, config) | ||
| 45 | end | ||
| 46 | end | ||
| 47 | |||
| 48 | if pkg:is_installed() then | ||
| 49 | setup() | ||
| 50 | else | ||
| 51 | -- dap.lua's mason-nvim-dap ensure_installed triggers debugpy's | ||
| 52 | -- install, but that's async - on a fresh machine (or before it | ||
| 53 | -- finishes) debugpy_path doesn't exist on disk yet, and <leader>dc | ||
| 54 | -- would fail with a raw ENOENT from debugpy itself instead of a clear | ||
| 55 | -- message. Wire up the adapter once the install actually completes | ||
| 56 | -- instead of pointing it at a path that isn't there yet. | ||
| 57 | vim.notify( | ||
| 58 | "debugpy not installed yet - dap.lua's ensure_installed should be" | ||
| 59 | .. " installing it now (check :Mason); run :MasonInstall debugpy" | ||
| 60 | .. " if it doesn't show up there. Debugging will work once it's" | ||
| 61 | .. " done.", | ||
| 62 | vim.log.levels.WARN | ||
| 63 | ) | ||
| 64 | registry:on("package:install:success", function(installed_pkg) | ||
| 65 | if installed_pkg.name == "debugpy" then | ||
| 66 | setup() | ||
| 67 | end | ||
| 68 | end) | ||
| 69 | end | ||
| 70 | end, | ||
| 71 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/dap.lua b/neovim/.config/nvim/lua/plugins/dap.lua new file mode 100644 index 0000000..975eaea --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/dap.lua | |||
| @@ -0,0 +1,181 @@ | |||
| 1 | -- Debugging via nvim-dap. Adapter installs are bridged through Mason | ||
| 2 | -- (mason-nvim-dap.nvim), the same pattern lsp.lua uses for language servers, | ||
| 3 | -- so adding a debug adapter for another language later is just adding it to | ||
| 4 | -- ensure_installed here - Python specifics live in dap-python.lua, Node | ||
| 5 | -- specifics in lua/config/dap_node.lua. | ||
| 6 | return { | ||
| 7 | "mfussenegger/nvim-dap", | ||
| 8 | -- Not left to lazy-load off `keys`: a project's .nvim.lua (see | ||
| 9 | -- lua/config/project_run.lua) needs `require("dap")` to work immediately | ||
| 10 | -- when exrc sources it, which requires the plugin already being on | ||
| 11 | -- runtimepath rather than deferred until a <leader>d keymap fires. | ||
| 12 | lazy = false, | ||
| 13 | dependencies = { | ||
| 14 | { | ||
| 15 | "rcarriga/nvim-dap-ui", | ||
| 16 | dependencies = { "nvim-neotest/nvim-nio" }, | ||
| 17 | }, | ||
| 18 | "theHamsta/nvim-dap-virtual-text", | ||
| 19 | { | ||
| 20 | "jay-babu/mason-nvim-dap.nvim", | ||
| 21 | dependencies = { "mason-org/mason.nvim" }, | ||
| 22 | }, | ||
| 23 | }, | ||
| 24 | keys = { | ||
| 25 | { "<leader>db", function() require("dap").toggle_breakpoint() end, desc = "Toggle breakpoint" }, | ||
| 26 | { | ||
| 27 | "<leader>dB", | ||
| 28 | function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, | ||
| 29 | desc = "Conditional breakpoint", | ||
| 30 | }, | ||
| 31 | { | ||
| 32 | "<leader>dc", | ||
| 33 | function() | ||
| 34 | local dap = require("dap") | ||
| 35 | |||
| 36 | if dap.session() then | ||
| 37 | -- Existing session: resume past a breakpoint, or nvim-dap's | ||
| 38 | -- terminate/pause/restart prompt if active but not stopped. | ||
| 39 | -- This branch doesn't consult buffer filetype, so it's fine to | ||
| 40 | -- call from any window. | ||
| 41 | dap.continue() | ||
| 42 | return | ||
| 43 | end | ||
| 44 | |||
| 45 | -- No active session: pick a config to start. dap.continue()'s own | ||
| 46 | -- path for this (select_config_and_run) only offers | ||
| 47 | -- dap.configurations[<current buffer's filetype>], so calling it | ||
| 48 | -- from the task-output dock or some other non-source window finds | ||
| 49 | -- nothing. Flatten across every filetype instead - same as | ||
| 50 | -- <leader>rr does for run tasks - so this works from anywhere and | ||
| 51 | -- you just pick the config you want from the list. | ||
| 52 | local entries = {} | ||
| 53 | for filetype, configs in pairs(dap.configurations) do | ||
| 54 | for _, config in ipairs(configs) do | ||
| 55 | table.insert(entries, { config = config, filetype = filetype }) | ||
| 56 | end | ||
| 57 | end | ||
| 58 | |||
| 59 | -- .vscode/launch.json (if present in cwd) is read on-demand by | ||
| 60 | -- nvim-dap's own "dap.launch.json" provider - dap.ext.vscode's | ||
| 61 | -- load_launchjs() is deprecated now that this exists. That provider | ||
| 62 | -- is normally consulted inside dap.continue()'s own | ||
| 63 | -- select_config_and_run, which we're bypassing above, so call it | ||
| 64 | -- directly here to fold its configs into the same picker - the | ||
| 65 | -- debug-side counterpart to overseer's tasks.json support (README's | ||
| 66 | -- Run configurations section). Pair a launch.json entry with a | ||
| 67 | -- same-named tasks.json entry for PyCharm-style "run or debug the | ||
| 68 | -- same thing". | ||
| 69 | local ok, launchjson_configs = pcall(dap.providers.configs["dap.launch.json"]) | ||
| 70 | if ok then | ||
| 71 | for _, config in ipairs(launchjson_configs) do | ||
| 72 | table.insert(entries, { config = config, filetype = config.type }) | ||
| 73 | end | ||
| 74 | end | ||
| 75 | |||
| 76 | if vim.tbl_isempty(entries) then | ||
| 77 | vim.notify("No debug configurations registered (see project_run.lua)", vim.log.levels.WARN) | ||
| 78 | return | ||
| 79 | end | ||
| 80 | |||
| 81 | vim.ui.select(entries, { | ||
| 82 | prompt = "Configuration: ", | ||
| 83 | format_item = function(e) return e.config.name end, | ||
| 84 | }, function(entry) | ||
| 85 | if entry then | ||
| 86 | -- Pass along the filetype the config was registered under (not | ||
| 87 | -- necessarily the invoking buffer's) so breakpoint-hit window | ||
| 88 | -- jumping still picks a sensible window. | ||
| 89 | dap.run(entry.config, { filetype = entry.filetype }) | ||
| 90 | end | ||
| 91 | end) | ||
| 92 | end, | ||
| 93 | desc = "Continue / start debugging", | ||
| 94 | }, | ||
| 95 | { "<leader>do", function() require("dap").step_over() end, desc = "Step over" }, | ||
| 96 | { "<leader>di", function() require("dap").step_into() end, desc = "Step into" }, | ||
| 97 | { "<leader>dO", function() require("dap").step_out() end, desc = "Step out" }, | ||
| 98 | { "<leader>dt", function() require("dap").terminate() end, desc = "Terminate session" }, | ||
| 99 | { "<leader>dr", function() require("dap").repl.toggle() end, desc = "Toggle REPL" }, | ||
| 100 | { "<leader>du", function() require("dapui").toggle() end, desc = "Toggle debug UI" }, | ||
| 101 | }, | ||
| 102 | config = function() | ||
| 103 | require("dapui").setup() | ||
| 104 | require("nvim-dap-virtual-text").setup() | ||
| 105 | |||
| 106 | -- nvim-dap doesn't define these signs itself - it just places them | ||
| 107 | -- (breakpoints.lua, session.lua's DapStopped placement) and expects the | ||
| 108 | -- config to have already called sign_define, so without this nothing | ||
| 109 | -- renders: no breakpoint marker in the sign column, and no indication | ||
| 110 | -- of the current line when a session stops (the stop itself still | ||
| 111 | -- works, sign_place just errors silently into a pcall). | ||
| 112 | vim.fn.sign_define("DapBreakpoint", { text = "●", texthl = "DiagnosticError" }) | ||
| 113 | vim.fn.sign_define("DapBreakpointCondition", { text = "◆", texthl = "DiagnosticWarn" }) | ||
| 114 | vim.fn.sign_define("DapBreakpointRejected", { text = "✗", texthl = "DiagnosticError" }) | ||
| 115 | vim.fn.sign_define("DapLogPoint", { text = "📝", texthl = "DiagnosticInfo" }) | ||
| 116 | vim.fn.sign_define("DapStopped", { text = "▶", texthl = "DiagnosticWarn", linehl = "DapStoppedLine" }) | ||
| 117 | -- default = true so a colorscheme (or later config) can override this | ||
| 118 | -- without a load-order fight; Visual is just a visible fallback. | ||
| 119 | vim.api.nvim_set_hl(0, "DapStoppedLine", { default = true, link = "Visual" }) | ||
| 120 | |||
| 121 | -- handlers = {} opts out of mason-nvim-dap's automatic adapter | ||
| 122 | -- registration: nvim-dap-python (dap-python.lua) registers its own | ||
| 123 | -- "python" adapter/config, so we don't want a second one clobbering it. | ||
| 124 | -- Adding a language without its own dap-<lang>.lua later should drop | ||
| 125 | -- this override so its adapter gets auto-registered instead. | ||
| 126 | require("mason-nvim-dap").setup({ | ||
| 127 | -- ensure_installed wants nvim-dap *adapter/source* names, not Mason | ||
| 128 | -- *package* names - mason-nvim-dap looks each entry up in its own | ||
| 129 | -- name -> package mapping (source.lua: python -> debugpy) and just | ||
| 130 | -- silently skips anything it doesn't recognize, no error/log. Passing | ||
| 131 | -- "debugpy" here (the package name) matched nothing, so it never | ||
| 132 | -- triggered an install at all. | ||
| 133 | ensure_installed = { "python", "js" }, | ||
| 134 | automatic_installation = true, | ||
| 135 | handlers = {}, | ||
| 136 | }) | ||
| 137 | |||
| 138 | -- Node/JS/TS adapter + default configs - not left to mason-nvim-dap's | ||
| 139 | -- own handler since "js" has no default adapter mapping there (only the | ||
| 140 | -- deprecated node2 does), see lua/config/dap_node.lua for why. | ||
| 141 | require("config.dap_node").setup() | ||
| 142 | |||
| 143 | local dap, dapui = require("dap"), require("dapui") | ||
| 144 | |||
| 145 | -- nvim-dap jumps to the stopped line using Neovim's 'switchbuf' option, | ||
| 146 | -- which defaults to "uselast": reuse the current window if it's already | ||
| 147 | -- a plain/source buffer, else fall back to the alternate window - and | ||
| 148 | -- if neither applies (e.g. <leader>dc was started from the task-output | ||
| 149 | -- dock or some other non-source window, which the picker now allows), | ||
| 150 | -- it silently does nothing. No error, no jump - the session *is* | ||
| 151 | -- stopped (stepping/continuing still works), it just never shows where. | ||
| 152 | -- Append "vsplit" so there's always a guaranteed-successful last resort | ||
| 153 | -- that opens the source file if nothing else matched. | ||
| 154 | dap.defaults.fallback.switchbuf = "usevisible,useopen,uselast,vsplit" | ||
| 155 | |||
| 156 | -- Open/close dap-ui automatically around a debug session, so <leader>du | ||
| 157 | -- is only needed to bring it back after manually closing it mid-session. | ||
| 158 | dap.listeners.after.event_initialized["dapui_config"] = function() | ||
| 159 | dapui.open() | ||
| 160 | end | ||
| 161 | dap.listeners.before.event_terminated["dapui_config"] = function() | ||
| 162 | dapui.close() | ||
| 163 | end | ||
| 164 | dap.listeners.before.event_exited["dapui_config"] = function() | ||
| 165 | dapui.close() | ||
| 166 | end | ||
| 167 | |||
| 168 | -- These events arrive asynchronously over debugpy's socket (a libuv | ||
| 169 | -- callback, not a keypress), and nvim-dap updates its state - cursor | ||
| 170 | -- position, signs, dapui panels - without that alone forcing Neovim to | ||
| 171 | -- repaint. So hitting a breakpoint, continuing past one, or a session | ||
| 172 | -- ending can all silently not *look* like anything happened until the | ||
| 173 | -- next keystroke forces a redraw that reveals the already-current | ||
| 174 | -- state (e.g. <leader>dc appearing to need pressing twice to resume). | ||
| 175 | for _, event in ipairs({ "event_stopped", "event_continued", "event_terminated", "event_exited" }) do | ||
| 176 | dap.listeners.after[event]["dap_redraw"] = function() | ||
| 177 | vim.cmd("redraw") | ||
| 178 | end | ||
| 179 | end | ||
| 180 | end, | ||
| 181 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/editing.lua b/neovim/.config/nvim/lua/plugins/editing.lua index c1d5567..62b1dbf 100644 --- a/neovim/.config/nvim/lua/plugins/editing.lua +++ b/neovim/.config/nvim/lua/plugins/editing.lua | |||
| @@ -1,13 +1,3 @@ | |||
| 1 | return { | 1 | return { |
| 2 | { | ||
| 3 | "preservim/nerdcommenter", | ||
| 4 | init = function() | ||
| 5 | vim.g.NERDSpaceDelims = 1 | ||
| 6 | vim.g.NERDCompactSexyComs = 1 | ||
| 7 | vim.g.NERDDefaultAlign = "left" | ||
| 8 | vim.g.NERDCommentEmptyLines = 1 | ||
| 9 | vim.g.NERDTrimTrailingWhitespace = 1 | ||
| 10 | end, | ||
| 11 | }, | ||
| 12 | "unblevable/quick-scope", | 2 | "unblevable/quick-scope", |
| 13 | } | 3 | } |
diff --git a/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua b/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua index 444d9ff..2ed9970 100644 --- a/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua +++ b/neovim/.config/nvim/lua/plugins/fuzzyfinder.lua | |||
| @@ -1,10 +1,32 @@ | |||
| 1 | return { | 1 | return { |
| 2 | "ctrlpvim/ctrlp.vim", | 2 | "nvim-telescope/telescope.nvim", |
| 3 | init = function() | 3 | -- Not left to lazy-load off `keys`: telescope-ui-select's vim.ui.select() |
| 4 | -- Use ripgrep for listing files (fast, respects .gitignore) | 4 | -- override (below) needs to be installed from startup, otherwise |
| 5 | if vim.fn.executable("rg") == 1 then | 5 | -- overseer's <leader>rr / nvim-dap-python's <leader>dc pickers fall back |
| 6 | vim.g.ctrlp_user_command = 'rg %s --files --color=never --glob ""' | 6 | -- to Neovim's default list until something (e.g. <C-p>) happens to |
| 7 | vim.g.ctrlp_use_caching = 0 | 7 | -- trigger telescope's own lazy-load first. |
| 8 | end | 8 | lazy = false, |
| 9 | dependencies = { | ||
| 10 | "nvim-lua/plenary.nvim", | ||
| 11 | "nvim-telescope/telescope-ui-select.nvim", | ||
| 12 | }, | ||
| 13 | keys = { | ||
| 14 | { "<C-p>", "<cmd>Telescope find_files<cr>" }, | ||
| 15 | { "<leader>fg", "<cmd>Telescope live_grep<cr>" }, | ||
| 16 | { "<leader>fb", "<cmd>Telescope buffers<cr>" }, | ||
| 17 | }, | ||
| 18 | config = function() | ||
| 19 | -- telescope-ui-select makes vim.ui.select() - overseer's <leader>rr | ||
| 20 | -- template picker, nvim-dap-python's launch-config picker, LSP code | ||
| 21 | -- actions, etc. - a scrollable/fuzzy-searchable Telescope window | ||
| 22 | -- instead of Neovim's default numbered-list-in-the-cmdline prompt. | ||
| 23 | require("telescope").setup({ | ||
| 24 | extensions = { | ||
| 25 | ["ui-select"] = { | ||
| 26 | require("telescope.themes").get_dropdown({}), | ||
| 27 | }, | ||
| 28 | }, | ||
| 29 | }) | ||
| 30 | require("telescope").load_extension("ui-select") | ||
| 9 | end, | 31 | end, |
| 10 | } | 32 | } |
diff --git a/neovim/.config/nvim/lua/plugins/git.lua b/neovim/.config/nvim/lua/plugins/git.lua index 8402905..ef07442 100644 --- a/neovim/.config/nvim/lua/plugins/git.lua +++ b/neovim/.config/nvim/lua/plugins/git.lua | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | return { | 1 | return { |
| 2 | "tpope/vim-fugitive", | 2 | "tpope/vim-fugitive", |
| 3 | "mhinz/vim-signify", | 3 | { |
| 4 | "lewis6991/gitsigns.nvim", | ||
| 5 | opts = {}, | ||
| 6 | }, | ||
| 4 | } | 7 | } |
diff --git a/neovim/.config/nvim/lua/plugins/indent-detect.lua b/neovim/.config/nvim/lua/plugins/indent-detect.lua new file mode 100644 index 0000000..945769c --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/indent-detect.lua | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | -- Detects each buffer's actual indentation/spacing on open and sets | ||
| 2 | -- shiftwidth/tabstop/expandtab to match, rather than relying solely on | ||
| 3 | -- ftplugin defaults (e.g. ftplugin/python.lua) or global options.opt. | ||
| 4 | return { | ||
| 5 | "nmac427/guess-indent.nvim", | ||
| 6 | event = { "BufReadPost", "BufNewFile" }, | ||
| 7 | opts = {}, | ||
| 8 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/langs.lua b/neovim/.config/nvim/lua/plugins/langs.lua deleted file mode 100644 index 7bf22d4..0000000 --- a/neovim/.config/nvim/lua/plugins/langs.lua +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | return { | ||
| 2 | { | ||
| 3 | "chase/vim-ansible-yaml", | ||
| 4 | cond = function() | ||
| 5 | return vim.fn.executable("ansible") == 1 | ||
| 6 | end, | ||
| 7 | }, | ||
| 8 | { | ||
| 9 | "hashivim/vim-terraform", | ||
| 10 | cond = function() | ||
| 11 | return vim.fn.executable("terraform") == 1 | ||
| 12 | end, | ||
| 13 | }, | ||
| 14 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/overseer.lua b/neovim/.config/nvim/lua/plugins/overseer.lua new file mode 100644 index 0000000..99d0f5f --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/overseer.lua | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | -- Run configurations (PyCharm-style "run this again"), language-agnostic: | ||
| 2 | -- works for npm scripts, make, cargo, arbitrary shell commands, python | ||
| 3 | -- scripts, etc, unlike DAP which is Python-only for now. | ||
| 4 | return { | ||
| 5 | "stevearc/overseer.nvim", | ||
| 6 | -- Not left to lazy-load off `cmd`/`keys`: a project's .nvim.lua (see | ||
| 7 | -- lua/config/project_run.lua) needs `require("overseer")` to work | ||
| 8 | -- immediately when exrc sources it, which requires the plugin already | ||
| 9 | -- being on runtimepath rather than deferred until first use. | ||
| 10 | lazy = false, | ||
| 11 | keys = { | ||
| 12 | { "<leader>rr", "<cmd>OverseerRun<cr>", desc = "Run task" }, | ||
| 13 | { | ||
| 14 | "<leader>rl", | ||
| 15 | function() | ||
| 16 | -- :OverseerRestartLast exists in current overseer.nvim versions; the | ||
| 17 | -- run_action fallback covers older/newer versions that lack it | ||
| 18 | -- rather than hard-failing the keymap. | ||
| 19 | if vim.fn.exists(":OverseerRestartLast") == 2 then | ||
| 20 | vim.cmd("OverseerRestartLast") | ||
| 21 | return | ||
| 22 | end | ||
| 23 | local overseer = require("overseer") | ||
| 24 | local tasks = overseer.list_tasks({ recent_first = true }) | ||
| 25 | if vim.tbl_isempty(tasks) then | ||
| 26 | vim.notify("No previous task to rerun", vim.log.levels.WARN) | ||
| 27 | else | ||
| 28 | overseer.run_action(tasks[1], "restart") | ||
| 29 | end | ||
| 30 | end, | ||
| 31 | desc = "Rerun last task", | ||
| 32 | }, | ||
| 33 | { "<leader>ro", "<cmd>OverseerToggle<cr>", desc = "Toggle task list/output" }, | ||
| 34 | { "<leader>rq", "<cmd>OverseerQuickAction<cr>", desc = "Quick action on task" }, | ||
| 35 | }, | ||
| 36 | opts = { | ||
| 37 | -- Patches nvim-dap so a debug config can set preLaunchTask/postDebugTask | ||
| 38 | -- to an overseer task name (or "${defaultBuildTask}" for whatever task | ||
| 39 | -- is tagged BUILD) - lets a dap.configurations entry build before it | ||
| 40 | -- launches the debugger. See README's Debugging section. | ||
| 41 | dap = true, | ||
| 42 | -- overseer's actual default components (on_exit_set_status, | ||
| 43 | -- on_complete_notify, on_complete_dispose) don't open the output panel | ||
| 44 | -- on their own - without open_output added here, starting any task | ||
| 45 | -- (whether from a template, .nvim.lua/project_run.lua, or auto-detected | ||
| 46 | -- npm/make scripts) runs silently until you manually <leader>ro to look. | ||
| 47 | -- Adding it here applies to every task, not just custom ones. | ||
| 48 | component_aliases = { | ||
| 49 | default = { | ||
| 50 | "on_exit_set_status", | ||
| 51 | "on_complete_notify", | ||
| 52 | { "on_complete_dispose", require_view = { "SUCCESS", "FAILURE" } }, | ||
| 53 | { "open_output", direction = "dock", focus = false, on_start = "always" }, | ||
| 54 | }, | ||
| 55 | }, | ||
| 56 | }, | ||
| 57 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/statusline.lua b/neovim/.config/nvim/lua/plugins/statusline.lua index b93b34c..17741a6 100644 --- a/neovim/.config/nvim/lua/plugins/statusline.lua +++ b/neovim/.config/nvim/lua/plugins/statusline.lua | |||
| @@ -1,23 +1,5 @@ | |||
| 1 | return { | 1 | return { |
| 2 | "bling/vim-airline", | 2 | "nvim-lualine/lualine.nvim", |
| 3 | lazy = false, | 3 | dependencies = { "nvim-tree/nvim-web-devicons" }, |
| 4 | dependencies = { | 4 | opts = {}, |
| 5 | "vim-airline/vim-airline-themes", | ||
| 6 | "edkolev/tmuxline.vim", | ||
| 7 | }, | ||
| 8 | init = function() | ||
| 9 | -- On arch linux install the following: | ||
| 10 | -- otf-powerline-symbols-git | ||
| 11 | -- powerline-fonts-git | ||
| 12 | vim.g.airline_powerline_fonts = 1 | ||
| 13 | vim.g["airline#extensions#tabline#enabled"] = 1 | ||
| 14 | |||
| 15 | -- vim.g dict reads return a copy, not a live reference, so the nested | ||
| 16 | -- field has to be set via a local table and reassigned. | ||
| 17 | local symbols = vim.g.airline_symbols or {} | ||
| 18 | symbols.space = "\u{a0}" | ||
| 19 | vim.g.airline_symbols = symbols | ||
| 20 | |||
| 21 | vim.opt.laststatus = 2 | ||
| 22 | end, | ||
| 23 | } | 5 | } |
diff --git a/neovim/.config/nvim/lua/plugins/toggleterm.lua b/neovim/.config/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..b8067a3 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/toggleterm.lua | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | -- Scratch terminal for running arbitrary shell commands, toggled like | ||
| 2 | -- claude-code.nvim's own <C-,> - open/close (not kill) a persistent split. | ||
| 3 | return { | ||
| 4 | "akinsho/toggleterm.nvim", | ||
| 5 | lazy = false, -- global <C-.> toggle must work from any window, not just after some trigger event | ||
| 6 | opts = { | ||
| 7 | open_mapping = [[<C-.>]], -- registers n, t (terminal_mappings) and i (insert_mappings) mode maps automatically | ||
| 8 | direction = "vertical", | ||
| 9 | -- toggleterm's vertical direction always opens via "botright vsplit" internally, | ||
| 10 | -- so this already matches claude-code.nvim's right-side placement without | ||
| 11 | -- touching 'splitright'. | ||
| 12 | size = function(term) | ||
| 13 | if term.direction == "vertical" then | ||
| 14 | return math.floor(vim.o.columns * 0.3) -- matches claude-code.nvim's window.position ratio | ||
| 15 | end | ||
| 16 | end, | ||
| 17 | }, | ||
| 18 | } | ||
diff --git a/neovim/.config/nvim/lua/plugins/which-key.lua b/neovim/.config/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..190d651 --- /dev/null +++ b/neovim/.config/nvim/lua/plugins/which-key.lua | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | -- Popup showing available keymaps/groups as you type a prefix like | ||
| 2 | -- <leader>d or <leader>r, so the debug/run namespaces stay discoverable | ||
| 3 | -- without memorizing every letter. Auto-discovers each keymap's own `desc` | ||
| 4 | -- field from dap.lua/overseer.lua/etc - only the group headers need | ||
| 5 | -- registering here. | ||
| 6 | return { | ||
| 7 | "folke/which-key.nvim", | ||
| 8 | event = "VeryLazy", | ||
| 9 | opts = { | ||
| 10 | spec = { | ||
| 11 | { "<leader>d", group = "Debug", icon = "🐞" }, | ||
| 12 | { "<leader>r", group = "Run", icon = "▶" }, | ||
| 13 | { "<leader>f", group = "Find" }, | ||
| 14 | { "<leader>e", group = "Explorer" }, | ||
| 15 | }, | ||
| 16 | }, | ||
| 17 | } | ||
