set encoding=utf-8
set termencoding=utf-8
set fileencodings=utf-8
set expandtab
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" "
" Description: My gVim configuration file. "
" "
" Author: fender0107401 "
" "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for vi incompatible model
set nocompatible
" for security
set nomodeline
" set font
set guifont:DejaVu\ Sans\ Mono\ 12
" show cursor position
set ruler
" history size
set history=100
" automatic save
set autowrite
" initial window size
set lines=35
set columns=111
" initial window position
winpos 413 147
" hide the mouse
set mousehide
" highlight current line
set cursorline
" highlight search
set hls
" language
setlocal spell spelllang=en_us
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for map
map :wall:3:wall
map :wall
map :wqall
map :wall:!make;
map :wall:!make clean;
map :wall:let NERDTreeIgnore=[]
map :wall:let NERDTreeIgnore=['README', '\.txt$','Makefile','tags','cscope.in.out','cscope.out','cscope.po.out']
map :wall:cs reset1G=G:%s/\s*$//:noh3
map :wall:10:wall
map :wall:NERDTreeToggle
map :wall:source /home/fender/.gvimrc:noh
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for comment
abbreviate cc1 /******************************************************************************/
abbreviate cc2 /* */
abbreviate cc3 #ifdef DEBUG
abbreviate cc4 #endif
abbreviate cc5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
abbreviate cc6 ################################################################################
" for spell
set spellsuggest=5
set spellfile=~/.vim/spellfile.add
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for programming
" line number
set number
set numberwidth=5
" syntax highlight
syntax enable
" indent
set nosmartindent
set autoindent
set cindent shiftwidth=8
set tabstop=8
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for fold
set foldmethod=syntax
set foldlevel=7
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for gui cursor blinking
set guicursor=a:blinkwait0
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for nerd tree
let NERDTreeWinSize=25
let NERDTreeSortOrder=['README', '\.txt$', '\.c$', '\.h$', '\/$']
let NERDTreeIgnore=['README', '\.txt$','Makefile','tags','cscope.in.out','cscope.out','cscope.po.out']
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" don't auto change current directory
set noacd
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" remove menu and toolbar
set guioptions-=T
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" for cscope
" Find functions calling this function
map cc :cs find c =expand("")
" Find functions called by this function
map cd :cs find d =expand("")
" Find this egrep pattern
map ce :cs find e =expand("")
" Find this file
map cf :cs find f =expand("")
" Find this definition
map cg :cs find g =expand("")
" Find files including this file
map ci :cs find i =expand("")
" Find this C symbol
map cs :cs find s =expand("")
" Find assignments to
map ct :cs find t =expand("")
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" ctags
set tags=tags
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! FoldSpellBalloon()
let foldStart = foldclosed(v:beval_lnum)
let foldEnd = foldclosedend(v:beval_lnum)
let lines = []
" Detect if we are in a fold
if foldStart >= 0
" we are in a fold
let numLines = foldEnd - foldStart + 1
" if we have too many lines in fold, show only the first 15 and the last 15 lines
if ( numLines > 31 )
let lines = getline(foldStart, foldStart + 15)
let lines += ['-- Snipped ' . (numLines - 30) . ' lines --']
let lines += getline(foldEnd - 15, foldEnd)
else
"less than 30 lines, lets show all of them
let lines = getline(foldStart, foldEnd)
endif
endif
" return result
return join( lines, has("balloon_multiline") ? "\n" : " ")
endfunction
set balloonexpr=FoldSpellBalloon()
set ballooneval
set balloondelay=50
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
let g:tex_flavor='latex'
autocmd BufRead,BufNewFile *.tex set filetype=tex
autocmd BufRead,BufNewFile *.m set filetype=octave
autocmd BufRead,BufNewFile *.plt set filetype=gnuplot
autocmd BufRead,BufNewFile *.txt set filetype=cmake
autocmd BufRead,BufNewFile *.h set equalprg=indent
autocmd BufRead,BufNewFile *.c set equalprg=indent
autocmd BufRead,BufNewFile *.c syn region myFold start="#ifdef" end="endif" transparent fold
autocmd BufRead,BufNewFile *.pl set filetype=perl
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
阅读(1799) | 评论(0) | 转发(0) |