Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When possible I create 1 or 2 letter abbreviations for aliases and the like, e.g. x for exit or p for pwd at the command line.

When using vim and doing multiple tabs for different files (which I can switch between with gt or gT btw) I can edit an additional file with :tabe filename which also creates a new tab.

Is there any shortcut or is there any way to create one (perhaps using the .vimrc file?) for something like :ta or :tb or :tt or :tz etc.

share|improve this question
You can, but I discourage it. To use one of your examples x for exit is rather easy to accidentally type compared to ZZ (which itself was chosen because it is not easy to accidentally type). Also, training your fingers to conform to vim rather than the converse makes things much nicer when you aren't operating in the context of your .vimrc (which often happens more than you'd expect). – msw Aug 21 '13 at 10:19
Good point, though each to their own. I've shared the 'x' option with others and they've adopted it. I've never done it by mistake and if I did I wouldn't be exiting a 'document edit' in progress, just the command line and ctrl-alt-t gives me another with the history right there. – Michael Durrant Aug 21 '13 at 12:10
up vote 2 down vote accepted

There is no shorter :t_ command, but you can make your own:

Put the following in your .vimrc file:

:com! -nargs=? T tabedit <args>

Recall that E183: User defined commands must start with an uppercase letter.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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