首页 > Personal > Linux > gvim 启动配置_vimrc
2011
01-14

gvim 启动配置_vimrc

如果是vsvim,在home目录下创建_vsvimrc文件,home为用户目录下你的用户名目录
set nocompatible

set imcmdline
set guifont=Serif\ 14

set encoding=utf8
language message zh_CN.UTF-8
set termencoding=utf-8
set fileencoding=chinese
set fileencodings=ucs-bom,utf-8,chinese
set langmenu=zh_CN.utf-8
source $VIMRUNTIME/delmenu.vim
source $VIMRUNTIME/menu.vim
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
let opt = ‘-a –binary ‘
if &diffopt =~ ‘icase’ | let opt = opt . ‘-i ‘ | endif
if &diffopt =~ ‘iwhite’ | let opt = opt . ‘-b ‘ | endif
let arg1 = v:fname_in
if arg1 =~ ‘ ‘ | let arg1 = ‘”‘ . arg1 . ‘”‘ | endif
let arg2 = v:fname_new
if arg2 =~ ‘ ‘ | let arg2 = ‘”‘ . arg2 . ‘”‘ | endif
let arg3 = v:fname_out
if arg3 =~ ‘ ‘ | let arg3 = ‘”‘ . arg3 . ‘”‘ | endif
let eq = ”
if $VIMRUNTIME =~ ‘ ‘
if &sh =~ ‘\<cmd’
let cmd = ‘””‘ . $VIMRUNTIME . ‘\diff”‘
let eq = ‘”‘
else
let cmd = substitute($VIMRUNTIME, ‘ ‘, ‘” ‘, ”) . ‘\diff”‘
endif
else
let cmd = $VIMRUNTIME . ‘\diff’
endif
silent execute ‘!’ . cmd . ‘ ‘ . opt . arg1 . ‘ ‘ . arg2 . ‘ > ‘ . arg3 . eq
endfunction

” Persistent undo
if has (‘persistent_undo’)
set undodir=~/.vim/undodir
set undofile
set undolevels=1000 “maximum number of changes that can be undone
set undoreload=10000 “maximum number lines to save for undo on a buffer reload
endif

” undo list
set hidden

syntax on
set nowrap
set backspace=2
set ruler
set showmatch

set noswapfile
set nobackup
set hlsearch
set incsearch
set nu
set autoindent
set smartindent
set cindent
set tabstop=2
set shiftwidth=2
set expandtab
set ignorecase smartcase
set guioptions-=T
set guioptions-=m
set modeline

map <MiddleMouse> <Nop>
imap <MiddleMouse> <Nop>
map <2-MiddleMouse> <Nop>
imap <2-MiddleMouse> <Nop>
map <3-MiddleMouse> <Nop>
imap <3-MiddleMouse> <Nop>
map <4-MiddleMouse> <Nop>
imap <4-MiddleMouse> <Nop>

hi Normal guibg=#CBE8CA

set tags=tags;

set mouse=a
set autowriteall
set cino=g1h1i2:0
run cscope.vim

map <C-g> :BufExplorer<CR>
let g:bufExplorerDefaultHelp=0
let g:bufExplorerShowRelativePath=1

autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o
au FileType c,cc,cpp,h setlocal comments-=:// comments+=f://

autocmd FileType c,cc,cpp,h,js,lua,java set expandtab | set shiftwidth=2

 

创建文件 ~/.vimrc 将上面内容拷入文件。

创建文件夹 ~/.vim 将下面附件解压后拷入文件夹中, 在~/.vim 文件夹中创建文件夹 undodir 用于存储undo缓存。

插件文件    vim

最后编辑:
作者:wy182000
这个作者貌似有点懒,什么都没有留下。

留下一个回复