joy : Tab becomes Esc, just like Bill Joy!
| script karma
Downloaded by 178
Comments, bugs, improvements
script versions (upload new version)
|Esc key where Bill Joy had his.
// Introduction //
:imap <tab> <esc>
(See: https://en.wikipedia.org/wiki/Vi#Creation )
IBM made some really odd decisions in popularizing the current keyboard, so
we're taking the power back.
The :imap above is the real heart of vim-joy: just make it so hitting tab in Insert mode gets you out into Normal mode. The only extra complexity in this script is due to the "Training Wheels" needed to get used
to not being able to hit tab normally. The <Tab>=<Esc> thing is is most surprising when:
* When on an empty line, meaning "increase indent". Use <C-t> instead.
* When in the middle of a line, and trying to line things up. I don't have an exact solution for this, other than to do the work in Normal mode (e.g. with
<C-v> combined with << and >>)
To affect the behavior of this plugin, you can either:
let g:joy_pure = 1
Commit to using <C-t> instead of <Tab> for indentation. At this point it
becomes identical in behavior to Insert Mode <Tab> == <Esc>.
let g:joy_mixed = 1
To turn off the nag message, and forget about <C-t> for indent.
// Temporarily Disabling //
Sometimes you want to affect the behavior only for this session (e.g. for pair
programming with someone who isn't feeling it)
To go back to impure mode:
To make <Tab> be default in behavior:
// Thanks //
Thanks to tpope, as always!
// About //
Grab the latest version or report a bug on Github: http://github.com/rking/vim-joy
|If you don't have a preferred installation method, I recommend
installing pathogen.vim: https://github.com/tpope/vim-pathogen —
then simply copy and paste:
git clone https://github.com/rking/vim-joy.git
Once you run :Helptags you can view the manual with :help joy
Click on the package to download.
ip used for rating: 18.104.22.168