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?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.
Sign up to join this communityI 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
}
:only
option in the same command: vim -c ':help TOPIC | only'
– Alexander Pozdneev
Jul 26 '20 at 9:54