dustin.web/content/blog/vim-key-remapping-on-window...

26 lines
1.3 KiB
Markdown

+++
title = 'Vim Key Remapping on Windows'
date = 2011-12-21T01:47:00Z
+++
I've been on a quest to get to know Vim over the past few weeks. I'm making a
little bit of progress, with the help of some of the guys at work, and I've got
myself a nice personal configuration, which I've put in a [Mercurial
Repository](http://code.dustin.hatch.name/vimfiles) for portability.
Yesterday, I finally got around to installing gVim on my Windows computer, and
I immediately ran into a snag. I've already trained myself to use `jj` instead
of reaching all the way to the Escape key to exit insert mode, but on my
Windows computer, that didn't work. Instead of switching back to normal mode,
typing `jj` just printed the text `<esc><right>` in the document.
After a bunch of mucking about and uninstalling and re-installing Vim, I
discovered that the issue is not present if I let the installer create the
default `_vimrc` file in `%ProgramFiles(x86)%\Vim`. Further testing revealed
that the command `set nocompatible` was needed in order for key mapping to work
correctly, and probably fix other problems that I've yet to encounter.
I guess there's really no harm in letting the default `_vimrc` file exist. I
didn't install it at first because I wasn't sure where it would be placed (I
thought it would put it in `%USERPROFILE%`, thus conflicting with my personal
configuration).