Note: This site is currently "Under construction". I'm migrating to a new version of my site building software. Lots of things are in a state of disrepair as a result (for example, footnote links aren't working). It's all part of the process of building in public. Most things should still be readable though.

Today I Learned Mapping te to tabedit in Vim

Vim's `:tabedit` command seems long considering how often it's used. Applying logic from this StackOverflow answer produces this customization:

Code

cnoreabbrev <expr> te getcmdtype() == ":" && getcmdline() == 'te' ? 'tabedit' : 'te'

It defines a `:te` shortcut which expands to `:tabedit`. Throw it in `~/.vimrc` and save five characters for every tab open.

_It's worth pointing out that this accepted StackOverflow answer. For example, `ca te tabedit`. The gotcha hidden in this approach is that it expands across the command. Trying to run `:!ls /tmp/te/` will be altered to `:!ls /tmp/tabedit/`. Not so good._

_And, yes, I added an answer to help out there too._