Skip to content

How to make autocomplete manually triggered? #2608

Answered by brokenthorn
brokenthorn asked this question in Q&A
Discussion options

You must be logged in to vote

Finally did it!

  {
    "hrsh7th/nvim-cmp",
    opts = {
      mapping = {
        ["<CR>"] = cmp.mapping.confirm {
          behavior = cmp.ConfirmBehavior.Insert,
          -- when true, auto-selects the first item if nothing was selected,
          -- making noselect below not take effect.
          select = false,
        },
      },
      -- adding noselect compared to default, to prevent autocomplete when typing,
      -- and this is actually nvim-cmp defaults, but NvChad overrides this.
      completion = {
        completeopt = "menu,menuone,noselect",
      },
      -- for LSPs that (re)enable this:
      preselect = cmp.PreselectMode.None,
    },
  },

Replies: 3 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@siduck
Comment options

Comment options

You must be logged in to vote
8 replies
@siduck
Comment options

@brokenthorn
Comment options

@brokenthorn
Comment options

@siduck
Comment options

@clockworkpc
Comment options

Answer selected by brokenthorn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants