2 " $Id: .vimrc,v 1.6 2006/04/20 01:59:18 arrow Exp $
3 "Author:arrow <arrow_zhang@sdc.sercomm.com>
5 if v:progname =~? "evim"
9 " Use Vim settings, rather then Vi settings (much better!).
10 " This must be first, because it changes other options as a side effect.
13 "set nobackup " do not keep a backup file, use versions instead
15 set backupdir=~/.tmp,/tmp,./
16 set backup " keep a backup file
18 "set nobackup " do not keep a backup file, use versions instead
19 set history=100 " keep 50 lines of command line history
20 set ruler " show the cursor position all the time
21 set showcmd " display incomplete commands
22 set incsearch " do incremental searching
24 " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
25 " let &guioptions = substitute(&guioptions, "t", "", "g")
26 " Don't use Ex mode, use Q for formatting
30 "set guifontset="-adobe-courier-medium-r-normal--14-140-75-75-m-90-iso8859-1,WenQuanYi Bitmap Song:style=medium"
37 "set format when coding
38 filetype plugin indent on
43 set cinoptions=>8,n-8,{8,^-8,:8,=8,g8,h8,p8,t8,+8,(8,u8,w1,m1 shiftwidth=8 tabstop=8
44 "set cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1 shiftwidth=8 tabstop=8
47 "set indentexpr=GetMyIndent()
48 "set paste "it will disable all last set
55 if &t_Co > 2 || has("gui_running")
59 nmap <F2> :nohlsearch<CR>
61 nmap <F4> :set noscrollbind<CR>:set scrollopt=<CR>:set nowrap<CR>:set foldmethod=manual<CR>:set foldcolumn=0<CR>:only<CR>zR
62 nmap <F5> :set tags-=/usr/include/tags<CR>
63 nmap <F6> :set tags+=/usr/include/tags<CR>
64 " allow backspacing over everything in insert mode
65 set backspace=indent,eol,start
69 set formatoptions=croqlmM
72 set statusline=%((%1*%M%*%R%Y)%)%f%=%(\[%3l-%02c]%)[%03b/%02B]T9\ %P~%L
73 "set tags=./tags,/usr/include/tags,./TAGS,tags,TAGS
75 "next line will set tag
76 "au BufEnter /home/my/proj1/* setlocal tags+=/home/my/proj1/tags
77 "au BufEnter /code/wnr834b/netgear/src/router setlocal tags+=/code/wnr834b/netgear/src/router/www/cgi/setup/tags
80 set fileencoding=utf-8
81 set fileencodings=utf-8,chinese,ucs-bom
85 " Only do this part when compiled with support for autocommands.
86 " Enable file type detection.
87 " Use the default filetype settings, so that mail gets 'tw' set to 72,
88 " 'cindent' is on in C files, etc.
89 " Also load indent files, to automatically do language-dependent indenting.
91 filetype plugin indent on
93 " For all text files set 'textwidth' to 78 characters.
94 "autocmd FileType text setlocal textwidth=78
96 " When editing a file, always jump to the last known cursor position.
97 " Don't do it when the position is invalid or when inside an event handler
98 " (happens when dropping a file on gvim).
100 autocmd BufReadPost *
101 \ if line("'\"") > 0 && line("'\"") <= line("$") |
102 \ exe "normal g`\"" |
105 "au BufReadPost *.c TlistToggle
106 " au BufRead *.c setlocal formatprg=indent
107 " au BufRead *.h setlocal formatprg=indent
108 " au BufNewFile *.c setlocal formatprg=indent
109 " au BufNewFile *.h setlocal formatprg=indent
110 " au BufRead *.txt setlocal formatprg=fmt
111 " au BufNewFile *.txt setlocal formatprg=fmt
113 au FileType c set formatprg=indent
114 au FileType cpp set formatprg=indent
115 "au BufRead *.c set formatprg=indent
116 "au BufRead *.h set formatprg=indent
117 if !exists("auto_arrow_c")
119 au BufNewFile *.c 0r ~/.vim/files/c.skel
120 "au BufNewFile *.c normal gnp
121 au BufNewFile *.h 0r ~/.vim/files/h.skel
122 au BufNewFile *.sh 0r ~/.vim/files/sh.skel
123 au BufNewFile *.txt 0r ~/.vim/files/txt.skel
124 au BufNewFile Makefile 0r ~/.vim/files/makefile.skel
125 au BufNewFile Rules.make 0r ~/.vim/files/Rules.make.skel
126 ":%s/_filename_/\=bufname("%")
127 :"%s/_datetime_/\=strftime("%c")
128 map gse <ESC>:%s/_filename_/\=bufname("%")/<CR>:%s/_datetime_/\=strftime("%c")/<CR>
129 au BufNewFile *.[ch] normal gse
130 au BufNewFile *.sh normal gse
131 "au BufNewFile *.txt normal gse
137 if has("gui_running")
139 "set guifontset=*-p-*
140 "set guifont=-wenquanyi-wenquanyi\ bitmap\ song-italic-*-normal-*-13-130-75-75-p-80-iso10646-1
143 :source $VIMRUNTIME/delmenu.vim
144 :source $VIMRUNTIME/lang/menu_en_gb.utf-8.vim
145 :source $VIMRUNTIME/menu.vim
150 set guioptions=aegimlLtT
151 " set guioptions=aegirLtb
152 " set guioptions=aegimrLtb
154 set guifont=Courier\ 12
155 " set guifont=Terminus\ Bold\ 13
156 " set guifont=Serif\ 13
157 " set guifont="-*-courier-medium-r-*-*-14-140-*-75-*-*-*-*"
162 "set Tlist_Ctags_Cmd=/usr/bin/ctags
163 let Tlist_Use_Right_Window = 1
164 "let Tlist_Process_File_Always = 1
166 "if has("cscope_arrow_commentout")
167 "nmap <C-@>s <C-W><C-S> :cs find s<C-R>=expand("<cword>")<CR><CR>
168 set csprg=/usr/bin/cscope
172 "add any database in current directory
173 if filereadable("cscope.out")
175 "else add database pointed to by environment
176 elseif $CSCOPE_DB != ""
181 "set cscopequickfix=s-,g-,c-,d-,t-,e-,f-,i-
184 "let loaded_project = 1
186 ":language time en_US
187 ":language ctype en_US
188 ":language messages en_US
192 ":language messages C
202 "want make the shell work normal when gvim
206 "set imactivatekey=C-space
207 "inoremap <ESC><ESC>:set iminsert=2<CR>
208 ":inoremap <ESC> <ESC>:set iminsert=0<CR>
210 "set guicursor="sm:blinkon0"
211 "set guicursor="guicursor=n-v-c:block-Cursor/lCursor,ve:ver35-Cursor,o:hor50-Cursor,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor,sm:block-Cursor-blinkwait175-blinkoff150-blinkon175"
212 ":highlight "Cursor gui=NONE guifg=bg guibg=fg"
213 "check the spell right, key press it direct under command mode
214 "setlocal spell spelllang=en_US
217 "set g:session_dir=/home/arrow/.vim#
218 let g:SessionMgr_Dir="."
219 let g:SessionMgr_DefaultName="arrow.vim"
220 let g:SessionMgr_AutoManage=0
224 "if exists('b:current_syntax') && b:current_syntax =~ "cvs"
227 "my color set for search
228 hi IncSearch term=reverse cterm=reverse gui=reverse
229 "hi Search term=reverse ctermbg=darkmagenta ctermfg=white guibg=darkmagenta guifg=white
230 "hi IncSearch term=reverse ctermbg=darkmagenta ctermfg=white guibg=darkmagenta guifg=white
231 hi Search term=reverse ctermbg=darkmagenta ctermfg=white guibg=darkmagenta guifg=white
232 "hi Cursor gui=reverse guifg=lightgreen guibg=cyan
233 hi Cursor gui=reverse guifg=darkcyan guibg=white
235 let g:vikiUseParentSuffix=1
236 let g:vikiOpenUrlWith_mailto = 'mail %{URL}'
237 let g:vikiOpenFileWith_html = "silent !firefox %{FILE}"
238 let g:vikiOpenFileWith_ANY = "silent !gvim %{FILE}"
240 if !exists("b:convertedPDF")
241 exec "cd ". expand("%:p:h")
242 exec "%!pdftotext ". expand("%:t") ." -"
245 setlocal noswapfile buftype=nowrite
246 let b:convertedPDF = 1
249 let g:vikiOpenFileWith_pdf = 'call VikiOpenLink("%{FILE}", "", 1)|silent call ConvertPDF()'
250 let g:deplatePrg = "deplate -x -X "
251 au FileType viki compiler deplate
252 let g:vikiNameSuffix=".viki"
253 autocmd! BufRead,BufNewFile *.viki set filetype=viki
254 autocmd! BufRead,BufNewFile $HOME/viki/* set filetype=viki
255 set mousehide " Hide the mouse when typing text
256 set mousemodel=extend
258 set path=.,include,/usr/include,,