-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·238 lines (200 loc) · 6.52 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
Plugin 'MarcWeber/vim-addon-mw-utils'
Plugin 'tomtom/tlib_vim'
Plugin 'garbas/vim-snipmate'
" Optional:
Plugin 'honza/vim-snippets'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList - lists configured plugins
" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
"=---------------------------------------------------------------------------=
"=---------------------------------------------------------------------------=
"
" SYSTEM
"
"=---------------------------------------------------------------------------=
"=---------------------------------------------------------------------------=
" define path
if has("win32")
let $VIMFILES = $HOME.'/vimfiles'
let $V = $HOME.'/_vimrc'
else
let $VIMFILES = $HOME.'/.vim'
let $V = $HOME.'/.vimrc'
endif
let $VIMWIKI = $HOME.'/htdocs/cloud/doc/'
" encoding settings
set enc=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set fileencodings=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
set nobomb
" language settings
set langmenu=zh_CN.UTF-8
language message zh_CN.UTF-8
set helplang=cn
" forbid generating temp file
set nobackup
" persistent undo
set undofile
set undodir=$VIMFILES/\_undodir
set undolevels=1000 "maximum number of changes that can be undone
"=---------------------------------------------------------------------------=
" style
"=---------------------------------------------------------------------------=
" scheme
colorscheme evening
" font
" font for MacVim
if has("gui_macvim")
set guifont=Monaco:h15
"set guifontwide=Hei:h15
endif
" font for gvim
if has("win32")
set guifont=Consolas:h11
endif
" tab width
set shiftwidth=2
set tabstop=2
" auto indent
set ai!
" file type check
filetype plugin indent on
" syntax highlight
sy on
" auto complete
set completeopt=longest,menu
" hide top menu
set go=
" show line number
set nu!
hi LineNr guifg=#666666
" auto line break, support Chinese
"set tw=78 fo+=Mm
"set colorcolumn=79
"hi ColorColumn guibg=#354248
"=---------------------------------------------------------------------------=
" search & replace
"=---------------------------------------------------------------------------=
set ignorecase
set incsearch
set gdefault
set hlsearch
map <ESC> :nohlsearch<cr>
"=---------------------------------------------------------------------------=
"=---------------------------------------------------------------------------=
"
" PLUGINS
"
"=---------------------------------------------------------------------------=
"=---------------------------------------------------------------------------=
"=---------------------------------------------------------------------------=
" zencoding
"=---------------------------------------------------------------------------=
let g:user_zen_settings = {
\ 'indentation' : ' ',
\ 'perl' : {
\ 'aliases' : {
\ 'req' : 'require '
\ },
\ 'snippets' : {
\ 'use' : "use strict\nuse warnings\n\n",
\ 'warn' : "warn \"|\";"
\ }
\ }
\}
let g:user_zen_expandabbr_key = '<c-e>'
let g:use_zen_complete_tag = 1
"=---------------------------------------------------------------------------=
" Nerdtree
"=---------------------------------------------------------------------------=
map <F4> :NERDTreeToggle<CR>
let NERDTreeWinPos ="left"
let NERDTreeShowBookmarks=1
let NERDTreeBookmarksFile=$VIMFILES."\\.NERDTreeBookmarks"
let NERDTreeIgnore=['node_modules']
"=---------------------------------------------------------------------------=
" vimwiki
"=---------------------------------------------------------------------------=
"vimwiki
let g:vimwiki_list = [
\ {
\ 'path': $VIMWIKI.'vimwiki',
\ 'nested_syntaxes': {
\ 'py': 'python',
\ 'glsl': 'glsl',
\ 'js': 'javascript',
\ 'java': 'java',
\ 'php': 'php',
\ 'html': 'html',
\ 'css': 'css',
\ 'less': 'less',
\ 'sql': 'mysql'
\ },
\ 'path_html': $VIMWIKI.'vimwiki/output/html',
\ 'template_path': $VIMWIKI.'vimwiki/output/tpl/',
\ 'template_default': 'common.htm',
\ 'diary_link_count': 5
\ },
\ {
\ 'template_default': 'common.htm',
\ 'path': $VIMWIKI.'vimark',
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ 'diary_link_count': 5
\ }
\]
"calendar
map <F7> :Calendar<cr>
" todo list
map <F8> :VimwikiToggleListItem<cr>
"=---------------------------------------------------------------------------=
" Taglist
"=---------------------------------------------------------------------------=
let Tlist_Show_One_File = 1
let Tlist_Exit_OnlyWindow = 1
let Tlist_Use_Right_Window = 1
let Tlist_GainFocus_On_ToggleOpen = 1
let Tlist_JS_Settings = 'javascript;s:string;a:array;o:object;f:function'
map <F3> :Tlist<CR>
"=---------------------------------------------------------------------------=
" indent guide
"=---------------------------------------------------------------------------=
let g:indent_guides_enable_on_vim_startup = 1
let g:indent_guides_color_change_percent = 3
"=---------------------------------------------------------------------------=
" less
"=---------------------------------------------------------------------------=
au BufNewFile,BufRead *.less set filetype=css
"=---------------------------------------------------------------------------=
" typescript
"=---------------------------------------------------------------------------=
au BufNewFile,BufRead *.ts set filetype=javascript
"=---------------------------------------------------------------------------=
" processing
"=---------------------------------------------------------------------------=
map <F5> :make<cr>
let $PROCESSINGDIR = $HOME.'/htdocs/cloud/project/demo/processing/'
command -nargs=1 Processing !mkdir $PROCESSINGDIR"<args>" | touch $PROCESSINGDIR"<args>"/"<args>".pde