Vim cli: Difference between revisions
From wikinotes
Line 26: | Line 26: | ||
:echom 'hi' | :echom 'hi' | ||
:messages | :messages | ||
:function DoThing() | |||
echom 'bye' | |||
endfunc | |||
EOF | EOF | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Useful Params --> | </blockquote><!-- Useful Params --> |
Revision as of 18:38, 8 April 2023
Documentation
:help starting
https://vimhelp.org/starting.txt.html
Useful Params
vim -p a b c # open in new tabs vim -o a b c # open in vert splits vim -O a b c # open in horiz splits vim --cmd "let foo=bar" --cmd "let bar=baz" # run commands before reading vimrc vim -c "echo foo" -c "echo bar" # run commands after reading vimrc, and first file vim '+/[0-9] foo' file.txt # open at first line matching regexYou can also pass a script-file in
vim -s <(cat <<EOF :echom 'hi' :messages :function DoThing() echom 'bye' endfunc EOF )