16

The default behaviour of :help in Vim opens the help in a horizontal split.

I need to remap :help to instead execute :tab help as to always open the help in a new tab.

How can I remap this command?

Andreas Grech
  • 105,982
  • 98
  • 297
  • 360

1 Answers1

31
:cabbrev help tab help
sleepynate
  • 7,926
  • 3
  • 27
  • 38
  • 5
    See [this answer](http://stackoverflow.com/a/7515418/79125) on how to prevent the above abbreviation from converting `:e help.txt` to `:e tab help.txt` (which would give you an error). – idbrii Aug 04 '12 at 22:09
  • 3
    Thanks @pydave, here is the command for lazy copy pasters like me: `cnoreabbrev h getcmdtype() == ":" && getcmdline() == 'h' ? 'tab help' : 'h'` – Ciro Santilli OurBigBook.com Dec 13 '13 at 09:55