owenrusk.dev

dotfiles

shell, editor, ssh.

git clone https://owenrusk.dev/dotfiles.git

commit 316496b6c383fce15e0d726e903c38ba6e4ae5fb
parent f4f8c58356483f87c94c67b1d2ca18c153d7ce08
author Owen Rusk <owen@papermothgames.com>
date   2025-10-16 16:00:21 -0500
nvim: lsp completion, when asked
nvim/lua/owen/lsp.lua+4-0
nvim/lua/owen/options.lua+1-0
diff --git a/nvim/lua/owen/lsp.lua b/nvim/lua/owen/lsp.lua
index eb49cff..8911dd5 100644
--- a/nvim/lua/owen/lsp.lua
+++ b/nvim/lua/owen/lsp.lua
@@ -33,6 +33,10 @@ vim.api.nvim_create_autocmd("LspAttach", {
     if client and client.name == "ruff" then
       client.server_capabilities.hoverProvider = false
     end
+    -- completion on ctrl-x ctrl-o, when i ask. not a popup on every key.
+    if client and client:supports_method("textDocument/completion") then
+      vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = false })
+    end
     -- grn, grr, gra and K come with 0.11. gd doesn't.
     vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = args.buf })
   end,
diff --git a/nvim/lua/owen/options.lua b/nvim/lua/owen/options.lua
index 650e2f3..4976dc4 100644
--- a/nvim/lua/owen/options.lua
+++ b/nvim/lua/owen/options.lua
@@ -14,6 +14,7 @@ o.smartindent = true
 o.ignorecase = true
 o.smartcase = true
 o.inccommand = "split"
+o.completeopt = { "menuone", "noselect", "popup" }
 o.path:append("**")
 
 o.undofile = true