Vim, the Power of Antiquity

"The Shinkansen Tour"

Giles Orr

TPL

But ... Using vi HURTS

Yes, it really is that old: Wikipedia

What is Vim and do I Care?

To run vim to see what vi looked like: vim -u NONE filename.py

Mappings



let mapleader="-"
nnoremap <leader>ev :tabnew $MYVIMRC<CR>
" _R_e_I_ndent whole file:
nnoremap <leader>ri msHmtgg=G'tzt`s

I chose "-" as my leader because it's unused in vim, and very handy if you use the Dvorak keyboard layout. For Qwerty users, ";" is probably the most accessible choice.

Syntax Highlighting


Vim syntax highlighting is garish

Syntax Highlighting Part II

I've had weird behaviour from "moria:" in the end I edited the moria.vim file to force a dark background at all times.

Syntax Highlighting Part III


web page that shows multiple vim colour schemes side-by-side for the same piece of code (choice of several languages)

If you go to https://code.google.com/p/vimcolorschemetest/ , I recommend Chrome. Don't get me wrong, Firefox is my default browser, but the language tests often choke it.

Syntax Highlighting Part IV

Syntax Highlighting - Ugly Code

/etc/profile:
    if [ -e /usr/share/terminfo/x/xterm?256color ]
    then
        export TERM='xterm-256color'
    else
        export TERM='xterm-color'
    fi
    
~/.vimrc:
        if &term=="xterm-256color"
            set t_Co=256 " "terminal has 256 colors"
        endif
    

Programming Vim

Plugins

Pathogen requires more work on your part creating directories and running "git clone ..." commands. Vundle only needs a pointer to a github (or other) repo and it does the checkouts for you.

Plugins, Part II

There are LOTS of language-specific plugins.

Airline

airline status bar
airline status bar showing git changes
airline status bar in insert mode

Miscellaneous

Bibliography