diff --git a/docs/core/crash-course.md b/docs/core/crash-course.md index b3df4cd..863051d 100644 --- a/docs/core/crash-course.md +++ b/docs/core/crash-course.md @@ -565,7 +565,7 @@ browser-style single-file tab. **Tip:** Renaming or moving a Java file via `r` / `m` triggers LSP file operations — JDTLS automatically updates all imports and references across the project. This may modify many buffers at once. Save them all with `:wall`. -**Preview tip:** `P` uses Neo-tree's native preview mode, so you can scan files without leaving the tree. Press `` to close the preview. +**Preview tip:** `P` uses Neo-tree's native preview mode, so you can scan files without leaving the tree. Press `` to close Neo-tree. --- @@ -728,7 +728,7 @@ After `gd`, `gR`, `gy`, or `gI`, Glance opens a results list with a file preview | `` / `` | Scroll preview up / down | | `` | Jump to selected result | | `v` / `s` / `t` | Open in vsplit / split / new tab | -| `o` | Refresh preview | +| `o` | Preview selected location | | `l` | Switch between list and preview | | `q` / `Q` / `` | Close Glance | @@ -795,26 +795,29 @@ After `gd`, `gR`, `gy`, or `gI`, Glance opens a results list with a file preview ## Debugging -| Key | Action | -|--------------|----------------------------| -| `db` | Toggle breakpoint | -| `dB` | Breakpoint with condition | -| `dc` | Continue / Start debugging | -| `dC` | Run to cursor | -| `di` | Step into | -| `do` | Step out | -| `dO` | Step over | -| `dg` | Go to line (no execute) | -| `dl` | Run last | -| `dp` | Pause | -| `dr` | Toggle REPL | -| `dt` | Terminate | -| `ds` | Session info | -| `dj` | Up (call stack) | -| `dk` | Down (call stack) | -| `dw` | Hover widgets | -| `du` | Toggle DAP UI | -| `de` | Evaluate expression | +| Key | Action | +|---------------|----------------------------| +| `db` | Toggle breakpoint | +| `dB` | Breakpoint with condition | +| `dc` | Continue / Start debugging | +| `dC` | Run to cursor | +| `di` | Step into | +| `do` | Step out | +| `dO` | Step over | +| `dg` | Go to line (no execute) | +| `dl` | Run last | +| `dp` | Pause | +| `dr` | Toggle REPL | +| `dt` | Terminate | +| `ds` | Session info | +| `dj` | Down (call stack) | +| `dk` | Up (call stack) | +| `dw` | Hover widgets | +| `du` | Toggle DAP UI | +| `dU` | Toggle DAP UI keep-open | +| `de` | Evaluate expression | +| `dgt` | Debug Go test | +| `dgl` | Debug last Go test | --- @@ -825,27 +828,34 @@ After `gd`, `gR`, `gy`, or `gI`, Glance opens a results list with a file preview | `tt` | Run file | | `tT` | Run all test files | | `tr` | Run nearest test | +| `td` | Debug nearest test | | `tp` | Run package | +| `tP` | Debug package | | `tq` | Run file tests sequentially | | `tl` | Run last | +| `tL` | Debug last | +| `tf` | Debug file | +| `tD` | Debug all test files | +| `ta` | Attach to running test | | `tF` | Run failed tests | | `ts` | Toggle summary | | `to` | Show output | | `tO` | Toggle output panel | +| `tc` | Clear output panel | | `tS` | Stop (interactive) | | `tw` | Toggle watch | ### Java-specific -| Key | Action | -|--------------|---------------------| -| `jr` | Run Main | -| `ji` | Init Project | -| `ju` | Update Project | -| `jc` | Stop Main | -| `jt` | Test Current Class | -| `jm` | Test Current Method | -| `jv` | View Test Report | +| Key | Action | +|--------------|--------------------| +| `jr` | Run Main | +| `jd` | Debug Main | +| `ji` | Init Project | +| `ju` | Update Project | +| `jc` | Stop Main | +| `jl` | Toggle Runner Logs | +| `ja` | Attach Remote JVM | `:JavaInitProject [dir]` prompts for Maven/Gradle, project directory, artifact, group id, and package, then opens the generated `Main.java`. @@ -918,7 +928,7 @@ require('util.java_debug').debug_main() -- Debug main | "Port already in use" | Stale session — close nvim or `killall java` | | Breakpoints not hitting | Check `:LspInfo` for compilation errors, or check logs: `tail -f ~/.local/state/nvim/nvim-java.log` | -**See also:** `~/.config/nvim/JAVA_DEBUGGING.md` for complete reference. +**See also:** `docs/java/java-debugging.md` for complete reference. --- @@ -970,6 +980,7 @@ Notes: | `GC` | Find committed conflict markers | | `GQ` | Finish `git mergetool` | | `GA` | Abort `git mergetool` | +| `Gb` | Diff vs branch/ref | | `Gm` | Diff vs main/master | | `GM` | Diff vs origin/main | | `Gq` | Close Diffview | diff --git a/docs/core/plugin-map.md b/docs/core/plugin-map.md index 013ac9d..f9526f4 100644 --- a/docs/core/plugin-map.md +++ b/docs/core/plugin-map.md @@ -285,7 +285,7 @@ editor.lua │ Maven/Gradle source roots when available │ ├── neo-tree.nvim ── file explorer (e cwd, E root) - │ ├── native preview mode ── `P` float preview, `l` focus, ``/`` scroll + │ ├── native preview mode ── `P` float preview, `l` focus, ``/`` scroll │ ├── nvim-window-picker ── `s` in tree = pick window to open file in │ ├── open mappings reveal current file by default; `ue` toggles that session-local behavior │ ├── `Y` copies absolute path with unnamed-register fallback when clipboard is unavailable @@ -366,6 +366,7 @@ git.lua | `GC` | Find committed conflict markers | | `GQ` | Finish `git mergetool` | | `GA` | Abort `git mergetool` | +| `Gb` | Diff vs branch/ref | | `Gm` | Diff vs main/master | | `GM` | Diff vs origin/main | | `Gq` | Close Diffview | @@ -389,7 +390,9 @@ dap.lua Java DAP is provided by nvim-java (java_debug_adapter = true) ``` -**DAP keymaps** (`d*`): b/B breakpoint, c continue, i step-into, O step-over, o step-out, r REPL, u UI, U keep UI open on exit, e eval, t terminate +**DAP keymaps** (`d*`): b/B breakpoint, c continue, C run-to-cursor, g goto line without executing, i step-into, j down stack frame, k up stack +frame, l run last, O step-over, o step-out, p pause, r REPL, s session, t terminate, w widgets, u UI, U keep UI open on exit, e eval, gt debug Go test, gl +debug last Go test --- @@ -399,14 +402,14 @@ Java DAP is provided by nvim-java (java_debug_adapter = true) neotest.lua neotest ├── neotest-java ── Maven/Gradle test runner - ├── neotest-go ── Go test runner + ├── neotest-golang ── Go test runner └── neotest-python ── Python test runner util/neotest_scope.lua ── scoped discovery + file/package target helpers ``` -**Neotest keymaps** (`t*`): tt run file, tT run all, tr nearest, tp run package, tq run file tests sequentially, tl last, tF run failed, ts summary, to -output, tO output panel, tS stop (interactive -picker), tw watch +**Neotest keymaps** (`t*`): tt run file, tT run all, tr nearest, td debug nearest, tp run package, tP debug package, tq run file tests sequentially, +tl last, tL debug last, tf debug file, tD debug all, ta attach, tF run failed, ts summary, to output, tO output panel, tc clear output panel, tS stop +(interactive), tw watch --- @@ -432,11 +435,10 @@ util/java_project_config.lua lsp.lua excludes jdtls from mason-lspconfig (nvim-java owns it) vim.g.lspconfig_jdtls_enabled = false (options.lua) -JVM: -Xms1g / -Xmx4g (prevents OOM on refactoring) +JVM: -Xms2G / -Xmx8G (prevents OOM on refactoring) ``` -**Java keymaps** (`j*`): ji init project, ju update project, jr run main, jd debug main, jc stop, jl logs, ja attach remote, jt test class, jm test -method, jv view report +**Java keymaps** (`j*`): ji init project, ju update project, jr run main, jd debug main, jc stop, jl logs, ja attach remote --- @@ -538,9 +540,9 @@ leetcode.lua ├── MunifTanjim/nui.nvim └── nvim-tree/nvim-web-devicons Keymaps: Ll menu, Lr run, Ls submit, - Ld daily, Ln random, Lt tabs, - Lp topic picker, LR DSA roadmap, - LU update cookies + Ld daily, Ln random, Lc console, + Li info, Lt tabs, Le/Lm/Lh + difficulty lists, LR DSA roadmap, LU update cookies ``` --- @@ -613,7 +615,7 @@ undotree.lua undotree ── visual undo history tree → U marks.lua - marks.nvim ── persistent marks with guttersigns, ]' / [' nav + marks.nvim ── persistent marks with guttersigns, m] / m[ nav auto-save.lua auto-save.nvim ── auto-save enabled by default (ua toggle) @@ -695,7 +697,7 @@ lazy.nvim ├── TESTING │ └── neotest │ ├── neotest-java -│ ├── neotest-go +│ ├── neotest-golang │ └── neotest-python │ ├── LEETCODE diff --git a/docs/core/prepequisites.md b/docs/core/prepequisites.md index 48a8ba8..cd0bc3a 100644 --- a/docs/core/prepequisites.md +++ b/docs/core/prepequisites.md @@ -236,7 +236,7 @@ On Neovim 0.12+, run inside Neovim instead: :GoInstallDeps ``` -Installs: `gomodifytags`, `iferr` — used by gopher.nvim for struct tag generation and `if err != nil` snippets. +Installs: `gomodifytags`, `iferr`, `impl`, `gotests`, and `json2go` for gopher.nvim helpers. --- diff --git a/docs/core/session-context.md b/docs/core/session-context.md index 839facc..463ba68 100644 --- a/docs/core/session-context.md +++ b/docs/core/session-context.md @@ -51,6 +51,8 @@ Update this file when: runtime `PATH` values. - `timeoutlen` is intentionally set to `500` to make leader sequences less timing-sensitive with the heavy `` workflow. +- `smoothscroll` is enabled for smoother wrapped-line scrolling on supported + Neovim versions. - Mouse support is disabled by default (`mouse=`) and can be toggled with `um` for temporary GUI/terminal mouse use. - Plain `j/k` are remapped in [lua/config/keymaps.lua](/home/konkov/.config/nvim/lua/config/keymaps.lua:61). @@ -253,7 +255,9 @@ Update this file when: (`E:`, `W:`, `I:`, `H:`, `+`, `~`, `-`) so they remain visible without depending on icon fonts or a specific theme. - Lualine Java status intentionally stays a minimal colored `●`: green for - attached/idle JDTLS, yellow when LSP status is busy, red when unavailable. + attached/idle JDTLS, yellow when Neovim reports recent LSP progress, red when + unavailable. The yellow state is based on `vim.lsp.status()`, so it is a + global LSP progress signal rather than a JDTLS-only busy check. - `nvim-notify` background is derived from the active float/normal highlights via the local `NotifyBackground` refresh hook instead of a TokyoNight-specific hex color, so fade animations and popup contrast survive theme switches. @@ -396,12 +400,10 @@ Update this file when: handled, so renamed variables do not leave stale inlay hints behind. - Inline diagnostics are provided by `tiny-inline-diagnostic.nvim`, enabled on LSP attach, and toggled with `ud`. -- LSP inlay hints render at end-of-line through `nvim-lsp-endhints` instead of - Neovim's native inline positions. This avoids inline hint text colliding with - renamed/edited variables while preserving the normal `vim.lsp.inlay_hint` - enable/disable API and the local `uh` toggle. `nvim-lsp-endhints` is - loaded as a `nvim-lspconfig` dependency so its handler override is installed - before `LspAttach` enables hints. +- LSP inlay hints are managed by + [lua/util/inlay_hints.lua](/home/konkov/.config/nvim/lua/util/inlay_hints.lua:1) + through Neovim's native `vim.lsp.inlay_hint` API and toggled with + `uh`. - Noice is allowed to own command/message UI, but hover/signature rendering is intentionally disabled there to avoid conflicts with the chosen editing setup. - `` and `Hy` open Yanky's Telescope `yank_history` picker through diff --git a/docs/plans/live-hunks-view-plan.md b/docs/plans/live-hunks-view-plan.md index aa4a653..936c545 100644 --- a/docs/plans/live-hunks-view-plan.md +++ b/docs/plans/live-hunks-view-plan.md @@ -55,7 +55,7 @@ hunk-header parser. - `TextChanged` - `TextChangedI` - `BufWritePost` - - `User GitsignsUpdate` if available + - `User GitSignsUpdate` if available - `WinScrolled` - Keep a per-source-buffer state table: - source buffer diff --git a/lua/config/options.lua b/lua/config/options.lua index e69e79f..c763b47 100644 --- a/lua/config/options.lua +++ b/lua/config/options.lua @@ -45,7 +45,7 @@ opt.showmode = false opt.laststatus = 3 opt.fillchars = { eob = " " } --- Disable lspconfig jdtls (we use nvim-jdtls) +-- Disable lspconfig jdtls (we use nvim-java) vim.g.lspconfig_jdtls_enabled = false -- Better search diff --git a/lua/neotest-java/core/spec_builder/compiler/client_provider.lua b/lua/neotest-java/core/spec_builder/compiler/client_provider.lua index d99cc12..2fee326 100644 --- a/lua/neotest-java/core/spec_builder/compiler/client_provider.lua +++ b/lua/neotest-java/core/spec_builder/compiler/client_provider.lua @@ -6,6 +6,45 @@ local logger = require("neotest-java.logger") local function ClientProvider(deps) local client + local function normalize(path) + if not path or path == "" then + return nil + end + return vim.uv.fs_realpath(path) or vim.fs.normalize(path) + end + + local function path_has_prefix(path, prefix) + path = normalize(path) + prefix = normalize(prefix) + if not path or not prefix then + return false + end + if path == prefix then + return true + end + local with_sep = prefix:sub(-1) == "/" and prefix or (prefix .. "/") + return path:sub(1, #with_sep) == with_sep + end + + local function client_matches_cwd(lsp_client, cwd) + local root = lsp_client and lsp_client.config and lsp_client.config.root_dir + local cwd_string = cwd and cwd:to_string() + return lsp_client + and lsp_client.initialized + and root + and cwd_string + and (path_has_prefix(cwd_string, root) or path_has_prefix(root, cwd_string)) + end + + local function find_client_for_cwd(cwd) + for _, lsp_client in ipairs(deps.get_clients({ name = "jdtls" })) do + if client_matches_cwd(lsp_client, cwd) then + return lsp_client + end + end + return nil + end + local function find_any_java_file(dir) return Path( assert( @@ -37,14 +76,14 @@ local function ClientProvider(deps) return function(cwd) local started = deps.hrtime() - if client and client.initialized then + if client_matches_cwd(client, cwd) then logger.warn(("[timing] reused existing jdtls client in %.1f ms"):format((deps.hrtime() - started) / 1e6)) return client end - client = deps.get_clients({ name = "jdtls" })[1] - if client and client.initialized then - logger.warn(("[timing] found active jdtls client in %.1f ms"):format((deps.hrtime() - started) / 1e6)) + client = find_client_for_cwd(cwd) + if client then + logger.warn(("[timing] found matching jdtls client in %.1f ms"):format((deps.hrtime() - started) / 1e6)) return client end diff --git a/lua/plugins/auto-save.lua b/lua/plugins/auto-save.lua index cdc1662..242a207 100644 --- a/lua/plugins/auto-save.lua +++ b/lua/plugins/auto-save.lua @@ -7,7 +7,6 @@ return { version = "^1.0.0", cmd = "ASToggle", event = { "InsertLeave", "TextChanged" }, - notify_on_error_block = false, opts = { enabled = true, -- Start enabled, toggle with ua trigger_events = { diff --git a/lua/plugins/colorschemes.lua b/lua/plugins/colorschemes.lua index 7327000..159c242 100644 --- a/lua/plugins/colorschemes.lua +++ b/lua/plugins/colorschemes.lua @@ -25,7 +25,6 @@ return { { "rebelot/kanagawa.nvim", lazy = true, - priority = 1000, opts = { compile = false, undercurl = true, @@ -37,10 +36,6 @@ return { transparent = false, dimInactive = false, terminalColors = true, - colors = { - palette = {}, - theme = { wave = {}, lotus = {}, dragon = {}, all = {} }, - }, theme = "wave", background = { dark = "wave", @@ -53,7 +48,6 @@ return { { "nickkadutskyi/jb.nvim", lazy = true, - priority = 1000, opts = {}, }, @@ -61,14 +55,12 @@ return { { "nyoom-engineering/oxocarbon.nvim", lazy = true, - priority = 1000, }, -- Nordic { "AlexvZyl/nordic.nvim", lazy = true, - priority = 1000, opts = { cursorline = { bold = false, @@ -102,7 +94,6 @@ return { { "vague-theme/vague.nvim", lazy = true, - priority = 1000, opts = {}, }, @@ -110,7 +101,6 @@ return { { "rmehri01/onenord.nvim", lazy = true, - priority = 1000, opts = {}, }, @@ -119,7 +109,6 @@ return { "everviolet/nvim", name = "evergarden", lazy = true, - priority = 1000, opts = {}, }, @@ -127,7 +116,6 @@ return { { "olivercederborg/poimandres.nvim", lazy = true, - priority = 1000, opts = { disable_background = false, disable_float_background = false, diff --git a/lua/plugins/dap.lua b/lua/plugins/dap.lua index 2700dcb..1fb1fef 100644 --- a/lua/plugins/dap.lua +++ b/lua/plugins/dap.lua @@ -60,16 +60,16 @@ return { { "dj", function() - require("dap").up() + require("dap").down() end, - desc = "Up", + desc = "Down", }, { "dk", function() - require("dap").down() + require("dap").up() end, - desc = "Down", + desc = "Up", }, { "dl", @@ -138,7 +138,7 @@ return { { "dgl", function() - require("dap-go").debug_last() + require("dap-go").debug_last_test() end, desc = "Debug Last Go Test", }, @@ -147,10 +147,6 @@ return { local dap = require("dap") local dapui = require("dapui") - -- Setup dap-ui - dapui.setup() - vim.g.dapui_keep_open_on_exit = vim.g.dapui_keep_open_on_exit or false - local sensitive_dap_terms = { "secret", "api_key", @@ -216,6 +212,10 @@ return { { "rcarriga/nvim-dap-ui", dependencies = { "nvim-neotest/nvim-nio" }, + config = function() + require("dapui").setup() + vim.g.dapui_keep_open_on_exit = vim.g.dapui_keep_open_on_exit or false + end, keys = { { "du", diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index 2b77fcf..e4dde68 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -527,7 +527,17 @@ return { { "max397574/better-escape.nvim", event = "InsertEnter", - opts = {}, + opts = { + default_mappings = false, + mappings = { + i = { + j = { + k = "", + j = "", + }, + }, + }, + }, }, -- Lazygit diff --git a/lua/plugins/git.lua b/lua/plugins/git.lua index 3da0db1..b08368a 100644 --- a/lua/plugins/git.lua +++ b/lua/plugins/git.lua @@ -116,7 +116,7 @@ return { return "]h" end vim.schedule(function() - gs.next_hunk() + gs.nav_hunk("next") end) return "" end, { expr = true, desc = "Next hunk" }) @@ -126,7 +126,7 @@ return { return "[h" end vim.schedule(function() - gs.prev_hunk() + gs.nav_hunk("prev") end) return "" end, { expr = true, desc = "Prev hunk" }) diff --git a/lua/plugins/grug-far.lua b/lua/plugins/grug-far.lua index 93f8342..e8c17ea 100644 --- a/lua/plugins/grug-far.lua +++ b/lua/plugins/grug-far.lua @@ -41,7 +41,6 @@ return { }, }, opts = { - headerMaxWidth = 80, prefills = { flags = "--fixed-strings" }, }, config = function(_, opts) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index e724994..4ea3cbb 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -5,7 +5,7 @@ return { { "neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile" }, - cmd = { "LspInfo", "PyrightInfo", "PythonLspUsePyright", "PythonLspUseBasedPyright" }, + cmd = { "PyrightInfo", "PythonLspUsePyright", "PythonLspUseBasedPyright" }, dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", @@ -188,20 +188,19 @@ return { local capabilities = vim.tbl_deep_extend("force", require("cmp_nvim_lsp").default_capabilities(), require("lsp-file-operations").default_capabilities()) + vim.lsp.config("*", { + capabilities = capabilities, + }) local pyright_cmd = resolve_pyright_cmd() vim.lsp.config("pyright", { - capabilities = capabilities, cmd = pyright_cmd, }) vim.lsp.enable("pyright") - vim.lsp.config("basedpyright", { - capabilities = capabilities, - }) + vim.lsp.config("basedpyright", {}) vim.lsp.config("ruby_lsp", { - capabilities = capabilities, cmd = function(dispatchers, config) return vim.lsp.rpc.start(ruby.ruby_lsp_cmd(config and config.root_dir), dispatchers, { cwd = config and config.root_dir or nil, @@ -245,6 +244,88 @@ return { switch_python_lsp("basedpyright") end, { desc = "Use basedpyright for Python buffers" }) + vim.lsp.config("gopls", { + cmd = { "gopls" }, + filetypes = { "go", "gomod", "gowork", "gotmpl" }, + root_dir = require("lspconfig.util").root_pattern("go.work", "go.mod", ".git"), + settings = { + gopls = { + completeUnimported = true, + usePlaceholders = true, + analyses = { + unusedparams = true, + shadow = true, + }, + staticcheck = true, + gofumpt = true, + hints = { + assignVariableTypes = true, + compositeLiteralFields = true, + compositeLiteralTypes = true, + constantValues = true, + functionTypeParameters = true, + parameterNames = true, + rangeVariableTypes = true, + }, + ui = { + annotation = { + bounds = true, + escape = true, + inline = true, + }, + }, + }, + }, + }) + + vim.lsp.config("lua_ls", { + on_init = function(client) + if client.workspace_folders then + local path = client.workspace_folders[1].name + if path ~= vim.fn.stdpath("config") and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc")) then + return + end + end + + client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua or {}, { + runtime = { + version = "LuaJIT", + path = { + "lua/?.lua", + "lua/?/init.lua", + }, + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + checkThirdParty = false, + library = { + vim.env.VIMRUNTIME, + vim.api.nvim_get_runtime_file("lua", true), + vim.api.nvim_get_runtime_file("lua/lspconfig", false)[1], + }, + }, + telemetry = { + enable = false, + }, + hint = { + enable = true, + arrayIndex = "Auto", + await = true, + awaitPropagate = true, + paramName = "Literal", + paramType = true, + setType = true, + semicolon = "Disable", + }, + }) + end, + settings = { + Lua = {}, + }, + }) + require("mason-lspconfig").setup({ ensure_installed = { "lua_ls", @@ -260,113 +341,6 @@ return { automatic_enable = { exclude = { "pyright", "basedpyright" }, }, - handlers = { - function(server_name) - if server_name ~= "jdtls" then - require("lspconfig")[server_name].setup({ - capabilities = capabilities, - }) - end - end, - - -- Go specific - ["gopls"] = function() - require("lspconfig").gopls.setup({ - capabilities = capabilities, - cmd = { "gopls" }, - filetypes = { "go", "gomod", "gowork", "gotmpl" }, - root_dir = require("lspconfig.util").root_pattern("go.work", "go.mod", ".git"), - settings = { - gopls = { - -- Auto-complete unimported packages - completeUnimported = true, - -- Use placeholders in function signatures - usePlaceholders = true, - -- Analyses - analyses = { - unusedparams = true, - shadow = true, - }, - staticcheck = true, - gofumpt = true, - -- Inlay hints - hints = { - assignVariableTypes = true, - compositeLiteralFields = true, - compositeLiteralTypes = true, - constantValues = true, - functionTypeParameters = true, - parameterNames = true, - rangeVariableTypes = true, - }, - ui = { - annotation = { - bounds = true, - escape = true, - inline = true, - }, - }, - }, - }, - }) - end, - - -- Lua specific - ["lua_ls"] = function() - vim.lsp.config("lua_ls", { - capabilities = capabilities, - on_init = function(client) - if client.workspace_folders then - local path = client.workspace_folders[1].name - if - path ~= vim.fn.stdpath("config") - and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc")) - then - return - end - end - - client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua or {}, { - runtime = { - version = "LuaJIT", - path = { - "lua/?.lua", - "lua/?/init.lua", - }, - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - vim.api.nvim_get_runtime_file("lua", true), - vim.api.nvim_get_runtime_file("lua/lspconfig", false)[1], - }, - }, - telemetry = { - enable = false, - }, - hint = { - enable = true, - arrayIndex = "Auto", - await = true, - awaitPropagate = true, - paramName = "Literal", - paramType = true, - setType = true, - semicolon = "Disable", - }, - }) - end, - settings = { - Lua = {}, - }, - }) - vim.lsp.enable("lua_ls") - end, - }, }) -- Java keymaps (using j group defined in which-key) diff --git a/lua/plugins/obsidian.lua b/lua/plugins/obsidian.lua index 5fe0324..4ba6662 100644 --- a/lua/plugins/obsidian.lua +++ b/lua/plugins/obsidian.lua @@ -29,7 +29,7 @@ return { enable = true, checkboxes = { [" "] = { char = "󰄱", hl_group = "ObsidianTodo" }, - ["x"] = { char = "", hl_group = "ObsidianDone" }, + ["x"] = { char = "✓", hl_group = "ObsidianDone" }, }, }, mappings = { diff --git a/lua/plugins/sessions.lua b/lua/plugins/sessions.lua index 59435f3..c5657e2 100644 --- a/lua/plugins/sessions.lua +++ b/lua/plugins/sessions.lua @@ -82,7 +82,7 @@ return { -- Session management keymaps { "Ss", "AutoSession save", desc = "Save session" }, { "Sr", "AutoSession restore", desc = "Restore session" }, - { "Sd", "SessionDelete", desc = "Delete session" }, + { "Sd", "AutoSession delete", desc = "Delete session" }, { "Sf", "AutoSession search", desc = "Find sessions" }, { "Sa", "AutoSession enable", desc = "Enable auto-save" }, }, diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua index 1734e8c..ae7d003 100644 --- a/lua/plugins/treesitter.lua +++ b/lua/plugins/treesitter.lua @@ -24,7 +24,6 @@ return { "json", "lua", "markdown", - "markdown_inline", "python", "query", "ruby", @@ -96,15 +95,13 @@ return { dependencies = "nvim-treesitter/nvim-treesitter", config = function() require("nvim-treesitter-textobjects").setup({ - textobjects = { - select = { - lookahead = true, - -- Keymaps are defined in lua/config/keymaps.lua for Which-key visibility - }, - move = { - set_jumps = true, - -- Keymaps are defined in lua/config/keymaps.lua for Which-key visibility - }, + select = { + lookahead = true, + -- Keymaps are defined in lua/config/keymaps.lua for Which-key visibility + }, + move = { + set_jumps = true, + -- Keymaps are defined in lua/config/keymaps.lua for Which-key visibility }, }) end, @@ -113,30 +110,7 @@ return { -- Rainbow delimiters { "HiPhish/rainbow-delimiters.nvim", - event = "LazyFile", + event = "FileType", dependencies = "nvim-treesitter/nvim-treesitter", - config = function() - local rainbow_delimiters = require("rainbow-delimiters") - vim.g.rainbow_delimiters = { - strategy = { - [""] = rainbow_delimiters.strategy["global"], - }, - query = { - [""] = "rainbow-delimiters", - }, - priority = { - [""] = 110, - }, - highlight = { - "RainbowDelimiterRed", - "RainbowDelimiterYellow", - "RainbowDelimiterBlue", - "RainbowDelimiterOrange", - "RainbowDelimiterGreen", - "RainbowDelimiterViolet", - "RainbowDelimiterCyan", - }, - } - end, }, } diff --git a/lua/plugins/trouble.lua b/lua/plugins/trouble.lua index 2cc1d79..f8ccd7d 100644 --- a/lua/plugins/trouble.lua +++ b/lua/plugins/trouble.lua @@ -102,7 +102,7 @@ return { return true end - return filename:sub(1, #root) == root + return path_has_prefix(filename, root) end, java_usage_relevant = function(item, value) if not value then diff --git a/lua/plugins/ui.lua b/lua/plugins/ui.lua index 5a872ba..c2c435f 100644 --- a/lua/plugins/ui.lua +++ b/lua/plugins/ui.lua @@ -11,21 +11,16 @@ return { opts = { preset = "modern", delay = 0, - plugins = { spelling = true }, triggers = { { "", mode = "nxso" }, { "", mode = { "n", "v" } }, }, win = { - border = "rounded", padding = { 1, 2 }, - no_overlap = true, }, layout = { width = { min = 30, max = 50 }, - height = { min = 4, max = 25 }, spacing = 1, - align = "right", }, sort = { "local", "order", "group", "alphanum" }, }, @@ -53,7 +48,6 @@ return { { "c", group = "code", mode = { "n", "v" } }, { "C", group = "conflict", mode = { "n", "v" } }, { "d", group = "debug", mode = { "n", "v" } }, - { "dg", group = "debug go" }, { "f", group = "file/find" }, { "g", group = "go" }, { "gi", group = "go insert" }, diff --git a/lua/util/live_hunks.lua b/lua/util/live_hunks.lua index ac6cf95..ba9bf9c 100644 --- a/lua/util/live_hunks.lua +++ b/lua/util/live_hunks.lua @@ -388,9 +388,10 @@ function M.setup() vim.api.nvim_create_autocmd("User", { group = group, - pattern = "GitsignsUpdate", + pattern = "GitSignsUpdate", callback = function(args) - M.schedule_refresh(args.buf) + local bufnr = args.data and args.data.buffer or args.buf + M.schedule_refresh(bufnr) end, })