-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
260 lines (201 loc) · 4.92 KB
/
.vimrc
File metadata and controls
260 lines (201 loc) · 4.92 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
" ===== dna113p =====
" My vim configuration
"
" (╯°□°)╯︵ ┻━┻
" Required {{{
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
"}}}
" Plugins {{{
" --- Filetype ---
"Javascript
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
"Plugin 'othree/yajs.vim'
" --- Colorscheme ---
Plugin 'lsdr/monokai'
Plugin 'tomasr/molokai'
" --- Functionality ---
"AutoComplete and Snippets
Plugin 'Valloric/YouCompleteMe'
Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
"Document/Project Navigation
Plugin 'EasyMotion'
Plugin 'ctrlpvim/ctrlp.vim'
"Debugging and Syntax Help
Plugin 'scrooloose/syntastic'
Plugin 'joonty/vdebug'
Plugin 'marijnh/tern_for_vim'
"Visual Aids
Plugin 'myusuf3/numbers.vim'
Plugin 'bling/vim-airline'
"Coding Assist
Plugin 'scrooloose/nerdcommenter'
Plugin 'godlygeek/tabular'
Plugin 'tpope/vim-surround'
Plugin 'editorconfig/editorconfig-vim'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"}}}
" Config (no plugins) {{{
" --- Leader Keys ---
let mapleader = ","
let maplocalleader = "\\"
" --- Color ---
set t_Co=256
colorscheme molokai
" --- GUI Running ---
if has("gui_running")
set guioptions-=T
set guioptions+=e
set guitablabel=%M\ %t
set guioptions-=r
set guioptions-=l
endif
" --- Backups, Tmp Files, and Undo ---
set backup
set backupdir=~/.vim/.backup/
set directory=~/.vim/.tmp/
" --- Persistent Undo ---
set undofile
set undodir=~/.vim/.undo/
" --- UI ---
set ruler
set nowrap
set laststatus=2
set cmdheight=2
set encoding=utf-8
set title
set number
" --- Behaviors ---
set backupcopy=yes
set autoread
set wildmenu
set hidden
set history=1000
set cf
set timeoutlen=350
set nostartofline
set scrolloff=5
" --- Text Format ---
set autoindent
set tabstop=4
set softtabstop=4
set backspace=2
set shiftwidth=4
set cindent
set smarttab
set expandtab
set wrap
" --- Searching ---
set ignorecase
set smartcase
set incsearch
set hlsearch
set wildignore+=*.o,*.obj,*.exe,*.so,*.dll,*.pyc,.svn,.hg,.bzr,.git,
\.sass-cache,*.class,*.scssc,*.cssc,sprockets%*,*.lessc
" --- Visual ---
set matchtime=5
set list
" show trailing space as dots and carrots for extended lines
set listchars=""
set listchars=tab:\ \
set listchars+=trail:.
set listchars+=extends:>
set listchars+=precedes:<
" Highlight VCS conflict markers
match ErrorMsg '^\(<\|=\|>\)\([^=].\+\)\?$'
" --- Sounds ---
set noerrorbells
set novisualbell
set t_vb=
" --- Mouse ---
set mousehide
set mouse=a
set complete=.,w,b,u,U
"}}}
" Mappings {{{
" Easy split window navigation
noremap <C-h> <C-w>h
noremap <C-j> <C-w>j
noremap <C-k> <C-w>k
noremap <C-l> <C-w>l
" Space to toggle folds
nnoremap <space> za
vnoremap <space> za
" Repeat last macro with Q
nmap Q @@
" Yank from cursor to eol
map Y y$
" Easier line completion
imap <C-l> <C-x><C-l>
" Use ; for :
nnoremap ; :
vnoremap ; :
nnoremap : ;
" --- Leader Commands ---
" Easy Buffer nav
noremap <leader>bp :bprevious<cr>
noremap <leader>bn :bnext<cr>
" Toggle spelling mode with ,s
nmap <silent> <leader>s :set spell!<CR>
" Edit vimrc with ,v
nmap <silent> <leader>v :e ~/.vimrc
" Quickly switch to last buffer
nnoremap <leader>, :e#<CR>
" Close curernt window
nmap <silent> <leader>sc :close<CR>
" Window splits
nmap <silent> <leader>vs :split<CR>
nmap <silent> <leader>vs :vsplit<CR>
" Clear highlight after search
noremap <silent><leader>/ :nohls<CR>
" Yank content in OS's clipoard. 'o' stand for OS clipboard
vnoremap <leader>yo "*y
" Paste content from OS's clipboard
nnoremap <leader>po "*p
" Format entire file
nmap <leader>fef ggVG=
"}}}
" Plugin Config {{{
" --- SYNTASTIC JAVASCRIPT LINTING ---
let g:syntastic_javascript_checkers = ['eslint']
" --- AIRLINE FONT SYMBOLS ---
let g:airline_powerline_fonts = 1
let g:airline_theme = 'dark'
" --- CTRLP IGNORE node_modules ---
let g:ctrlp_custom_ignore = 'node_modules'
" --- JSX SYNTAX in .JS ---
let g:jsx_ext_required = 0
" --- ULTISNIPS TRIGGER CONFIG ---
let g:UltiSnipsExpandTrigger="<c-j>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" --- HTML.VIM FILETYPE SETTINGS ---
let g:html_indent_script1 = "inc"
let g:html_indent_style1 = "inc"
let g:html_indent_inctags = "html,body,head"
"}}}
" Functions {{{
"
"}}}
" Auto Commands {{{
" --- Set marker folding in vimrc ---
augroup filetype_vim
autocmd!
autocmd FileType vim setlocal foldmethod=marker
augroup END
" --- Update vimrc on save ---
augroup myvimrchooks
au!
autocmd bufwritepost .vimrc source ~/.vimrc
augroup END
"}}}
" Temp {{{
"
" }}}