[vim/vim] Improve command-line completion docs (PR #13331)

59 views
Skip to first unread message

Yee Cheng Chin

unread,
Oct 12, 2023, 7:59:30 PM10/12/23
to vim/vim, Subscribed

Add more details about 'ignorecase' and its effect on cmdline completion.

Make sure keys used in wildmenu are properly documented and linked in the keys' documentation entries, and in :h index for proper cross-referencing, as wildmenu popup is slightly different from insert-mode popup menu.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/13331

Commit Summary

  • 1787ba5 Improve command-line completion docs

File Changes

(3 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331@github.com>

Yee Cheng Chin

unread,
Oct 12, 2023, 8:03:45 PM10/12/23
to vim/vim, Subscribed

Inspired from neovim/neovim#25253.

For Neovim downstream, I was playing around with Neovim, and there are some minor differences that surprised me.

  1. In Vim, Up/Down vs Left/Right is flipped in wildmenu depending on whether you are using wildoptions+=pum or not, which makes intuitive sense to me. In Neovim, that is not the case.
  2. Also, in Neovim, Ctrl-E and Ctrl-Y to dismiss/select a choice works both with/without pum. In Vim, it only works with pum. I actually think it may not be a bad idea to make Ctrl-E/Ctrl-Y works across the board in Vim as well.

Otherwise, probably done with my cmdline completion PRs. Contemplating if I want to work on has( and exists( completion as well as I have had situations where I wanted that to complete but it didn't, but it seems a little too niche of a feature.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1760556180@github.com>

Yee Cheng Chin

unread,
Oct 12, 2023, 8:08:24 PM10/12/23
to vim/vim, Push

@ychin pushed 1 commit.

  • 6c7dfdc Improve command-line completion docs


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/push/15401001578@github.com>

Yee Cheng Chin

unread,
Oct 12, 2023, 8:17:49 PM10/12/23
to vim/vim, Push

@ychin pushed 1 commit.

  • ae5c76d Improve command-line completion docs


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/push/15401060700@github.com>

zeertzjq

unread,
Oct 12, 2023, 8:29:14 PM10/12/23
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/cmdline.txt:

> @@ -90,9 +90,11 @@ CTRL-SHIFT-Q	Works just like CTRL-V, unless |modifyOtherKeys| is active,
 		In the GUI the |key-notation| is inserted without simplifying.
 
 							*c_<Left>* *c_Left*
-<Left>		cursor left
+<Left>		cursor left. See 'wildmenu' for behavior during wildmenu
⬇️ Suggested change
-<Left>		cursor left. See 'wildmenu' for behavior during wildmenu
+<Left>		cursor left.  See 'wildmenu' for behavior during wildmenu


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/review/1675467937@github.com>

zeertzjq

unread,
Oct 12, 2023, 8:37:13 PM10/12/23
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/options.txt:

>  
 	When using the popup menu for command line completion, the following
 	keys have special meanings:
-	<Down>		- select next match (like CTRL-N)
+	<Up> <Down>	- select previous/next match (like CTRL-P/CTRL-N)
 	<Left>		- in filename/menu name completion: move up into
 			  parent directory or parent menu.
 	<Right>		- in filename/menu name completion: move into a
 			  subdirectory or submenu.
 	<Up>		- select previous match (like CTRL-P)

This line should be removed now.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/review/1675478634@github.com>

zeertzjq

unread,
Oct 12, 2023, 8:38:01 PM10/12/23
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In runtime/doc/options.txt:

> +	<PageUp>	  Select a match several entries back, but don't insert it.
+	<PageDown>	  Select a match several entries further, but don't insert it.
⬇️ Suggested change
-	<PageUp>	  Select a match several entries back, but don't insert it.
-	<PageDown>	  Select a match several entries further, but don't insert it.
+	<PageUp>	- Select a match several entries back, but don't insert it.
+	<PageDown>	- Select a match several entries further, but don't insert it.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/review/1675479776@github.com>

Yee Cheng Chin

unread,
Oct 12, 2023, 8:41:44 PM10/12/23
to vim/vim, Push

@ychin pushed 1 commit.


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/push/15401228788@github.com>

Yegappan Lakshmanan

unread,
Oct 12, 2023, 11:04:03 PM10/12/23
to vim/vim, Subscribed

Inspired from neovim/neovim#25253.

For Neovim downstream, I was playing around with Neovim, and there are some minor differences that surprised me.

  1. In Vim, Up/Down vs Left/Right is flipped in wildmenu depending on whether you are using wildoptions+=pum or not, which makes intuitive sense to me. In Neovim, that is not the case and Left/Right always select previous/next, and Up/Down always go up/down a menu/folder level.

Yes. When I implemented this (#9707), Bram gave a comment to change the cursor keys to make it more intuitive.

  1. Also, in Neovim, Ctrl-E and Ctrl-Y to dismiss/select a choice works both with/without pum. In Vim, it only works with pum. I actually think it may not be a bad idea to make Ctrl-E/Ctrl-Y works across the board in Vim as well.

In the command-line mode, CTRL-E moves the cursor to the end of the command-line. As long as
this functionality is kept, we can use CTRL-E to cancel the wildmenu.

Otherwise, probably done with my cmdline completion PRs. Contemplating if I want to work on has( and exists( completion as well as I have had situations where I wanted that to complete, but it seems a little too niche of a feature.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1760692001@github.com>

Yee Cheng Chin

unread,
Oct 13, 2023, 12:03:51 AM10/13/23
to vim/vim, Subscribed

  1. Also, in Neovim, Ctrl-E and Ctrl-Y to dismiss/select a choice works both with/without pum. In Vim, it only works with pum. I actually think it may not be a bad idea to make Ctrl-E/Ctrl-Y works across the board in Vim as well.

In the command-line mode, CTRL-E moves the cursor to the end of the command-line. As long as this functionality is kept, we can use CTRL-E to cancel the wildmenu.

Playing around with it, actually both CTRL-E and CTRL-Y (with "pum") seem to have an odd (buggy) behavior. They would cancel / select the selection, but also put you at the end of the line. So let's say you have the cursor in the middle of the line like so: :set di<cursor> wrap. You press Tab to bring up auto-complete and then use CTRL-E/CTRL-Y to cancel/select, the cursor will be pushed all the way to the end after "wrap". Seems like a minor bug to me and would only matter if you start auto-complete in the middle of the line instead of at the end. If you just shift-tab back to an empty choice your cursor will stay in place, just as expected.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1760731601@github.com>

Christian Brabandt

unread,
Oct 13, 2023, 2:57:01 AM10/13/23
to vim/vim, Subscribed

In the command-line mode, CTRL-E moves the cursor to the end of the command-line. As long as
this functionality is kept, we can use CTRL-E to cancel the wildmenu.

Agree, I am also all for consistency here.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761002154@github.com>

Shane-XB-Qian

unread,
Oct 13, 2023, 5:41:48 AM10/13/23
to vim/vim, Subscribed

2. Ctrl-E and Ctrl-Y to dismiss/select a choice works both with/without pum

it maybe useful IF wildmode is list,full, otherwise the output list items perhaps took up too much screen but no good way to clean/reset it.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761223994@github.com>

Yee Cheng Chin

unread,
Oct 13, 2023, 6:41:40 AM10/13/23
to vim/vim, Subscribed

ctrl-e (or something else?) to dismiss choice (even not when 'pum') maybe useful IF wildmode is list,full,
otherwise the output list items perhaps took up too much screen but seems no good way to clean/reset it.

Just to clarify, did you mean otherwise (if not using list,full) it's not useful to have Ctrl-E dismiss choice? I think either way the proposal is to have Ctrl-E/Y dismiss/select the current choice only when wildmenu is up (we have two flavors of wildmenu: popup or non-popup). The only potential drawback of this is that if you have wildmenu up, and you want to go to the end, you have to press Ctrl-E to dismiss wildmenu, then Ctrl-E to go to the end, which I think is not a big deal.

For the list part of wildmode, Ctrl-E won't activate since there is no wildmenu used here. Yes, it may take up a lot of screen real estate due to the listing, but I'm not talking about using Ctrl-E to clear the listed items.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761301079@github.com>

Shane-XB-Qian

unread,
Oct 13, 2023, 7:05:18 AM10/13/23
to vim/vim, Subscribed

> > `ctrl-e` (or something else?) to dismiss choice (even not when 'pum') maybe useful IF wildmode is `list,full`,

> > otherwise the output list items perhaps took up too much screen but seems no good way to clean/reset it.
>
> Just to clarify, did you mean otherwise (if not using `list,full`) it's not useful to have Ctrl-E dismiss choice?

there are 3 cases as my knowledge:
1, 'pum' like compl 'popup'
2, 'wildmenu' like 'stl'
3, 'list' like 'cli'

for now:
seems 'c-e' already be used to dismiss 'pum' and 'wildmenu' if they are presented,
// or/but to 'wildmenu' seems use 'c-b' (to line head) etc also can dismiss it.
so now the problem is 'list', seems no way to dismiss the choice output,
i didnot mean it have to use 'c-e' to dismiss it, but just say to 'list' it is no way to dismiss.

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761329875@github.com>

Yee Cheng Chin

unread,
Oct 13, 2023, 7:30:14 AM10/13/23
to vim/vim, Subscribed

seems 'c-e' already be used to dismiss 'pum' and 'wildmenu' if they are presented,

No, Ctrl-E only works for "pum", not old-style "wildmenu". I'm suggesting Ctrl-E works with old-style "wildmenu" as well.

But yes, with a long list-style it's annoying when it completely takes over the screen. I think it's a somewhat different issue with redrawing a screen.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761359816@github.com>

Shane-XB-Qian

unread,
Oct 13, 2023, 7:38:26 AM10/13/23
to vim/vim, Subscribed

seems 'c-e' already be used to dismiss 'pum' and 'wildmenu' if they are presented,

No, Ctrl-E only works for "pum", not old-style "wildmenu". I'm suggesting Ctrl-E works with old-style "wildmenu" as well.

But yes, with a long list-style it's annoying when it completely takes over the screen. I think it's a somewhat different issue from this one.

um.. even <up> and <down> (not only <c-e>) can dismiss 'wildmenu' in 'stl-like' bar, at my v9.0.2018
or whatever, i just say 'list' may need some key ('c-e' or something else) to dismiss its choice output list.
// but yes, seems it is another/different issue.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761370947@github.com>

Yee Cheng Chin

unread,
Oct 13, 2023, 8:24:03 AM10/13/23
to vim/vim, Subscribed

/ keeps the selection, which is not what Ctrl-E does. Ctrl-E cancels the selection and go back to the original typed text. It's the same behavior as insert-mode popup completion. Maybe the word "dismiss" was poorly chosen. "Cancel" is more correct.

What / does is more similar to Ctrl-Y, which does keep the selection and dismisses the wildmenu. One caveat is that / has special behaviors when selecting files as they let you navigate through the folder structure, whereas Ctrl-Y would just keep the selection and exits wildmenu. You should read the documentation that I updated in this PR :).


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761429111@github.com>

Shane-XB-Qian

unread,
Oct 13, 2023, 10:04:24 AM10/13/23
to vim/vim, Subscribed

> <Up> / <Down> keeps the selection, which is not what Ctrl-E does. Ctrl-E cancels the selection and go back to the original typed text. It's the same behavior as insert-mode popup completion. Maybe the word "dismiss" was poorly chosen. "Cancel" is more correct.
>
> What <Up> / <Down> does is more similar to Ctrl-Y, which does keep the selection and dismisses the wildmenu. One caveat is that <Up>/<Down> has special behaviors when selecting files as they let you navigate through the folder structure, whereas Ctrl-Y would just keep the selection and exits wildmenu. You should read the documentation that I updated in this PR :).

i meant 'dismiss'
// or whatever, 'dismiss' or 'cancel' both no way to 'list'
// and i knew 'cancel' what it is, actually you were talking about 'cancel'
// which is use 'c-e' to dismiss 'wildmenu' that 'stl-like' bar and cancel compl

--
shane.xb.qian


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1761577686@github.com>

Christian Brabandt

unread,
Oct 14, 2023, 5:24:19 AM10/14/23
to vim/vim, Subscribed

thanks!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1762757615@github.com>

Christian Brabandt

unread,
Oct 14, 2023, 5:24:26 AM10/14/23
to vim/vim, Subscribed

Merged #13331 into master.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/issue_event/10652535225@github.com>

Yee Cheng Chin

unread,
Oct 16, 2023, 9:41:23 PM10/16/23
to vim/vim, Subscribed

In the command-line mode, CTRL-E moves the cursor to the end of the command-line. As long as
this functionality is kept, we can use CTRL-E to cancel the wildmenu.

Agree, I am also all for consistency here.

#13362 will try to make Ctrl-E/Ctrl-Y work more consistently.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/13331/c1765519997@github.com>

Reply all
Reply to author
Forward
0 new messages