diff options
| -rw-r--r-- | config/nvim/lua/plugins/completion.lua | 19 | ||||
| -rwxr-xr-x | install.sh | 14 |
2 files changed, 28 insertions, 5 deletions
diff --git a/config/nvim/lua/plugins/completion.lua b/config/nvim/lua/plugins/completion.lua index fa037cd..2489fa2 100644 --- a/config/nvim/lua/plugins/completion.lua +++ b/config/nvim/lua/plugins/completion.lua @@ -1,3 +1,11 @@ +-- Supermaven sends buffer context to a third party, so no machine gets it +-- unless it asks: export DOT_SUPERMAVEN=1, in ~/.localenv on the machines that +-- want it. Off, `enabled = false` keeps the plugins off disk entirely, which +-- matters because the `condition` option below is supermaven-nvim's own and +-- reads the other way round -- `true` STOPS it, so the `return false` there +-- left it running on every machine, agent and inline suggestions included. +local supermaven_enabled = vim.env.DOT_SUPERMAVEN == "1" + local plugins = { -- Autocompletion and Snippets { @@ -11,9 +19,10 @@ local plugins = { }, sources = { -- Enable completion from lazydev, LSP, filesystem paths, snippets, buffer - -- (and optionally supermaven) - -- default = { "lazydev", "lsp", "path", "snippets", "buffer", "supermaven" }, - default = { "lazydev", "lsp", "path", "snippets", "buffer" }, + -- (and supermaven, where that machine opted in -- see the top) + default = supermaven_enabled + and { "lazydev", "lsp", "path", "snippets", "buffer", "supermaven" } + or { "lazydev", "lsp", "path", "snippets", "buffer" }, providers = { -- Neovim Lua API / plugin spec completions (folke/lazydev.nvim) lazydev = { @@ -28,7 +37,7 @@ local plugins = { }, -- lsp = { fallbacks = {} }, -- always show the buffer source supermaven = { - enabled = false, + enabled = supermaven_enabled, name = "supermaven", module = "blink-cmp-supermaven", async = true, @@ -101,6 +110,7 @@ local plugins = { -- Supermaven was acquired (and killed) by Cursor { "supermaven-inc/supermaven-nvim", + enabled = supermaven_enabled, event = "InsertEnter", opts = { keymaps = { @@ -132,6 +142,7 @@ local plugins = { }, { "huijiro/blink-cmp-supermaven", + enabled = supermaven_enabled, }, -- Lua LSP completion + types for the Neovim API and lazy plugin specs. @@ -53,7 +53,19 @@ if [[ "$(uname)" == "Darwin" ]]; then fi # --no-upgrade: install what is missing and leave what is there alone. Plain # `brew bundle` also upgrades every listed package that is out of date. - brew bundle --no-upgrade --file="${dotfiles_dir}/Brewfile" + # + # Not fatal: brew bundle fails the whole run if a single entry will not + # install, and on a managed machine that is routine -- a cask can be blocked + # by policy ("has been disabled because it does not pass the macOS Gatekeeper + # check"). One unavailable app is no reason to leave the checkouts, nvim + # plugins and colours undone, so this warns and carries on. brew has already + # said which entry failed, right above. + if ! brew bundle --no-upgrade --file="${dotfiles_dir}/Brewfile"; then + >&2 echo + >&2 echo "WARNING: some Brewfile entries did not install (see brew's output" + >&2 echo "above). Continuing with the rest of the setup." + >&2 echo + fi fi # 2. Checkouts the config reads: the pure prompt (config/zshrc falls back to a |
