-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
244 lines (176 loc) · 5.36 KB
/
Copy pathvimrc
File metadata and controls
244 lines (176 loc) · 5.36 KB
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
let $PYTHONPATH .= "/Library/Python/2.7/site-packages"
set rtp+=$GOROOT/misc/vim
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"set rtp+=~/.vim/bundle/vundle/
"set rtp+=~/.vim/bundle/plugin/
"call vundle#rc()
" let Vundle manage Vundle
" required!
"Plugin 'gmarik/vundle'
Plugin 'VundleVim/Vundle.vim'
" My Plugins here:
"Plugin 'https://github.com/klen/python-mode.git'
Plugin 'https://github.com/tpope/vim-surround.git'
Plugin 'https://github.com/kien/ctrlp.vim.git'
Plugin 'https://github.com/sjl/gundo.vim.git'
Plugin 'repeat.vim'
"Plugin 'https://github.com/vim-scripts/VimClojure.git'
"Plugin 'https://github.com/kchmck/vim-coffee-script.git'
" only use YO for pastemode
Plugin 'https://github.com/tpope/vim-unimpaired.git'
"Plugin 'https://github.com/guns/vim-clojure-static.git'
"Plugin 'https://github.com/tpope/vim-fireplace'
"Plugin 'git://github.com/tpope/vim-classpath.git'
Plugin 'https://github.com/solarnz/thrift.vim.git'
"Plugin 'https://github.com/vim-scripts/VimClojure.git'
Plugin 'https://github.com/kien/rainbow_parentheses.vim.git'
Plugin 'https://github.com/jimenezrick/vimerl.git'
Plugin 'https://github.com/fatih/vim-go.git'
Plugin 'cespare/vim-toml'
Plugin 'glib.vim'
"Plugin 'https://github.com/rust-lang/rust.vim'
"Plugin 'https://github.com/Valloric/YouCompleteMe.git'
"Plugin 'vim-scripts/paredit.vim'
"Plugin 'https://github.com/guns/vim-clojure-highlight.git'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"
" Brief help
" :PluginList - list configured bundles
" :PluginInstall(!) - install(update) bundles
" :PluginSearch(!) foo - search(or refresh cache first) for foo
" :PluginClean(!) - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Plugin command are not allowed..jj
set fileencodings=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
"set fileencodings=utf-8,usc-bom
set termencoding=utf-8
set encoding=utf-8
set linebreak
syntax enable
set syntax=on
set noeb
set confirm
set showcmd
set autoindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set smarttab
set number
set history=1000
set nobackup
set noswapfile
"set ignorecase
set hlsearch
set incsearch
set gdefault
"set enc=utf-8
"set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
"set langmenu=zh_CN.UTF-8
"set helplang=cn
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]
set laststatus=2
set ruler
set cmdheight=2
"filetype on
"
"filetype plugin on
"
"filetype indent on
set viminfo+=!
set iskeyword+=_,$,@,%,#,-
set linespace=0
"set wildmenu
set wildmode=list:longest
set backspace=2
set wrap
set whichwrap+=<,>,h,l
set formatoptions+=mM
set mouse=a
set selection=exclusive
set selectmode=mouse,key
set report=0
set shortmess=atI
set fillchars=vert:\ ,stl:\ ,stlnc:\
set showmatch
set matchtime=5
set scrolloff=3
set smartindent
autocmd filetype * set shiftwidth=4
autocmd filetype * set tabstop=4
autocmd FileType ruby,haml,erb,html,slim,yaml,scss,sass,coffee,treetop,htmldjango,clojure,javascript,sql set shiftwidth=2
autocmd FileType ruby,haml,erb,html,slim,yaml,scss,sass,coffee,treetop,htmldjango,clojure,javascript,sql set tabstop=2
nnoremap ; :
inoremap jj <ESC>
"set clipboard+=unnamed
set pastetoggle=<F9>
set ff=unix
"inoremap ( ()<LEFT>
"inoremap [ []<LEFT>
"inoremap { {}<LEFT>
"vmap <D-j> gj
"vmap <D-k> gk
"vmap <D-4> g$
"vmap <D-6> g^
"vmap <D-0> g^
"nmap <D-j> gj
"nmap <D-k> gk
"nmap <D-4> g$
"nmap <D-6> g^
"nmap <D-0> g^
set tags=tags;
"set autochdir
if has('autocmd')
function! RemoveTrailingSpace()
if $VIM_HATE_SPACE_ERRORS != '0'
normal m`
silent! :%s/\s\+$//e
normal ``
endif
endfunction
autocmd BufWritePre *.c,*.cpp,*.h,*.hpp,*.py,*.clj,*.coffee,*.js,*.erl,*.html,*.md,*.toml,*.example call RemoveTrailingSpace()
endif
" highlight space errors in C/C++ source files (Vim tip #935)
if $VIM_HATE_SPACE_ERRORS != '0'
let c_space_errors=1
endif
" for ctrlp matcher
let g:path_to_matcher = "/usr/local/bin/matcher"
let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files . -co --exclude-standard']
let g:ctrlp_match_func = { 'match': 'GoodMatch' }
function! GoodMatch(items, str, limit, mmode, ispath, crfile, regex)
" Create a cache file if not yet exists
let cachefile = ctrlp#utils#cachedir().'/matcher.cache'
if !( filereadable(cachefile) && a:items == readfile(cachefile) )
call writefile(a:items, cachefile)
endif
if !filereadable(cachefile)
return []
endif
" a:mmode is currently ignored. In the future, we should probably do
" something about that. the matcher behaves like "full-line".
let cmd = g:path_to_matcher.' --limit '.a:limit.' --manifest '.cachefile.' '
if !( exists('g:ctrlp_dotfiles') && g:ctrlp_dotfiles )
let cmd = cmd.'--no-dotfiles '
endif
let cmd = cmd.a:str
return split(system(cmd), "\n")
endfunction
" for pymode
"let g:pymode_rope = 1
"let g:pymode_folding = 0
"let g:pymode_lint_write = 0
"let g:pymode_options = 0 " pymode will set nowrap if this == 1
"let g:pymode_syntax = 0
set syntax=glib
let g:go_fmt_command = "goimports"
"set equalprg=astyle\ --style=google