To open Vim in ":" mode and die after enter -


command

vim +"%s/fafa//gn" /tmp/1   

which shows count correctly opens vim (not wanted). want use vim computation, although know inefficient.

pseudocommand

vim +"%s/fafa//gn" +"q" /tmp/1   

but not show count, dies. think there should sort of conditional operator, instance and.

how can show count in ":" mode , die after user pressing enter?

you can combine commands in command mode pipes, similar how doing multiple command line arguments. such, try this:

vim +"%s/fafa//gne|exec getchar()|q" /tmp/1 

without bit in middle, same original example. however, exec getchar() command bit of vimscript -- how used here -- waits keyboard input, doesn't exit immediately.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -