From 2201543de36b9c3608fc8429776b12a8ff9114d4 Mon Sep 17 00:00:00 2001 From: Dale Date: Fri, 21 Nov 2025 10:30:50 -0500 Subject: [PATCH 01/12] update lockfile --- .config/nvim/lazy-lock.json | 66 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 8b036e2..a4d5801 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,49 +1,47 @@ { - "LuaSnip": { "branch": "master", "commit": "33b06d72d220aa56a7ce80a0dd6f06c70cd82b9d" }, + "LuaSnip": { "branch": "master", "commit": "3732756842a2f7e0e76a7b0487e9692072857277" }, "accelerated-jk": { "branch": "master", "commit": "156c5158b72059404f6b8aaf15b59f87dd0aaa88" }, - "aerial.nvim": { "branch": "master", "commit": "fd7fbe36772d7a955815c90ff9b58523bfdb410d" }, + "aerial.nvim": { "branch": "master", "commit": "3c42785790d401731e7809a25f27f62dae2fec12" }, "beacon.nvim": { "branch": "master", "commit": "5ab668c4123bc51269bf6f0a34828e68c142e764" }, - "browsher.nvim": { "branch": "main", "commit": "4c0e5e37dd6ab9040a491acb3592ca38476a9a14" }, - "bufferline.nvim": { "branch": "main", "commit": "261a72b90d6db4ed8014f7bda976bcdc9dd7ce76" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "conform.nvim": { "branch": "master", "commit": "f4e8837878fc5712d053ba3091a73d27d96a09e2" }, + "blink-cmp-dictionary": { "branch": "master", "commit": "944b3b215b01303672d4213758db7c5c5a1e3c92" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "browsher.nvim": { "branch": "main", "commit": "de87ffcdac45fc4fdd3f18882b81dbc002a2013d" }, + "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, + "conform.nvim": { "branch": "master", "commit": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, - "flash.nvim": { "branch": "main", "commit": "34c7be146a91fec3555c33fe89c7d643f6ef5cf1" }, - "friendly-snippets": { "branch": "main", "commit": "efff286dd74c22f731cdec26a70b46e5b203c619" }, - "gitsigns.nvim": { "branch": "main", "commit": "5f808b5e4fef30bd8aca1b803b4e555da07fc412" }, + "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, + "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, + "gitsigns.nvim": { "branch": "main", "commit": "cdafc320f03f2572c40ab93a4eecb733d4016d07" }, "gv.vim": { "branch": "master", "commit": "b6bb6664e2c95aa584059f195eb3a9f3cb133994" }, - "indent-blankline.nvim": { "branch": "master", "commit": "259357fa4097e232730341fa60988087d189193a" }, - "lazy.nvim": { "branch": "main", "commit": "7e6c863bc7563efbdd757a310d17ebc95166cef3" }, - "lsp-progress.nvim": { "branch": "main", "commit": "f3df1df8f5ea33d082db047b5d2d2b83cc01cd8a" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, - "nightfox.nvim": { "branch": "main", "commit": "7557f26defd093c4e9bc17f28b08403f706f5a44" }, - "nvim-cmp": { "branch": "main", "commit": "98e8b9d593a5547c126a39212d6f5e954a2d85dd" }, + "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, + "indent-o-matic": { "branch": "master", "commit": "4d11e98f523d3c4500b1dc33f0d1a248a4f69719" }, + "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, + "lsp-progress.nvim": { "branch": "main", "commit": "ae52979ad412371ea6dc39ff70c8dfc681fb42b8" }, + "lualine.nvim": { "branch": "master", "commit": "3946f0122255bc377d14a59b27b609fb3ab25768" }, + "lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" }, + "mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-lspconfig": { "branch": "master", "commit": "040001d85e9190a904d0e35ef5774633e14d8475" }, - "nvim-tree.lua": { "branch": "master", "commit": "f7b76cd1a75615c8d6254fc58bedd2a7304eb7d8" }, - "nvim-treesitter": { "branch": "master", "commit": "fa915a30c5cdf1d18129e9ef6ac2ee0fa799904f" }, - "nvim-web-devicons": { "branch": "master", "commit": "0eb18da56e2ba6ba24de7130a12bcc4e31ad11cb" }, + "nvim-lspconfig": { "branch": "master", "commit": "5bfcc89fd155b4ffc02d18ab3b7d19c2d4e246a7" }, + "nvim-tree.lua": { "branch": "master", "commit": "3fb91e18a727ecc0385637895ec397dea90be42a" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, - "onedark.vim": { "branch": "main", "commit": "390b893d361c356ac1b00778d849815f2aa44ae4" }, - "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, - "render-markdown.nvim": { "branch": "main", "commit": "0022a579ac7355966be5ade77699b88c76b6a549" }, - "stickybuf.nvim": { "branch": "master", "commit": "183b9569bef78f44b17c078214f7d731f19cbefe" }, - "telescope.nvim": { "branch": "master", "commit": "2eca9ba22002184ac05eddbe47a7fe2d5a384dfc" }, + "onedark.vim": { "branch": "main", "commit": "68dca198f23ef979dc6a123ad50c598902117232" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "render-markdown.nvim": { "branch": "main", "commit": "6e0e8902dac70fecbdd8ce557d142062a621ec38" }, + "stickybuf.nvim": { "branch": "master", "commit": "0c1e5f1a3eb36eea2cea57083828269cc62c58e4" }, + "telescope.nvim": { "branch": "master", "commit": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8" }, "toggleterm.nvim": { "branch": "main", "commit": "c80844fd52ba76f48fabf83e2b9f9b93273f418d" }, - "trouble.nvim": { "branch": "main", "commit": "46cf952fc115f4c2b98d4e208ed1e2dce08c9bf6" }, + "treesj": { "branch": "main", "commit": "4770492244ccecdc9b01e0e81fa8f2f6b4a23841" }, + "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" }, "vim-diff-enhanced": { "branch": "master", "commit": "8d161f1e97a5f5e64ea4219e6663f98a109df7b1" }, - "vim-fugitive": { "branch": "master", "commit": "fcb4db52e7f65b95705aa58f0f2df1312c1f2df2" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, "vim-mergetool": { "branch": "master", "commit": "0275a85256ad173e3cde586d54f66566c01b607f" }, - "vim-python-pep8-indent": { "branch": "master", "commit": "baa647a70f1d6280a282a6cab425ef4094c9633d" }, - "vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, - "vim-table-mode": { "branch": "master", "commit": "e4365bde024f73e205eefa2fb78e3029ddb92ea9" }, + "vim-table-mode": { "branch": "master", "commit": "e156dbbedce0bbf61c0919db7678fa246fabd616" }, "vis": { "branch": "master", "commit": "6a87efbfbd97238716b602c2b53564aa6329b5de" }, "which-key.nvim": { "branch": "main", "commit": "0539da005b98b02cf730c1d9da82b8e8edb1c2d2" }, - "zenburn.nvim": { "branch": "master", "commit": "821a84a57f0d87b553b563191239840d47052302" } + "zenburn.nvim": { "branch": "master", "commit": "0860da40c6f666dfff3381a8b0ee98e16e08ca66" }, + "zenfade": { "branch": "main", "commit": "75284b99d9941bfee16ff5372f4b8205dd16f456" } } From 0a284cacc0ee7f9a86ef8c2ffca1b3f420fe4396 Mon Sep 17 00:00:00 2001 From: Dale Date: Fri, 21 Nov 2025 10:31:00 -0500 Subject: [PATCH 02/12] support nvim 0.11.5 --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 141 ++++++++++++++------ docs/changelog.rst | 8 ++ setup.sh | 2 +- 3 files changed, 111 insertions(+), 40 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index c840363..d43e9d2 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -1,67 +1,130 @@ -- nvim-lspconfig allows convenient configuration of LSP clients -return { - { + +-- nvim 0.11 changed the way lspconfig works, so we split the config based on +-- version (hence the duplication) +local post_v011 = vim.version().minor >= 11 + +if post_v011 then + return { "neovim/nvim-lspconfig", - cmd = "LspStart", + version = "v2.5", + config = function() + -- Python language server + vim.lsp.config.pyright = { + cmd = { "pyright-langserver", "--stdio" }, + filetypes = { "python" }, + root_markers = { + "pyproject.toml", + "setup.py", + "setup.cfg", + "requirements.txt", + "Pipfile", + "pyrightconfig.json", + ".git", + }, + } + + -- Bash language server + vim.lsp.config.bashls = { + cmd = { "bash-language-server", "start" }, + filetypes = { "sh", "bash" }, + root_markers = { ".git" }, + } + + -- R language server + vim.lsp.config.r_language_server = { + cmd = { "R", "--slave", "-e", "languageserver::run()" }, + filetypes = { "r", "rmd" }, + root_markers = { ".git", "DESCRIPTION" }, + } + + -- Lua language server + vim.lsp.config.lua_ls = { + cmd = { "lua-language-server" }, + filetypes = { "lua" }, + root_markers = { ".luarc.json", ".luarc.jsonc", ".git" }, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + workspace = { + library = { vim.env.VIMRUNTIME }, + }, + }, + }, + } + vim.diagnostic.config({ virtual_text = true }) + + -- LSP keymaps + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + vim.keymap.set("n", "cgd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Goto definition" }) + vim.keymap.set("n", "cK", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) + vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) + vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto references" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code action" }) + end, + }) + end, + keys = { + { "cl", "LspStart", desc = "Start LSP" }, + { "ce", vim.diagnostic.open_float, desc = "Open diagnostics/errors" }, + }, + } +else + return { + "neovim/nvim-lspconfig", + version = "v2.5", init = function() local lspconfig = require("lspconfig") - -- Below, autostart = false means that you need to explicity call :LspStart (cl) + -- below, autostart = false means that you need to explicity call :lspstart (cl) -- -- ---------------------------------------------------------------------- - -- CONFIGURE ADDITIONAL LANGUAGE SERVERS HERE + -- configure additional language servers here -- - -- pyright is the language server for Python + -- pyright is the language server for python lspconfig.pyright.setup({ autostart = false }) lspconfig.bashls.setup({ autostart = false }) - -- language server for R + -- language server for r lspconfig.r_language_server.setup({ autostart = false }) - -- Language server for Lua. These are the recommended options - -- when mainly using Lua for Neovim + -- language server for lua. these are the recommended options + -- when mainly using lua for neovim lspconfig.lua_ls.setup({ - autostart = false, - on_init = function(client) - local path = client.workspace_folders[1].name - if not vim.loop.fs_stat(path .. "/.luarc.json") and not vim.loop.fs_stat(path .. "/.luarc.jsonc") then - client.config.settings = vim.tbl_deep_extend("force", client.config.settings, { - Lua = { - runtime = { version = "LuaJIT" }, - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - }, - }, - }, - }) - - client.notify("workspace/didChangeConfiguration", { settings = client.config.settings }) - end - end, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + workspace = { + library = { vim.env.VIMRUNTIME }, + }, + }, + }, }) - -- Use LspAttach autocommand to only map the following keys after + -- use lspattach autocommand to only map the following keys after -- the language server attaches to the current buffer - vim.api.nvim_create_autocmd("LspAttach", { - group = vim.api.nvim_create_augroup("UserLspConfig", {}), + vim.api.nvim_create_autocmd("lspattach", { + group = vim.api.nvim_create_augroup("userlspconfig", {}), callback = function(ev) - vim.keymap.set("n", "cgd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Goto definition" }) - vim.keymap.set("n", "cK", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) + vim.keymap.set("n", "cgd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Goto Definition" }) + vim.keymap.set("n", "ck", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) - vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto references" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code action" }) + vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto References" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code Action" }) end, }) end, keys = { - -- Because autostart=false above, need to manually start the language server. - { "cl", "LspStart", desc = "Start LSP" }, + -- because autostart=false above, need to manually start the language server. + { "cl", "LspStart", desc = "Start LSP" }, { "ce", vim.diagnostic.open_float, desc = "Open diagnostics/errors" }, { "]d", vim.diagnostic.goto_next, desc = "Next diagnostic/error" }, { "[d", vim.diagnostic.goto_prev, desc = "Prev diagnostic/error" }, }, - }, -} + } +end diff --git a/docs/changelog.rst b/docs/changelog.rst index 6ad36d5..00e667f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Changelog ========= +2025-11-21 +---------- + +**vim** + +- Update installed nvim to v0.11.5, and update LSP configs accordingly. This + LSP config is backwards-compatible with the previously-used version, v0.10. + 2025-10-27 ---------- diff --git a/setup.sh b/setup.sh index e712bba..8a55fff 100755 --- a/setup.sh +++ b/setup.sh @@ -22,7 +22,7 @@ set -eo pipefail # Change tool versions here VISIDATA_VERSION=2.11 HUB_VERSION=2.14.2 -NVIM_VERSION=0.10.4 +NVIM_VERSION=0.11.5 RG_VERSION=13.0.0 BAT_VERSION=0.19.0 JQ_VERSION=1.6 From 8c2b250b6ad9cca64c8a3b8a518ed605f9f97fe9 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:21:39 -0500 Subject: [PATCH 03/12] cl toggles LSP (rather than only start) --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 26 +++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index d43e9d2..2a3c764 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -67,8 +67,19 @@ if post_v011 then }) end, keys = { - { "cl", "LspStart", desc = "Start LSP" }, { "ce", vim.diagnostic.open_float, desc = "Open diagnostics/errors" }, + { + "cl", + function() + local clients = vim.lsp.get_clients({ bufnr = 0 }) + if #clients > 0 then + vim.cmd("LspStop") + else + vim.cmd("LspStart") + end + end, + desc = "Toggle LSP", + }, }, } else @@ -121,7 +132,18 @@ else end, keys = { -- because autostart=false above, need to manually start the language server. - { "cl", "LspStart", desc = "Start LSP" }, + { + "cl", + function() + local clients = vim.lsp.get_clients({ bufnr = 0 }) + if #clients > 0 then + vim.cmd("LspStop") + else + vim.cmd("LspStart") + end + end, + desc = "Toggle LSP", + }, { "ce", vim.diagnostic.open_float, desc = "Open diagnostics/errors" }, { "]d", vim.diagnostic.goto_next, desc = "Next diagnostic/error" }, { "[d", vim.diagnostic.goto_prev, desc = "Prev diagnostic/error" }, From 6bd0adf7c5bc58139845f3574e8a96f9207a3d8a Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:22:14 -0500 Subject: [PATCH 04/12] ce should be defined upon lsp attach, not always --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 2a3c764..40ba403 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -63,11 +63,16 @@ if post_v011 then vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto references" }) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code action" }) + vim.keymap.set( + "n", + "ce", + vim.diagnostic.open_float, + { buffer = ev.buf, desc = "Open diagnostics/errors" } + ) end, }) end, keys = { - { "ce", vim.diagnostic.open_float, desc = "Open diagnostics/errors" }, { "cl", function() From 934afea05346d5b8ff0b5a5d073cb057e21a78c4 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:22:57 -0500 Subject: [PATCH 05/12] cv to toggle virtual text --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 40ba403..e7c25ac 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -52,6 +52,8 @@ if post_v011 then }, }, } + + -- By default show the virtual text. vim.diagnostic.config({ virtual_text = true }) -- LSP keymaps @@ -63,6 +65,12 @@ if post_v011 then vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto references" }) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code action" }) + vim.keymap.set("n", "cv", function() + local current_config = vim.diagnostic.config() + vim.diagnostic.config({ + virtual_text = not current_config.virtual_text, + }) + end, { buffer = ev.buf, desc = "Toggle diagnostic virtual text" }) vim.keymap.set( "n", "ce", From 5c49bfec373bcec841690d1adcdf479fe2b4b17d Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:23:10 -0500 Subject: [PATCH 06/12] rm keymaps that conflict with new nvim 0.11+ defaults --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index e7c25ac..89afd9a 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -60,11 +60,6 @@ if post_v011 then vim.api.nvim_create_autocmd("LspAttach", { group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) - vim.keymap.set("n", "cgd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Goto definition" }) - vim.keymap.set("n", "cK", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) - vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) - vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto references" }) - vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code action" }) vim.keymap.set("n", "cv", function() local current_config = vim.diagnostic.config() vim.diagnostic.config({ From 9c36c40541a307e243bf2c728e4b5c83bb49efe4 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:23:41 -0500 Subject: [PATCH 07/12] add ruff for python formatting --- .config/nvim/lua/plugins/conform.lua | 2 +- .config/nvim/lua/plugins/nvim-lspconfig.lua | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.config/nvim/lua/plugins/conform.lua b/.config/nvim/lua/plugins/conform.lua index c40223c..3657262 100644 --- a/.config/nvim/lua/plugins/conform.lua +++ b/.config/nvim/lua/plugins/conform.lua @@ -17,7 +17,7 @@ return { opts = { formatters_by_ft = { lua = { "stylua" }, - python = { "isort", "black" }, + python = { "ruff", "black" }, bash = { "shfmt" }, sh = { "shfmt" }, }, diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 89afd9a..6c74cda 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -9,7 +9,8 @@ if post_v011 then "neovim/nvim-lspconfig", version = "v2.5", config = function() - -- Python language server + -- + -- -- Python language server vim.lsp.config.pyright = { cmd = { "pyright-langserver", "--stdio" }, filetypes = { "python" }, @@ -24,6 +25,17 @@ if post_v011 then }, } + vim.lsp.config("ruff", { + -- init_options = { settings = {}}, + init_options = { + settings = { + lint = { + preview = true, + }, + }, + }, + }) + -- Bash language server vim.lsp.config.bashls = { cmd = { "bash-language-server", "start" }, From 1ae8497f36126ce09f8b765729752879a79451d5 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:24:13 -0500 Subject: [PATCH 08/12] update docs for LSP --- docs/nvim-plugins.rst | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/nvim-plugins.rst b/docs/nvim-plugins.rst index d5f92d7..d73f442 100644 --- a/docs/nvim-plugins.rst +++ b/docs/nvim-plugins.rst @@ -373,7 +373,14 @@ nvim's Language Server Protocol (LSP). ./setup.sh --install-npm # install nodejs into conda env These keymaps start with :kbd:`c` (mnemonic: "code"). You need to start the -language server with :kbd:`cl` to have access to any of the other keymaps. +language server with :kbd:`cl` to have access to any of these keymaps. + +In nvim 0.11+, there are `default keymaps +`__ for LSP commands. These use the +:kbd:`gr` prefix (presumably g for "global", but not sure what the mnemonic is +for "r"). Otherwise, I'm using :kbd:`c` as the prefix for custom +commands; mnemonic is "code". + .. list-table:: :header-rows: 1 @@ -384,20 +391,22 @@ language server with :kbd:`cl` to have access to any of the other keymaps. * - :kbd:`cl` - Start the LSP server for this buffer * - :kbd:`ce` - - Open diagnostic details + - Show details for the diagnostic + * - :kbd:`cv` + - Toggle virtual text diagnostics in buffer * - :kbd:`[d` - Prev diagnostic * - :kbd:`]d` - Next diagnostic - * - :kbd:`cgd` + * - :kbd:`grt` - Goto definition (e.g., when cursor is over a function) - * - :kbd:`cK` + * - :kbd:`K` - Hover help - * - :kbd:`crn` + * - :kbd:`grn` - Rename all instances of this symbol - * - :kbd:`cr` + * - :kbd:`grr` - Goto references - * - :kbd:`ca` + * - :kbd:`gra` - Code action (opens a menu if implemented) .. plugin-metadata:: From 87fa5fa6725d9889db2781f5bc19e33089c20fc9 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:36:00 -0500 Subject: [PATCH 09/12] conform updates --- .config/nvim/lazy-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index a4d5801..bc91483 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -7,7 +7,7 @@ "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, "browsher.nvim": { "branch": "main", "commit": "de87ffcdac45fc4fdd3f18882b81dbc002a2013d" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, - "conform.nvim": { "branch": "master", "commit": "1bf8b5b9caee51507aa51eaed3da5b0f2595c6b9" }, + "conform.nvim": { "branch": "master", "commit": "afce105eb47b0869dfafdac90d82f02ef2419d61" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "flash.nvim": { "branch": "main", "commit": "fcea7ff883235d9024dc41e638f164a450c14ca2" }, "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, From c186332589039795d54e58ec6b33bb4b6b527129 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:40:41 -0500 Subject: [PATCH 10/12] update changelog --- docs/changelog.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 00e667f..2c608f6 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,8 +6,15 @@ Changelog **vim** -- Update installed nvim to v0.11.5, and update LSP configs accordingly. This - LSP config is backwards-compatible with the previously-used version, v0.10. +- Bump installed nvim to v0.11.5, and update LSP configs accordingly + +nvim 0.11 added built-in LSP client support and some additional built-in +keymaps. The LSP config here is backwards-compatible with the previously-used +version v0.10. + +However if you re-install (i.e. ``setup.sh --install-neovim``) you'll get nvim +0.11.5, which behaves a little differently with LSPs but is also now supported +here. See :ref:`nvimlspconfig_ref` for details on these keymaps. 2025-10-27 ---------- From b573b2043c8107faac3ad73ca90b8c3a621fae21 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Mon, 24 Nov 2025 11:46:33 -0500 Subject: [PATCH 11/12] fix capitalization --- .config/nvim/lua/plugins/nvim-lspconfig.lua | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.config/nvim/lua/plugins/nvim-lspconfig.lua b/.config/nvim/lua/plugins/nvim-lspconfig.lua index 6c74cda..e350a63 100644 --- a/.config/nvim/lua/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/plugins/nvim-lspconfig.lua @@ -9,8 +9,8 @@ if post_v011 then "neovim/nvim-lspconfig", version = "v2.5", config = function() - -- - -- -- Python language server + + -- Python language server vim.lsp.config.pyright = { cmd = { "pyright-langserver", "--stdio" }, filetypes = { "python" }, @@ -25,8 +25,8 @@ if post_v011 then }, } + -- ruff for Python as well vim.lsp.config("ruff", { - -- init_options = { settings = {}}, init_options = { settings = { lint = { @@ -109,21 +109,21 @@ else init = function() local lspconfig = require("lspconfig") - -- below, autostart = false means that you need to explicity call :lspstart (cl) + -- Below, autostart = false means that you need to explicity call :LspStart (cl) -- -- ---------------------------------------------------------------------- - -- configure additional language servers here + -- CONFIGURE ADDITIONAL LANGUAGE SERVERS HERE -- - -- pyright is the language server for python + -- pyright is the language server for Python lspconfig.pyright.setup({ autostart = false }) lspconfig.bashls.setup({ autostart = false }) - -- language server for r + -- language server for R lspconfig.r_language_server.setup({ autostart = false }) - -- language server for lua. these are the recommended options - -- when mainly using lua for neovim + -- Language server for Lua. These are the recommended options + -- when mainly using Lua for Neovim lspconfig.lua_ls.setup({ settings = { Lua = { @@ -137,13 +137,13 @@ else }, }) - -- use lspattach autocommand to only map the following keys after + -- Use LspAttach autocommand to only map the following keys after -- the language server attaches to the current buffer - vim.api.nvim_create_autocmd("lspattach", { - group = vim.api.nvim_create_augroup("userlspconfig", {}), + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), callback = function(ev) vim.keymap.set("n", "cgd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Goto Definition" }) - vim.keymap.set("n", "ck", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) + vim.keymap.set("n", "cK", vim.lsp.buf.hover, { buffer = ev.buf, desc = "Hover help" }) vim.keymap.set("n", "crn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "Rename" }) vim.keymap.set("n", "cgr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Goto References" }) vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Code Action" }) From cb64c5a887203a1eec0d03060e29923d3feb4f33 Mon Sep 17 00:00:00 2001 From: Ryan Dale <115406+daler@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:19:25 -0500 Subject: [PATCH 12/12] fix bash prompt for non-interactive tty --- .bash_prompt | 20 +++++++++++++++----- docs/changelog.rst | 7 +++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.bash_prompt b/.bash_prompt index d1ea25a..c436333 100644 --- a/.bash_prompt +++ b/.bash_prompt @@ -2,9 +2,19 @@ export PS1="\u@\h:\w\\$ " -if [[ $HOSTNAME == "biowulf.nih.gov" ]] ; then - export PS1="\u@\[$(tput sgr0)\]\[\033[38;5;214m\]\h\[$(tput sgr0)\]:\w\\$ " -fi -if [[ $HOSTNAME == "helix.nih.gov" ]]; then - export PS1="\u@\[$(tput sgr0)\]\[\033[38;5;174m\]\h\[$(tput sgr0)\]:\w\\$ " +# Only change prompt if running interactively +if tty -s; then + + # For colors, use colors.sh in the daler/dotfiles repo to easily show the + # color codes. E.g., in \033[38;5;214m\]\h, the 214 indicates an + # orange-yellow hostname. + # + # Or try https://bash-prompt-generator.org/ for more customization. + if [[ $HOSTNAME == "biowulf.nih.gov" ]] ; then + + export PS1="\u@\[$(tput sgr0)\]\[\033[38;5;214m\]\h\[$(tput sgr0)\]:\w\\$ " + fi + if [[ $HOSTNAME == "helix.nih.gov" ]]; then + export PS1="\u@\[$(tput sgr0)\]\[\033[38;5;174m\]\h\[$(tput sgr0)\]:\w\\$ " + fi fi diff --git a/docs/changelog.rst b/docs/changelog.rst index 2c608f6..031d27f 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -16,6 +16,13 @@ However if you re-install (i.e. ``setup.sh --install-neovim``) you'll get nvim 0.11.5, which behaves a little differently with LSPs but is also now supported here. See :ref:`nvimlspconfig_ref` for details on these keymaps. +**bash** + +Update ``.bash_prompt`` to only change prompts in an interactive session, which +prevents the message ``tput: No value for $TERM and no -T specified`` when +using non-interactive prompts like rsync or cron jobs. Also include some info +on the colors and how to customize further. + 2025-10-27 ----------