vim HowTo

Little tricks for vim.

Changing syntax highlighting for filetypes

Add the following to your .vimrc:

:if !exists("autocommands_loaded")
:  let autocommands_loaded = 1
:  augroup filetypedetect
:  au! BufNewFile,BufRead [pattern to replace]
:  au BufNewFile,BufRead [pattern to replace] setf [filetype]
:endif

Example

:if !exists("autocommands_loaded")
:  let autocommands_loaded = 1
:  augroup filetypedetect
:  au! BufNewFile,BufRead *.lib	
:  au BufNewFile,BufRead *.lib	setf c
:endif

References

Vim docs:

Filetype
au
setf
syntax

Configuring the Backspace key to work in Insert Mode

a) Make sure you're not in compatible mode, :set cp? should say nocompatible

b) Check your 'backspace' setting. :set bs=2 should allow you to backspace normally in insert mode.

References

 
techdocs/vim/howto.txt · Last modified: 2007/08/19 13:44 by earnoth
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki