From 79ab8c4e161f5424bbcc5c56fdf6b23a98619cca Mon Sep 17 00:00:00 2001 From: Asocia Date: Sat, 30 Oct 2021 19:32:20 +0300 Subject: [PATCH] TIL: Executing vim commands from terminal --- vim/executing-vim-commands-from-terminal.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 vim/executing-vim-commands-from-terminal.md diff --git a/vim/executing-vim-commands-from-terminal.md b/vim/executing-vim-commands-from-terminal.md new file mode 100644 index 0000000..83d17c9 --- /dev/null +++ b/vim/executing-vim-commands-from-terminal.md @@ -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 +``` + +