Posts Tagged ‘vim’

custom vim syntax highlight (quick and dirty)

mai 12, 2008

Everything between brackets will be yellow.

: syn clear

: hi MyStuff ctermfg=yellow

: syn match MyStuf /\[.*\]/

If you wan’t to save this, put everything in a file under ~/.vim/syntax/mystuff.vim.

Add this at the end of the file you wan’t to highlight :

set vim: syn=mystuff:

That was quick’n’dirty ! 😉

I use this for highlighting timestamps on my text notes.

Cute timestamp with vim key mapping

janvier 13, 2008

With this in my .vimrc if I press CTRL and « : » a nice timestamp will automagically be inserted 🙂

imap ^_ <C-R>=strftime('[ %d/%m/%y %H:%M ] ')<CR>

lovely !

Best tutorial ever on key mappings under vim !!