IAML's Blog

Find passion in coding

vim配置文件

IAmL posted @ 2009年10月18日 08:24 in Vim with tags vim 配置 , 5886 阅读

(本文更新于2009-12-04)

其实这个vim的配置之间已经弄过了。但是由于重装的时候忘记把配置文件备份,导致已经来来回回配置了好几次 。但是某gcc和某gombiuda所说,配置是一个长期地过程,不是这个一朝一夕就可以弄好滴,所以就先把目前的配置文件发上来,作为一个备份吧。之后有更新的话再改吧。

注:这个配置文件主要参考网上流传的“史上最牛的vim配置”(用这个关键字百度或者google一下就会发现有很多网站有转这个配置文件)

目前用到的插件有:

bufexplorer, winfileexplorer,minibufexpl, winmanager,wintagexplorer(文件浏览,buffer)

QuickComment(块注释代码)

taglist(代码阅读)

SearchComplete(python补全)

vimballPlugin(新版vim插件发布形式)

 

"==================General Setting================
"Get out of VI's compatible mode
set nocompatible

"Set to auto read when a file is changed from outside
set autoread

"Set not to auto backup
set nobackup

"GUI setting
set guioptions-=T
set guioptions-=m
set guioptions-=r
set guioptions-=l

"Show line number
set nu

"Set no search highline
set nohlsearch

"Ignore case when searching
set ignorecase
set incsearch

"Turn in Wild menu
set wildmenu

"Set no swap file
set noswapfile

"Set mapleader
let mapleader = ","
let g:mapleader = ","

"===================tab related==========
"Folding
"Enable folding
set nofen
set fdl=0

"Auto indent
set autoindent

"Tab width
set shiftwidth=4
set tabstop=4

"<BS> relates to tab
set smarttab

"Use space to instead tab
set expandtab

"===================Programming Related===========
"Show matching bracets
set showmatch

"Set C-style indent
set cindent

"===================Colors and Fonts==============
"Enable syntax hl
syntax enable

"Set colorscheme
color desert

"Set font
set gfn=DejaVu\ Sans\ Mono\ 10

"======================Plugin=====================
"Enable filetype plugin
filetype plugin on
filetype indent on

"set taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1

    "Set taglist open
    map <leader>tl :call OpenTagList()<cr>

    fun OpenTagList()
        :!ctags -R
        :TlistOpen
    endfun

    "Set taglist close
    map <leader>tc :TlistClose<cr>

"python auto complete
"set path of python keyword dictionary, which names comlete-dict
let g:pydiction_location = '~/.vim/tools/pydiction/complete-dict'

"winmanager setting
"combine winManager and Taglist together
let g:winManagerWindowLayout = "FileExplorer|TagList"

    "set winManager key mapping
    map <leader>wm :WMToggle<cr>

"miniBufExplorer setting
"enable vim direction key(hjkl)
let g:miniBufExplMapWindowNavVim = 1

"enable <tab> to change buffers
let g:miniBufExplMapCTabSwitchBufs = 1

"force MBE to try to place selected buffers into a window that does not
"have a nonmodifiable buffer
let g:miniBufExplModSelTarget = 1

"make tabs show complete (no broken on two lines)
let g:miniBufExplTabWrap = 1

"always show minibufexpl
"this can prevent multiple instances of minubufexpl
let g:miniBufExplorerMoreThanOne = 0

"===================Key Mapping===================
"Save
map <C-s> :w<cr>
imap <C-s> <Esc>:w<cr>a

"Copy
map <C-c> "+y

"Cut
map <C-x> "+x

"Paste
map <C-v> "+gP
imap <C-v> <Esc>"+gPa

"Select all
map <C-a> ggVG<cr>

"Fast editing of .gvimrc
"ep = edit profile
map <leader>ep :tabnew ~/.vimrc<cr>

"Tab configuration
"Open new tab
map <leader>to :tabnew %<cr>

"Next tab
map <leader>n :tabnext<cr>

"Pre tab
map <leader>p :tabpre<cr>

"Source helptags
map <leader>ht :helptags ~/.vim/doc<cr>

"map quickComment
map <leader>c .c
map <leader>C .C

"===================Auto command===============================
"auto switch to the dir where the file locates
au BufNewFile,BufRead * :cd %:p:h

 

最后来个效果图,这样就有图有真相了~呵呵

 

 

 

 

Avatar_small
gombiuda 说:
2009年10月18日 15:00

好短啊,羡慕……

Avatar_small
IAmL 说:
2009年10月18日 23:55

@gombiuda: 还没配好滴,而且我只把vim当成是文本编辑器,而不是把它当成一个os- -

Avatar_small
zausiu 说:
2011年11月16日 23:51

我也配过vim写代码。实在太低效。再也不用vim写代码了.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter