Reputation: 141180
I use Vim in inspecting data. I would like to start Vim in specific ":" mode, for instance processing binary data in Terminal:
xxd -ps r328_0000.raw > /tmp/1 && vim /tmp/1 :%s/ffff//gn
|
?
How can you start Vim in the ":"-mode in terminal?
Upvotes: 0
Views: 64
Reputation: 2471
You can do this with the -c option (or just +) like this:
vim -c "%s/ffff//gn"
vim +"%s/ffff//gn"
From the manpage:
+{command}
-c {command}
{command} will be executed after the first file has been
read. {command} is interpreted as an Ex command. If the
{command} contains spaces it must be enclosed in double
quotes (this depends on the shell that is used). Example:
Vim "+set si" main.c
Note: You can use up to 10 "+" or "-c" commands.
Upvotes: 1