I find my self often, especially after this site was created, opening Vim just to type :h ...
or :helpgrep ...
.
What I would like to do is to run Vim and immediately open the help topic that I want. How can I do this?
Use the -c
argument to execute a command after Vim starts up:
vim -c ':help TOPIC' -c :only
You may want to define a shell function:
vimhelp () {
vim -c ":help $1" -c :only
}
alias vimhelp 'vim -c ':help $1' -c :only'
Commented
Mar 7, 2015 at 17:51
:only
option in the same command: vim -c ':help TOPIC | only'
Commented
Jul 26, 2020 at 9:54