-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
263 lines (208 loc) · 5.63 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
""vundle setting
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
""plugin host on github
Plugin 'rizzatti/dash.vim'
Plugin 'Yggdroot/indentLine'
Plugin 'scrooloose/nerdcommenter'
Plugin 'Valloric/YouCompleteMe'
Plugin 'ervandew/supertab'
Plugin 'scrooloose/nerdtree'
Plugin 'bling/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/ctrlp.vim'
Plugin 'majutsushi/tagbar'
Plugin 'tpope/vim-fugitive'
Plugin 'scrooloose/syntastic'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'Shougo/neocomplcache'
Plugin 'vim-scripts/AutoClose'
Plugin 'Lokaltog/vim-easymotion'
Plugin 'fholgado/minibufexpl.vim'
Plugin 'tomasr/molokai'
Plugin 'tpope/vim-surround'
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Plugin 'pangloss/vim-javascript'
Plugin 'Glench/Vim-Jinja2-Syntax'
Plugin 'beautify-web/js-beautify'
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'mileszs/ack.vim'
Plugin 'Valloric/vim-operator-highlight'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'mxw/vim-jsx'
"" Plugin 'klen/python-mode'
""Plugin 'c.vim'
Plugin 'Emmet.vim'
call vundle#end()
filetype plugin indent on
""end of vundle
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set nu
set mouse=a
syntax enable
colorscheme molokai
set background=dark
set nofoldenable
"
"
filetype on
filetype plugin on
filetype indent on
set nobackup "禁止自动备份
set autoread "文件改动自动加载
set cursorline "行光标下划线
set wildmenu
set ruler
set scrolljump=10 "光标距顶部/底部多少行滚动
set showmatch "显示匹配
set hlsearch
set autoindent "自动缩进
set tabstop=4
set ignorecase "搜索忽视大小写
set helplang=cn "中文帮助
set softtabstop=4
set shiftwidth=4
set expandtab
set autochdir
set incsearch
set backspace=indent,eol,start
" 定义快捷键前缀
let mapleader=" "
"" 直接使用系统粘贴板
set clipboard=unnamed
""""""python
au FileType python set cc=80 " 在80列显示对齐线
au FileType python set tw=79 " python文件文本最长宽度为79
hi ColorColumn ctermbg=234
"""""" line num color
highlight LineNr ctermfg=59 ctermbg=black
highlight Search ctermfg=59 ctermbg=231
""""""
set fillchars=""
hi VertSplit ctermbg=NONE
""encoding setting
set fenc=utf-8
set encoding=utf-8
set fileencodings=utf-8,gbk
set termencoding=utf-8
""normal using map
imap jj <Esc>
nmap <leader>q :q<CR>
nmap <leader>w :w<CR>
nmap <leader>h :noh<CR>
nmap ta 0
nmap te $
"" Tagbar set
nmap tt :TagbarToggle<CR>
set tags=tags;
let g:tagbar_ctags_bin = "/usr/local/bin/ctags"
"" NerdTree set
nmap mm :NERDTreeToggle<CR>
let NERDTreeShowFiles = 1
let NERDChristmasTree = 1
let NERDTreeHighlightCursorline = 1
let NERDTreeShowBookmarks = 1
let NERDTreeDirArrows = 1
let NERDTreeIgnore=['\.py[co]$', '__pycache__']
nmap fh <c-w>h
nmap fj <c-w>j
nmap fk <c-w>k
nmap fl <c-w>l
""powerline
set laststatus=2
set t_Co=256
set encoding=utf8
let g:python_author='RobertDing'
let g:python_email='[email protected]'
"Python 注释
function InsertPythonComment()
exe 'normal'.1.'G'
let line = getline('.')
if line =~ '^#!.*$' || line =~ '^#.*coding:.*$'
return
endif
normal O
call setline('.', '#!/usr/bin/env python')
normal o
call setline('.', '# -*- coding:utf-8 -*-')
normal o
call setline('.', '#')
normal o
call setline('.', '# Author : '.g:python_author)
normal o
call setline('.', '# E-mail : '.g:python_email)
normal o
call setline('.', '# Date : '.strftime("%y/%m/%d %H:%M:%S"))
normal o
call setline('.', '# Desc : ')
normal o
call setline('.', '#')
call cursor(7, 17)
endfunction
" F4 添加Python注释
au FileType python map <F4> :call InsertPythonComment()<cr>
function InsertCommentWhenOpen()
if line('$') == 1 && getline(1) == ''
call InsertPythonComment()
end
endfunc
" 打开Python文件自动添加注释
au FileType python :call InsertCommentWhenOpen()
"""" tagbat
" 按位置排序
let g:tagbar_sort = 0
"""" emmet
"" leader key
let g:user_emmet_leader_key = ";e"
"""" easy-motion
"" 两端查找字符
nmap <leader><leader>a <Plug>(easymotion-s)
""""rainbow parenthese
let g:rbpt_colorpairs = [
\ ['darkgray', 'DarkOrchid3'],
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
"""" molokai
let g:molokai_original=1
let g:rehash256=1
hi String ctermfg=59
"""" operator color
let g:ophigh_color = "Green"
"""" pymode
let g:pymode_rope = 0
let g:pymode_lint_ignore = "E501"
"""" airline
let g:airline_powerline_fonts=1
let g:airline#extensions#syntastic#enabled=1
let g:airline#extensions#tagbar#enabled=1
let g:airline#extensions#tmuxline#enabled=1
let g:airline_theme='powerlineish'
"""" dash
nmap <silent> <leader>d <Plug>DashSearch
"""" snippets configuration
let g:UltiSnipsExpandTrigger='<c-t>'
"""" ctrlp
let g:ctrlp_map='<leader>p'
set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,/*.pyc,*/node_modules " Linux/MacOSX