I’ve been a fan of VI (specifically VIM) for a long time now.  It’s hard to find an editor that is as flexible and as lean as VI.  Emacs definately has it on the Flexible front, but could use alot of work on the “lean” front.  Only Microsoft Word is more bloated.

So once I discovered VIM for Windows, it became a staple of every computer I’ve ever used.  I’ve been using it at home for a few years and haven’t bothered to upgrade it.  So when 6.4 was installed here at the office (I know, 7.0 is out now but this is the government afterall) I eagerly sat about editing everything with VIM.

Unfortunately, I found myself rather confused at some of the behavior.  By default, Ctrl-V no longer does Block Selection like I’m used to, it did a standard Windows “Paste”.  Lots of other keys were remapped as well, and (probably since I do not have admin on this machine) most of my settings seemed to be forgotten from one run to the next.  After some digging, I found some solutions.  To aid others out there with similar maladies, I shall share them here:

  1. To restore standard VI keybindings: 
    • Inside the “C:Documents And Settingsusername” directory, you can create a file called “_vimrc”.  This serves the same purpose as the Unix “~/.vimrc” file.  By simply creating this file, you will override VI’s standard vimrc and therefore remove all the stuff that’s overwriting your keybindings.
  2. To fix diff in VIM:
    • By default I got an error “E97″ when attempting to use VIM’s diff functionality (from TortoiseCVS‘s Diff function specifically).
    • In the newly created “_vimrc” file, simply add the following:
      • set diffexpr=MyDiff()
        function MyDiff()
           let opt = “”
           if &diffopt =~ “icase”
             let opt = opt . “-i “
           endif
           if &diffopt =~ “iwhite”
             let opt = opt . “-b “
           endif
           silent execute ‘!”"C:Program Files (x86)Vimvim64diff”" -a ‘ . opt . v:fname_in . ‘ ‘ . v:fname_new . ‘ > ‘ . v:fname_out
        endfunction
    • Be sure to replace the path to vim’s diff to match your install.

Everything beyond that can be specified in the _vimrc file.  I use it to specify my shiftwidth, colorscheme, and lots more.  Hope someone out there finds this useful :)
[tag:vi][tag:vim][tag:software][tag:editor]