-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
230 lines (186 loc) · 7.14 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
set nocompatible " be iMproved, required
filetype off " required
map ; :
map <F4> :q<CR>
map <F5> :wq<CR>
" Tags globals
set exrc
set secure
let g:vim_tags_auto_generate = 1
let g:vim_tags_project_tags_command = "{CTAGS} -R {OPTIONS} {DIRECTORY} 2>/dev/null"
" Map for easy tab navigation
nnoremap th :tabfirst<CR>
nnoremap tj :tabnext<CR>
nnoremap tk :tabprev<CR>
nnoremap tl :tablast<CR>
nnoremap tn :tabnext<Space>
nnoremap tm :tabm<Space>
nnoremap td :tabclose<CR>
" Find selection in visual mode
vnoremap // y/<C-R>"<CR>"
" Scrolling rhrough tabs by Shift and h or l
nnoremap <S-h> gT
nnoremap <S-l> gt
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" ctrlp ctags alike jump To, <Leader> is simply backslash :)
nnoremap <Leader>fu :CtrlPFunky<Cr>
" narrow the list down with a word under cursor
nnoremap <Leader>fU :execute 'CtrlPFunky ' . expand('<cword>')<Cr>
" Syntax highlighting
let g:ctrlp_funky_matchtype = 'path'
let g:ctrlp_funky_syntax_highlight = 1
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" My bundles here:
" YouCompleteMe
Plugin 'Valloric/YouCompleteMe'
Plugin 'pangloss/vim-javascript'
" Lib highlighting
Plugin 'crusoexia/vim-javascript-lib'
Plugin 'flazz/vim-colorschemes'
" Colors
Plugin 'kien/ctrlp.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'ervandew/supertab'
Plugin 'scrooloose/syntastic'
Plugin 'bling/vim-airline'
" you should have ctags 5.x, recommend: 'brew install ctags'; after that set'alias ctags=/usr/local/Cellar/ctags/5.8/bin/ctags'
Plugin 'szw/vim-tags'
Plugin 'majutsushi/tagbar'
Plugin 'tpope/vim-surround'
Plugin 'Townk/vim-autoclose'
Plugin 'matze/vim-move'
Plugin 'scrooloose/nerdcommenter'
Plugin 'tpope/vim-markdown'
Plugin 'tpope/vim-fugitive'
Plugin 'mattn/emmet-vim'
Plugin 'tacahiroy/ctrlp-funky'
Plugin 'mileszs/ack.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'jistr/vim-nerdtree-tabs'
" set the same state of NERDTree in each tab
" Plugin 'Xuyuanp/nerdtree-git-plugin'
" set dirty changes in NERDTree
Plugin 'elzr/vim-json'
" support highlight of JSON files
Plugin 'leafgarland/typescript-vim'
" support highlight to TypeScript files
Plugin 'othree/html5.vim'
" Support HTML5
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList " - lists configured plugins
" :PluginInstall - installs plugins append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo append `!` to refresh local cache
" :PluginClean - confirms removal of unused plugins append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line
" Editor"
" ----------------------------------------------------------------------------
"Kolorki
syntax on " enble syntax highlight
set background=dark " set condition in theme that we use dark/light bg
color Monokai
set mouse=a " enable mouse
set nowrap " don't wrap lines
set number " enable show number of line
set noic " enable case sensetive
set hlsearch " enable highlight during searching
set incsearch " enable searching mechanism during putting chars
set history=200 " (hi) keep 200 lines of command history
set tabstop=4 " set 4 chars after what editor has stopped
" set softtabstop
set shiftwidth=4 " (sw) width (in spaces) used in each step of autoindent (aswell as << and >>)
set expandtab " (et) expand tabs to spaces (use :retab to redo entire file)
" set smarttab " (sta) 'shiftwidth' used in front of a line, but 'tabstop' used otherwise
set autoindent " (ai) turn on auto-indenting (great for programers)
" set copyindent " (ci) when auto-indenting, use the indenting format of the previous line
set showcmd " (sc) display an incomplete command in the lower right
set ruler " (ru) show the cursor position at all times
set cursorline " highlight current line
set title " show filename in title bar
set wildmenu " show line with autocomplete
set list " show whitespaces
set listchars=tab:▸\ ,trail:·,extends:❯,precedes:❮
" replace default whitespaces to custom
" Configurations
" -----------------------------------------------------------------------------
" ctrlp
" -----------------------------------------------------------------------------
let g:ctrlp_custom_ignore = {
\ 'dir': '\.git$\|\.hg$\|\.svn$\|vendor\|node_modules$\|target$\|project$',
\ 'file': '\v\.(exe|so|dll|log|png|jpeg|jpg)$',
\ }
" NERDTree
" -----------------------------------------------------------------------------
let NERDTreeShowHidden=1 " show hidden files
let NERDTreeQuitOnOpen=0 " disable quit NERDTree panel when file open
let NERDTreeMapOpenInTab='<ENTER>' " disable hideNERDTree when open new file
autocmd BufWinEnter * NERDTreeMirror
" vim-move
" -----------------------------------------------------------------------------
let g:move_key_modifier = 'C' " set hot key as Control
" Airline
" -----------------------------------------------------------------------------
set laststatus=2
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = ''
let g:airline_right_sep = ''
let g:airline_symbols.linenr = ''
let g:airline_symbols.branch = '⎇ '
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.whitespace = 'Ξ'
" display open buffers in tabline
let g:airline#extensions#tabline#enabled = 1
" Syntastic
" -----------------------------------------------------------------------------
" If i add jslint, checker is active
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_check_on_open=1
let g:syntastic_enable_signs=1
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_wq = 0
" typescript-vim
" -----------------------------------------------------------------------------
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
" Commands
" -----------------------------------------------------------------------------
:command! W write
:command! Wq wq
" Key Mappings
" -----------------------------------------------------------------------------
" <F9> show/hide NERDTree
:map <F9> :NERDTreeTabsToggle<CR>
" <F8> show/hide Outline
nmap <F8> :TagbarToggle<CR>
:map <C-a> GVgg
:map <C-o> :e . <Enter>
:map <C-s> :w <Enter>
:map <C-c> y
:map <C-x> d
:map <C-z> u
:map <C-t> :tabnew <Enter>
:map <C-i> >>
:map <C-f> /
:map <C-h> :%s/
:map <S-t> vat
:map <S-T> vit
:map <S-{> vi{
:map <S-(> vi(
:map <S-[> vi[