Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
8 votes
Accepted

Where is the documentation for this ex command?

This command has no name, but is simply the default behavior of the ex (and, notably, ed). Given a range, which may be one of the special sequences you mentioned, or a search, or even just a plain ...
D. Ben Knoble's user avatar
  • 26.4k
5 votes

cmdline: how to expand `##` in-place?

You could use :h expand() in your command: command! -nargs=+ Test echo expand("<args>") This way :Test foo bar will echo foo bar and :Test ## will echo your argument list. About the in-place ...
statox's user avatar
  • 50k
5 votes

How to disable expansion of percent sign('%') in cmdline and `:exec`?

escape(getline('.'), '%') See :h escape() for more information
muffinmad's user avatar
  • 171
3 votes
Accepted

CmdlineEnter vs CmdwinEnter (In the context of changing Cmdline background color)

The event CmdLineEnter refers to entering the command line via :, /, or ?, including non-interactively. There is also CmdWinEnter, referring to entering the command window. There are 2 ways for ...
D. Ben Knoble's user avatar
  • 26.4k
2 votes
Accepted

cmap macros not working as expected

I guess that you want to create a new command. Like this: :command Checkout :!cleartool checkout -nc % This allows you to run cleartool checkout from Vim with the command :Checkout. Note: User ...
Ralf's user avatar
  • 9,237
2 votes
Accepted

cmdline: how to expand `##` in-place?

I ended in using cabbr. This is one way. cnoreabbrev <expr> ##; getcmdtype()==':'?expand('##'):'##;' cnoreabbrev <expr> #; getcmdtype()==':'?expand('#'):'#;' cnoreabbrev <expr> %; ...
doraemon's user avatar
  • 1,667
2 votes
Accepted

Is it correct that between a CmdlineLeave and a CmdwinEnter there must be a CmdlineEnter?

This is an implementation detail and it is not documented anywhere. Hence, it is absolutely NEITHER SAFE NOR RECOMMENDED to rely on this behaviour. But, yes, q/ (and similar) is internally mapped to / ...
Matt's user avatar
  • 20.8k
1 vote

What are the escaping rules of command arguments?

What are the rules that :file arguments are escaped? The argument to :file is undergoing expand() function. expand() expands wildcards and all special keywords. All special characters % # <, ...
KamilCuk's user avatar
  • 265
1 vote

How to put a text object under the cursor into an cmdline-mode command?

It is not necessary to yank your path first. You can use <C-r><C-f> instead: CTRL-R CTRL-F *c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>* CTRL-F the Filename under the ...
r_31415's user avatar
  • 576
1 vote

How to make neovim cmdline-completion suggests common matched substring?

It is likely that there are other commands that start with :Vim but not :Vimspector that are being offered in the completion, hence why it stops there. Natively, vim offers the :VimballList command. ...
Andrew Ho-Lee's user avatar
1 vote

How to show ruler always in the last line instead of statusline?

I don't believe what you're asking is possible. You can remove the ruler from the statusline, however you cannot have it only appear on the bottom of the screen and be accurate to each window.
doopNudles's user avatar
1 vote
Accepted

Expansion of cmdline-special vs `=

Actually, it's pretty simple. "Backtick" only works where a file argument stands (like "wildcards", not "cmdline-special"), see :h backtick-expansion. For example, ...
Matt's user avatar
  • 20.8k

Only top scored, non community-wiki answers of a minimum length are eligible