Skip to main content
Share Your Experience: Take the 2024 Developer Survey
9 votes
Accepted

Vim - can I pass multiple args to a custom command without writing a function

Do the parsing on your own If you use :help <q-args>, you get a quoted string that you can split() into the two space-separated parts: command! -nargs=+ Sub execute '%substitute/' . split(<...
Ingo Karkat's user avatar
  • 23.1k
5 votes

Vim Script: Is it possible to refer to script-local variables in mappings?

I originally wanted to comment this, but I need 50 rep. Here's a small suggestion, and I hope its on target. its possible to use (within the script where the var is defined) exe "nnoremap <c-...
dabyly's user avatar
  • 51
2 votes

how can I open a terminal split in vim 8.1 without switching to it or going back to the previous split inside a vimscript

As far as I know you cant right now. You can run one command (:ter command) or a shell (:ter), but cant put command into the open shell. :ter cmake -Bbuild -H. && cmake --build build/ -- -j4 -...
user2773829's user avatar
2 votes
Accepted

Vim highlight all text after multiple "#"

The multiplier for 1 or more matches is \+; you forgot the backslash (or the \v "very magic" modifier). Using \ze at the end is superfluous. ^ matches at every beginning of line \n only starting on ...
Ingo Karkat's user avatar
  • 23.1k
2 votes

Import previous commands to edited command

There is zsh-cmd-architect created specifically to do what you describe. It displays you current command, allows to move blocks of it left and right, and also displays searchable history, from which ...
One Other's user avatar

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