手機 - Nokia N900 - Maemo - 客製化.vimrc



~/.vimrc

set nu
set nocp
set ruler
set showcmd
set bg=dark
set hlsearch
set showmode
set expandtab
set tabstop=4
set shiftwidth=4
set backspace=indent,eol,start
set enc=utf8
set fencs=utf8,gbk,gb2312,gb18030
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
autocmd BufEnter *.inc :setlocal filetype=objasm
autocmd BufEnter *.asm :setlocal filetype=objasm
syntax on

map 0 :s/&amp;/\&/ge\|:'<,'>s/&gt;/>/ge\|:'<,'>s/&lt;/</ge
map 1 :s/&/\&amp;/ge\|:'<,'>s/>/\&gt;/ge\|:'<,'>s/</\&lt;/ge
map 2 :s/\%xa0/\ /ge

設定html檔案都使用xml語法

$ mkdir -p ~/.vim/syntax
$ echo "set syntax=xml" > ~/.vim/syntax/html.vim