VIM


elflord@panix.com

Contents

Introduction

This is my vim page. Currently, it's main purpose is as a showcase for my work on vim syntax files . I am currently working on making improvements to the sh.vim syntax, as well as writing a syntax file for RPM spec files.

What is Vim

Vim is a text editor which is based on vi. It is better than emacs (-: It has many features including replayable macros, syntax colouring (which is user-definable) , user definable keybindings, and access to powerful text manipulation commands. The syntax colouring in particular is very cool. See for yourself ! Here's a bash script (note that vim can do this for just about any other programming language. There are over 100 syntax files) Check out (screenshot) or (html rendition of vim session) Once you have done some editing with something that has syntax colouring for every type of file in existence , you will never look back.

Where can I get it ?

http://www.vim.org

My vimrc

My vimrc is
here.

Some hints

Easy Stuff

To turn on syntax highlighting (vim 5.0 or later)

:syntax on

To make vim "jump" emacs style to the matching bracket

:set showmatch

To record keystrokes and play them back (macro record)

qa start recording
q stop recording
@a play back keystrokes

Highlight Some text and copy/cut/paste

v start highlighting text. Move cursor to highlight text.
y copy highlighted text
x cut highlighted text
p paste text that has been cut/copied

"Format Text" ie chop up long lines (Great for Email/Usenet!)

Highlight the appropriate text using v and then use gq

More Advanced

Defining Colours

hi link Foo Bar assign the colouring scheme of bar to foo

hi Bar term=bold ctermfg=darkcyan guifg=blue
Defines the colouring scheme for syntax group Bar.

To see a list of the syntax group names, use :help group-name

Note that for the GUI settings, you can also use 6 digit hex numbers ( #rrggbb ) to specify a colour. See my .vimrc for examples.

To set your own definitions, put them in your .vimrc file. See $VIM/syntax/syntax.vim for a starting point, as this is where the defaults are defined. Then hack at it. (note that $VIM is usually /usr/local/share )

My Syntax Files

Go to my syntax section to browse my syntax files.

My html Key Mappings

Go here to see my html key mappings.