-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path_vimrc
239 lines (188 loc) · 4.9 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
""""""""""""""""""""""""""""""""""""""""""""
" Created by David Xie
" E-mail : [email protected]
" Blog : http://davidx.me/
" CreatedTime : 2009-02-06 14:03
" LastModified : 2011-07-05 15:26
" Version : 2.0
""""""""""""""""""""""""""""""""""""""""""""
" turn off compatible
set nocompatible
" history
set history=400
" call pathogen
call pathogen#infect()
" turn on plugin and indent
filetype plugin on
filetype indent on
" auto read file when changed
set autoread
" active mouse
set mouse=a
" enable syntax support
syntax enable
" import mswin.vim
source $VIMRUNTIME/mswin.vim
behave mswin
" auto reload .vimrc
autocmd! bufwritepost .vimrc source ~/.vimrc
autocmd BufRead,BufNewFile *.md set filetype=markdown
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => fonts and colors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
if has("gui_running")
set background=dark
" set colorscheme
"colorscheme ir_black
"colorscheme solarized
colorscheme merbivore
if has("mac") || has("gui_macvim")
set lazyredraw
"set guifont=dejaVu\ Sans\ MONO:h14
set guifont=Ubuntu\ Mono:h16
else
"set guifont=dejaVu\ Sans\ MONO\ 11
set guifont=Ubuntu\ Mono\ 12
endif
if has("win32")
set guifont=Consolas:h14
endif
else
colorscheme desert
endif
" highlight current line
set cursorline
hi cursorline guibg=#222222
hi CursorColumn guibg=#333333
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => files and backup
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" turn off backup and swap
set nobackup
set nowb
set noswapfile
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => folding
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" turn on folding
set nofen
set fdl=0
set fdm=indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => word processing
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" use spaces for tab
au filetype python set expandtab
" all tab are 4 spaces
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
" don't break line
set lbr
set list
set lcs=tab:>.,eol:<,nbsp:%,trail:.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => indent
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" auto indent
set ai
" wrap
set wrap
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Vim Interface
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" remove toolbar and menu
set guioptions-=m
set guioptions-=T
" turn on wild menu
set wildmode=longest,list
set wildmenu
" show ruler
set ruler
" set command line height to 1
set cmdheight=1
" show line number
set nu
" do not redraw, when running macros.. lazyredraw
set lz
" set backspace
set backspace=eol,start,indent
" backspace and cursor keys wrap to
set whichwrap+=<,>,h,l,b,s,[,]
" set magic on
set magic
" turn off bells
set noerrorbells
set novisualbell
" pair matching
set showmatch
set matchpairs=(:),{:},[:],<:>
" How many tenths of a second to blink
set mat=2
" highlight research
set hlsearch
" set scroll
set sj=1 so=3
" when split, use same height and width
set equalalways
set colorcolumn=81
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => encoding
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"encoding
set encoding=utf-8
"file encoding
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Command Line
""""""""""""""""""""""""""""""""""""""""""""""""""""""
"turn on command line
set laststatus=2
"function of show infomation of current file
function! CurDir()
let curdir = substitute(getcwd(), '/Users/amir/', "~/", "g")
return curdir
endfunction
"format statusline
set statusline=\ %F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L:%c
hi statusline guifg=red guibg=white
""""""""""""""""""""""""""""""""""""""""""""""""""""""
" => Tab Line
""""""""""""""""""""""""""""""""""""""""""""""""""""""
set showtabline=1
"""""""""""""""""""""""""""""""
" OS Special
"""""""""""""""""""""""""""""""
if has("mac")
let g:tagbar_ctags_bin='/usr/local/bin/ctags'
endif
"""""""""""""""""""""""""""""""
" => snipMate
"""""""""""""""""""""""""""""""
if exists('$TMUX') " Support resizing in tmux
set ttymouse=xterm2
endif
"""""""""""""""""""""""""""""""
" => shortcuts
"""""""""""""""""""""""""""""""
" set leader key to ','
let mapleader = ","
let g:mapleader = ","
" set shortcuts for save and quit
nmap <leader>s :w!<cr>
nmap <leader>w :wq!<cr>
nmap <leader>q :q!<cr>
" NerdTree
map <F5> :NERDTreeToggle<CR>
" TabBar
map <F6> :TagbarToggle<CR>
" QuickBuf
let qb_hotkey="<F4>"
" SnipMate
ino <c-j> <c-r>=TriggerSnippet()<cr>
snor <c-j> <esc>i<right><c-r>=TriggerSnippet()<cr>
" CtrlP
nmap <leader>t :CtrlP<CR>
" GitGutter
nmap <leader>g :GitGutterToggle<CR>