forked from Z-Shang/MyRC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
266 lines (228 loc) · 8.08 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
264
265
266
"
"███████╗ ██╗ ██╗██╗███╗ ███╗
"╚══███╔╝ ██║ ██║██║████╗ ████║
" ███╔╝ ██║ ██║██║██╔████╔██║
" ███╔╝ ╚██╗ ██╔╝██║██║╚██╔╝██║
"███████╗██╗╚████╔╝ ██║██║ ╚═╝ ██║
"╚══════╝╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝
"
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
set nocompatible
filetype off
let Plugin_List = [
\ 'altercation/vim-colors-solarized',
\ 'ap/vim-css-color',
\ 'bitc/vim-hdevtools',
\ 'clvv/a.vim',
\ 'davidhalter/jedi-vim',
\ 'digitaltoad/vim-jade',
\ 'duganchen/vim-soy',
\ 'eagletmt/ghcmod-vim',
\ 'eagletmt/neco-ghc',
\ 'fatih/vim-go',
\ 'fholgado/minibufexpl.vim',
\ 'guns/vim-clojure-static',
\ 'honza/vim-snippets',
\ 'jistr/vim-nerdtree-tabs',
\ 'jpalardy/vim-slime',
\ 'kchmck/vim-coffee-script',
\ 'keith/swift.vim',
\ 'kien/ctrlp.vim',
\ 'kovisoft/slimv',
\ 'lervag/vimtex',
\ 'Lokaltog/vim-easymotion',
\ 'mbbill/undotree',
\ 'mtscout6/vim-cjsx',
\ 'nathanaelkane/vim-indent-guides',
\ 'ntpeters/vim-better-whitespace',
\ 'rking/ag.vim',
\ 'scrooloose/nerdcommenter',
\ 'scrooloose/nerdtree',
\ 'scrooloose/syntastic',
\ 'shougo/neocomplcache.vim',
\ 'Shougo/neosnippet',
\ 'Shougo/neosnippet-snippets',
\ 'shougo/vimproc.vim',
\ 'shougo/vimshell.vim',
\ 'sirver/ultisnips',
\ 'sjl/gundo.vim',
\ 'terryma/vim-multiple-cursors',
\ 'tomasr/molokai',
\ 'tpope/vim-fugitive',
\ 'tpope/vim-fireplace',
\ 'tpope/vim-rails',
\ 'Valloric/YouCompleteMe',
\ 'vim-airline/vim-airline',
\ 'vim-airline/vim-airline-themes',
\ 'vim-scripts/hlint',
\ 'vim-scripts/tagbar',
\ 'unblevable/quick-scope',
\ 'w0ng/vim-hybrid',
\ 'gmarik/Vundle.vim']
" =========Bundle Managed By Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#begin()
for repo in Plugin_List
Plugin repo
endfor
"Plugin 'guns/vim-sexp'
"Plugin 'tpope/vim-classpath'
"Plugin 'tpope/vim-dispatch'
"Plugin 'tpope/vim-leiningen'
"Plugin 'tpope/vim-projectionist'
"Plugin 'typedclojure/vim-typedclojure'
call vundle#end()
" =========For Japanese Support
set fileencodings=utf8,gbk,iso-2022-jp,euc-jp,cp932,default,latin1
syntax on
" size of a hard tabstop
set tabstop=4
" size of an "indent"
set shiftwidth=4
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
filetype plugin indent on
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
set number
set relativenumber
"if has("vms")
set nobackup " do not keep a backup file, use versions instead
"else
" set backup " keep a backup file
"endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
set background=dark
let g:hybrid_use_Xresources = 1
colorscheme molokai
map Q gq
" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo,
" so that you can undo CTRL-U after inserting a line break.
inoremap <C-U> <C-G>u<C-U>
" In many terminal emulators the mouse works just fine, thus enable it.
if has('mouse')
set mouse=a
endif
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent on
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
" Also don't do it when the mark is in the first line, that is the default
" position when opening a file.
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
" Convenient command to see the difference between the current buffer and the
" file it was loaded from, thus the changes you made.
" Only define it when not defined already.
if !exists(":DiffOrig")
command DiffOrig vert new | set bt=nofile | r ++edit # | 0d_ | diffthis
\ | wincmd p | diffthis
endif
set t_Co=256
"set cc=80
" =========Slimv
let g:slimv_python = 'python2'
let g:slimv_impl = 'sbcl'
"let g:slimv_swank_cmd = '! tmux new-window "sbcl --load /home/zshang/.vim/start-swank.lisp &"'
let g:lisp_rainbow = 1
let g:slimv_repl_syntax = 1
" =========Syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_cpp_include_dirs = ['/usr/include/']
let g:syntastic_cpp_remove_include_errors = 1
let g:syntastic_cpp_check_header = 1
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_auto_refresh_includes = 1
let g:syntastic_cpp_compiler_options = '-std=c++11 -stdlib=libstdc++'
let g:Syntastic_cpp_checkers = ['gcc']
"set error or warning signs
let g:syntastic_error_symbol = 'X'
let g:syntastic_warning_symbol = '!'
"whether to show balloons
let g:syntastic_enable_balloons = 1
map <silent> <leader>e :Errors<CR>
map <leader>s :SyntasticToggleMode<CR>
"let g:syntastic_auto_loc_list=1
" =========YCM
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_confirm_extra_conf = 0
"Make Syntastic works together with YCM
let g:ycm_show_diagnostics_ui = 0
" =========Misc Key Mappings
imap <C-k> <Esc>k
imap <C-l> <Esc>l
imap <C-h> <Esc>h
imap <C-j> <Esc>j
imap <C-\> lambda
nmap <C-l> :NERDTreeToggle<CR>
nmap <C-\> :TagbarToggle<CR>
nmap <tab> :IndentGuidesToggle<CR>
"imap <C-f> function
" =========Airline
set laststatus=2
"let g:airline#extensions#tabline#enabled = 1
let g:Powerline_symbols = 'fancy'
let g:airline_powerline_fonts = 1
" =========Indent Guides
set ts=4 sw=4 et
hi IndentGuidesEven ctermbg=1
hi IndentGuidesOdd ctermbg=2
let g:indent_guides_start_level=2
let g:indent_guides_guide_size=1
" =========GHC-Mod
map <silent> tu :call GHC_BrowseAll()<CR>
map <silent> tw :call GHC_ShowType(1)<CR>
" =========HDevTools
au FileType haskell nnoremap <buffer> <C-t> :HdevtoolsType<CR>
au FileType haskell nnoremap <buffer> <silent> <leader>c :HdevtoolsClear<CR>
au FileType haskell nnoremap <buffer> <silent> <leader>t :HdevtoolsInfo<CR>
" =========Vim-Slime
let g:slime_target="tmux"
let g:slime_paste_file=tempname()
" =========PointFree
autocmd BufEnter *.hs set formatprg=pointfree
" =========Neco Ghc
autocmd FileType haskell setlocal omnifunc=necoghc#omnifunc
autocmd FileType haskell let g:ycm_semantic_triggers = {'haskell' : ['.']}
let g:necoghc_enable_detailed_browse=1
" =========gVIM
set guifont=Iosevka\ 12
set guioptions-=m
set guioptions-=T
set guioptions-=r
set guioptions-=L
" =========Gundo
nnoremap <C-u> :GundoToggle<cr>
" =========Guide Line
au WinLeave * set nocursorline nocursorcolumn
au WinEnter * set cursorline cursorcolumn
set cursorline cursorcolumn
" =========Quick Scope
let g:qs_highlight_on_keys = ['f', 'F']