💾 Archived View for thatit.be › 2023-09-30-10-06-50.gmi captured on 2024-02-05 at 09:38:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-14)

➡️ Next capture (2024-03-21)

🚧 View Differences

-=-=-=-=-=-=-

finally a less distracting cmp

I was getting frustrated with nvim-cmp as the default setup for it in NvChad is to annoyingly pop crap up all the time as I type. I was hoping to set it to only do it when the tab key is pressed or something, but I’m going to settle for *Control+Backslash

I’m sure there’s a way to do this from the init.lua instead of editing NvChad core stuff, but I’m still new to it and this is how I accomplished it.

I edited .config/nvim/lua/plugins/config/cmp.lua and added autocomplete=false, in the options block, so the top of that block now looks like this:

local options = {
  completion = {
    completeopt = "menu,menuone",
    autocomplete = false, -- < -- this is the important line
  },
    -- and more default stuff after that...
}

Then I found the mapping for Control+Space and changed it to Control+Backslash because Control+Space is how I trigger the IME.

  mapping = {
    ["<C-p>"] = cmp.mapping.select_prev_item(),
    ["<C-n>"] = cmp.mapping.select_next_item(),
    ["<C-d>"] = cmp.mapping.scroll_docs(-4),
    ["<C-f>"] = cmp.mapping.scroll_docs(4),
    ["<C-\\>"] = cmp.mapping.complete(), -- <-- it's this one
    ["<C-e>"] = cmp.mapping.close(),
    ["<CR>"] = cmp.mapping.confirm {
      behavior = cmp.ConfirmBehavior.Insert,
      select = true,
    },
    -- and more default stuff after that...
  }

Tags

#index

#nvim

#cli

Navigation

index

tags

prev ⏰

⏰ next

updated: 2023-09-30 10:15:01

generated: 2024-02-03