mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-09 10:39:36 +01:00
TIL: Executing vim commands from terminal
This commit is contained in:
parent
a08dfd5ef8
commit
79ab8c4e16
15
vim/executing-vim-commands-from-terminal.md
Normal file
15
vim/executing-vim-commands-from-terminal.md
Normal file
@ -0,0 +1,15 @@
|
||||
You can execute vim commands in terminal by prefixing your command with `+` symbol:
|
||||
|
||||
```
|
||||
vim filename +/searchterm
|
||||
vim +PlugInstall
|
||||
vim filename +g/foo/d
|
||||
vim filename "+g/foo/norm dap"
|
||||
```
|
||||
|
||||
These commands will open vim and perform your command. And if you want to immediately save and exit (useful for shell scripts):
|
||||
```
|
||||
ex "+g/test/norm dap" "+wq" filename
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user