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
  • (t)csh alias: alias vimhelp 'vim -c ':help $1' -c :only' – Martin Tournoij Mar 7 '15 at 17:51
  • 3
    @Carpetsmoker Did you find a time machine to go back to the late 1980s/early 1990s, the time when tcsh was worth using? Can you share? – Gilles 'SO- stop being evil' Mar 7 '15 at 17:53
  • @Gilles some people still post questions about it on AU/U&L - corporate environments, I suppose. :( – muru Mar 8 '15 at 18:33
  • You can also put the :only option in the same command: vim -c ':help TOPIC | only' – Alexander Pozdneev Jul 26 '20 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.