question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vim `completeopt`'s `noselect` doesn't work

See original GitHub issue

Warning: I will close the issue without the minimal init.vim and the reproduction instructions.

Problems summary

I followed the documentation to setup ddc.vim, and the FAQ section about “auto select behavior” says to use set completeopt+=noselect.

As seen in the image, even with this option set (I ran :set completeopt), the first popup menu item is not selected. image

Expected

The first popup menu item to be selected (auto select behavior)

Environment Information

  • ddc.vim version (SHA1): d9111bd83986c2cac588e123b3bfe357bec34509

  • denops.vim version (SHA1): 53ce6187e04da044c85b79ef856f1487326a7ac5

  • deno version(deno -V output): deno 1.26.1

  • OS: macOS 13 Ventura

  • neovim/Vim :version output:

:version
VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct  8 2022 19:49:40)
macOS version - arm64
Included patches: 1-696
Compiled by haze@202210081949/89e86cc7e
Huge version with MacVim GUI.  Features included (+) or not (-):
+acl               +clipboard         +dnd               +fullscreen        +lispindent        +mouse_sgr         +persistent_undo   +smartindent       +terminal          +viminfo           -xsmp
-arabic            +cmdline_compl     -ebcdic            -gettext           +listcmds          -mouse_sysmouse    +popupwin          -sodium            +terminfo          +virtualedit       -xterm_clipboard
+autocmd           +cmdline_hist      +emacs_tags        -hangul_input      +localmap          +mouse_urxvt       +postscript        +sound             +termresponse      +visual            -xterm_save
+autochdir         +cmdline_info      +eval              +iconv             +lua/dyn           +mouse_xterm       +printer           +spell             +textobjects       +visualextra
-autoservername    +comments          +ex_extra          +insert_expand     +menu              +multi_byte        +profile           +startuptime       +textprop          +vreplace
+balloon_eval      +conceal           +extra_search      +ipv6              +mksession         +multi_lang        -python            +statusline        +timers            +wildignore
+balloon_eval_term +cryptv            -farsi             +job               +modify_fname      -mzscheme          -python3           -sun_workshop      +title             +wildmenu
+browse            -cscope            +file_in_path      +jumplist          +mouse             +netbeans_intg     +quickfix          +syntax            +toolbar           +windows
++builtin_terms    +cursorbind        +find_in_path      +keymap            +mouseshape        +num64             +reltime           +tag_binary        +transparency      +writebackup
+byte_offset       +cursorshape       +float             +lambda            +mouse_dec         +odbeditor         -rightleft         -tag_old_static    +user_commands     -X11
+channel           +dialog_con_gui    +folding           +langmap           -mouse_gpm         +packages          -ruby              -tag_any_white     +vartabs           -xfontset
+cindent           +diff              -footer            +libcall           -mouse_jsbterm     +path_extra        +scrollbind        -tcl               +vertsplit         +xim
+clientserver      +digraphs          +fork()            +linebreak         +mouse_netterm     -perl              +signs             +termguicolors     +vim9script        -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/Applications/MacVim.app/Contents/Resources/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MACVIM -Wall -Wno-unknown-pragmas -pipe -DMACOS_X -DMACOS_X_DARWIN -g -O2 -arch arm64 -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -arch arm64 -L/usr/local/lib -o Vim -lm -lncurses -liconv -framework AppKit

Provide a minimal init.vim/vimrc without plugin managers (Required!)

call ddc#custom#patch_global('sources', ['vim-lsp'])
call ddc#custom#patch_global('sourceOptions', {
  \ 'vim-lsp': {
  \   'matchers': ['matcher_fuzzy'],
  \   'mark': 'lsp',
  \ }})

set completeopt+=noselect

" Use ddc.
call ddc#enable()

How to reproduce the problem from neovim/Vim startup (Required!)

  1. Get any completion, the first item is not selected when the popup menu shows up

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
Shougocommented, Oct 20, 2022

Oh, no…

So I have said I think you have not test the minimal vimrc.

0reactions
hazecommented, Oct 20, 2022

And you should check completeopt value by verbose set completeopt?.

Thank you so much! This helped me figure out what was overriding my completeopt. I also had asyncomplete installed. Sorry for wasting your time, but thanks for teaching me something new 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding the value 'noselect' to the option 'completeopt' breaks ...
Hello, If I write the following text inside /tmp/vimrc.vim: set cot=noselect,menu,menuone set ... But here it doesn't seem to work.
Read more >
set completeopt=noinsert fails - Vi and Vim Stack Exchange
I use the auto complete function from this stackoverflow page. It works fine on my pc and notebook but it fails ...
Read more >
Make Vim completion popup menu work just like in an IDE
The completion menu is controlled by completeopt. You can set multiple values to combine behaviours. Your completion options may be full text from...
Read more >
completeopt not being respected : r/neovim - Reddit
The completion menu pre selects an item from the suggestions at random times. Any idea why this happens? completeopt=menu,menuone,noselect. cmp for completion.
Read more >
How can I automatically enter an autocomplete item in Vim ...
Your inoremap should end with <C-Y> if you want it to finish completion. That being said, if completeopt does not include noselect ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found