Chinaunix首页 | 论坛 | 博客
  • 博客访问: 471511
  • 博文数量: 120
  • 博客积分: 3052
  • 博客等级: 中校
  • 技术积分: 1755
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-01 09:43
文章分类

全部博文(120)

文章存档

2011年(20)

2010年(3)

2009年(52)

2008年(45)

我的朋友

分类: LINUX

2009-09-05 10:39:00

正式完全用 vim 有半年多了吧,把配置文件粘上来,防止有时忘记了。

----------------------------------------------------
" 自动补全命令时候使用菜单式匹配列表
set wildmenu
" 允许退格键删除
set backspace=2
" 启用鼠标
set mouse=a
" 文件类型
filetype on
filetype plugin on
filetype indent on
" 设置编码自动识别, 中文引号显示
"set fileencodings=utf-8,cp936,big5,euc-jp,euc-kr,latin1,ucs-bom
set fileencodings=utf-8,gbk,ucs-bom
"set ambiwidth=double " not needed yet??

" 移动长行
nnoremap gj
nnoremap gk

" 让编辑模式可以中文输入法下按:转到命令模式
nnoremap : :

" 高亮
syntax on
" 设置高亮搜索
set hlsearch
" 输入字符串就显示匹配点
set incsearch
" 输入的命令显示出来,看的清楚些。
set showcmd

" 打开当前目录文件列表
"map :e .

" Taglist
let Tlist_File_Fold_Auto_Close=1
set updatetime=1000
"map :Tlist

" 按 F8 智能补全
inoremap

" vim 自动补全 Python 代码
" 来自
autocmd FileType python set complete+=k~/.vim/tools/pydiction
autocmd FileType python set shiftwidth=4 tabstop=4 expandtab
" 自动使用新文件模板
"autocmd BufNewFile *.py 0r ~/.vim/template/simple.py

autocmd FileType html set shiftwidth=4 tabstop=4 expandtab
autocmd BufNewFile *.html 0r ~/.vim/template/simple.html
"autocmd BufNewFile *.tex 0r ~/.vim/template/simple.tex
autocmd BufNewFile *.mp 0r ~/.vim/template/end.mp
autocmd BufNewFile *.jsp 0r ~/.vim/template/simple.jsp
"autocmd BufNewFile *.java 0r ~/.vim/template/struts2.java

" shell script auto executable
autocmd! bufwritepost *.sh !chmod +x *.sh

"Format the statusline
"Nice statusbar
set laststatus=2
set statusline=
set statusline+=%2*%-3.3n%0*\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%1*%m%r%w%0* " flag
set statusline+=[
if v:version >= 600
set statusline+=%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{&encoding}, " encoding
endif
set statusline+=%{&fileformat}] " file format
if filereadable(expand("$VIM/vimfiles/plugin/vimbuddy.vim"))
set statusline+=\ %{VimBuddy()} " vim buddy
endif
set statusline+=%= " right align
"set statusline+=%2*0x%-8B\ " current char
set statusline+=0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset

" 这个配色方案看着还行
"colorscheme tango
colorscheme ps_color

" 加上行号
set nu
" 搜索忽略大小写,但是用 smart
set ignorecase smartcase
" 大小写转换
set tildeop

" set autoindent
set smartindent
" 用 e 打开文件时 hide,这个比较好用
set hidden
" 备份要修改的文件
" set patchmode=.orig
" 单词不要在断行处,包括中文
" set linebreak
" set formatoptions+=mM
" 用语法进来 folding
" 下面的应该是最好的,如果没有相应语言的 syntax 文件的话,就不能用了
"set foldmethod=syntax
set foldmethod=indent
set foldcolumn=1
" 离开时自动 folding
"set foldclose=all
" 字典补全的字典
set dictionary+=/usr/share/dict/words
" spell
" setlocal spell spelllang=en_us

" like xpdf binding
:map
:map
" :map zz :wq

" 去掉搜索高亮
nmap :nohlsearch


" Wrap lines just show
set wrap

"Turn backup off
set nobackup
set nowb
set noswapfile

" 显示匹配
set showmatch

" 对注释的 toggle
let NERDComLineToggleMap=",,"

" 一些补全
inoremap
inoremap
inoremap

"The commandbar is 2 high
set cmdheight=2

" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*

" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults
" to 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'

"doxygen toolkit
let g:DoxygenToolkit_briefTag_pre="desc: "
let g:DoxygenToolkit_paramTag_pre="@param "
let g:DoxygenToolkit_returnTag="@seturns "
let g:DoxygenToolkit_blockHeader="--------------------------------------------------------------------------"
let g:DoxygenToolkit_blockFooter="----------------------------------------------------------------------------"
let g:DoxygenToolkit_authorName="Drunkedcat"
let g:DoxygenToolkit_licenseTag="GPL 2.0"

let g:DoxygenToolkit_authorName="Drunkedcat, whitelilis@gmail.com"
let s:licenseTag = "Copyright(C)\"
let s:licenseTag = s:licenseTag . "For free\"
let s:licenseTag = s:licenseTag . "All right reserved\"
let g:DoxygenToolkit_licenseTag = s:licenseTag
let g:DoxygenToolkit_briefTag_funcName="yes"
let g:doxygen_enhanced_color=1

"release from 'unknown filetype'
let NERDShutUp=1
"I like style '--' rather than '{-' for haskell
let NERD_haskell_alt_style=1

" Automatically open the taglist window on Vim startup
"if !exists('Tlist_Auto_Open')
"let Tlist_Auto_Open = 1
"endif
----------------------------------------------------
阅读(935) | 评论(0) | 转发(0) |
0

上一篇:dwm 映入眼帘

下一篇:gimp tips

给主人留下些什么吧!~~