vim编辑器如若需要很好的使用,则必须配置好vimrc文件,如下为个人最近配置,包含基本的命令,ctag,映射等
1 set nocompatible
2 "source $VIMRUNTIME/mswin.vim3 "set guifont=Courier:h10
4 "source ~/.vim/indent/verilog.vim
5 set guifont=Andale\ Mono\ 16
6 set number
7 "set ffs=dos
8 "set lines=42
9 "set tabstop=4
10 "set shiftwidth=4
11 set tabstop=4 shiftwidth=4 expandtab
12 "display file path in bottom
13 set ls=2
14 "set smartindent
15 "
16 "show the full path of the current editing file
17 set statusline+=%F
18 "use file type plugin indent, it will work for verilog
19 filetype plugin indent on
20 set noswf
21 hi linenr guifg=blue
22 set ic
23 "use a nicer color scheme
24 color desert
25 "incremental search
26 set is
27 syn on
28 set hlsearch
29 set nu
30 "map <F5> :e!<CR>G:/error\\|warning<CR>G
31 "map <F6> :e!<CR>G:sleep 1<CR><F6>
32 "automatically set current path be the current file path
33 "au BufEnter * silent! lcd expand("%:p:h")
34 set autochdir
35
36 " gV: donnot automatically reselct one area after command is executed
37 "map <C-R> :!comment.bat<CR>gV<CR>
38 "map <C-T> :!uncomment.bat<CR>gV<CR>
39 "use three slash plus space for space in file
40
41 "artis01 setting
42 set tags=./tags,../tags,../../tags,../../../tags,../../../../tags,/home/panqs/s60-repo-bare/tags
43 "map <F9> :cd /home/panqs/trunk/source/bin\|make -j8<cr>
44 "map <F5> yiw:cd /home/panqs/trunk\|L <c-r>0
45 "map <F6> yiw:cd /home/panqs/trunk/\|G <c-r>0
46 set path=./,/home/panqs/s60-repo-bare/source/include
47
48
49 "comment out block of lines using //
50 "<Esc> out of select mode
51
52 "comment for C++
53 "au BufEnter *.cpp vmap <F7> :g/^/s//\/\//g<CR>gV<Esc>:noh<CR>
54 "comment for Perl
55 "au BufEnter *.pl vmap <F7> :g/^/s//\#/g<CR>gV<Esc>:noh<CR>
56 "comment for tex
57 "au BufEnter *.tex vmap <F7> :g/^/s//%/g<CR>gV<Esc>:noh<CR>
58 "uncomment out block of lines
59 au BufEnter *.cpp vmap <F8> :g/^/s/\s\=\/\///g<CR>gV<Esc>:noh<CR>
60 au BufEnter *.pl vmap <F8> :g/^/s/\s\=\#//g<CR>gV<Esc>:noh<CR>
61 "au BufEnter *.tex vmap <F8> :g/^/s/\s\=%//g<CR>gV<Esc>:noh<CR>
62 "
63 "use F9 to trigger build
64
65 map <F7> :copen <CR>
66 "map <F5> yiw:cd ~/artis01doc/fpga_dev\|L <c-r>0
67 "map <F6> yiw:cd ~/artis01doc/fpga_dev/fpga\|G <c-r>0
68 "map <F5> yiw:cd ~/pj1304code\|L <c-r>0
69 "map <F6> yiw:cd ~/pj1304code\|G <c-r>0
70 map <F3> :let @"=expand("%:p")<CR>
71 vnoremap <M-F8> =gV
72 "let Grep_Key = '<F9>'
73 "let Grep_Path = 'C:\WINNT\system32\grep.exe'
74 "let Fgrep_Path = 'C:\WINNT\system32\fgrep.exe'
75 "let Egrep_Path = 'C:\WINNT\system32\egrep.exe'
76 "let Grep_Find_Path = 'c:\WINNT\system32\find.exe'
77 "let Grep_Xargs_Path = 'c:\WINNT\system32\xargs.exe'
78 "let Grep_Default_Options = '-i -r'
79
80 "inoremap \f <C-R>=Func()<CR>
81
82 "function! Func()
83 "let cmd = "perl c:/gtang/test.pl " . expand("%:p")
84 "let retValue = system(cmd)
85 "return retValue
86 "endfunction
87
88 "au BufEnter * cd %:p:h
89
90 au BufRead,BufNewFile *.md set syntax=markdown
91
92 "------------------ for latex------------------
93 "REQUIRED. This makes vim invoke latex-suite when you open a tex file.
94 filetype plugin on
95
96 " IMPORTANT: win32 users will need to have 'shellslash' set so that latex
97 " can be called correctly.
98 set shellslash
99
100 " IMPORTANT: grep will sometimes skip displaying the file name if you
101 " search in a singe file. This will confuse latex-suite. Set your grep
102 " program to alway generate a file-name.
103 "set grepprg=grep\ -nH\ $*
104
105 " OPTIONAL: This enables automatic indentation as you type.
106 "filetype indent on
107 "------------------------------------------------ end
108 "
109
110 "hookup to git grep
111 func GitGrep(...)
112 let save = &grepprg
113 set grepprg=git\ grep\ -n\ $*
114 let s = 'grep'
115 for i in a:000
116 let s = s . ' ' . i
117 endfor
118 exe s
119 let &grepprg = save
120 endfun
121 command -nargs=? G call GitGrep(<f-args>)
122
123 func Gitls(...)
124 let save = &grepprg
125 set grepprg=gitls\ $*
126 let s = 'grep'
127 for i in a:000
128 let s = s . ' ' . i
129 endfor
130 exe s
131 let &grepprg = save
132 endfun
133 command -nargs=? L call Gitls(<f-args>)
134
135
136 "try to display sonoscape code which is commented in cp936 encoding
137 let &fileencodings = substitute(&fileencodings, 'latin1', 'cp936,\0', '')
138
139
140 "enable me to go through windows using tab key
141 nmap <tab> <c-w>w
142 nmap <S-tab> <c-w>W
143 "set cursorline cursorcolumn
144 "
145
146 "this will let the process keep on running
147 let g:ConqueTerm_ReadUnfocused = 1
148