-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
245 lines (194 loc) · 6.14 KB
/
vimrc
File metadata and controls
245 lines (194 loc) · 6.14 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
scriptencoding utf-8
set encoding=utf-8
set nocompatible
call plug#begin('~/.vim/plugged')
Plug 'morhetz/gruvbox'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-repeat'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-unimpaired'
Plug 'easymotion/vim-easymotion'
Plug 'kana/vim-textobj-user'
Plug 'kana/vim-textobj-entire'
Plug 'kana/vim-textobj-indent'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'scrooloose/nerdtree'
Plug 'Raimondi/delimitMate'
Plug 'Chiel92/vim-autoformat'
Plug 'kshenoy/vim-signature'
" syntax
Plug 'sheerun/vim-polyglot'
Plug 'ap/vim-css-color'
Plug 'jelera/vim-javascript-syntax'
Plug 'pangloss/vim-javascript'
Plug 'othree/javascript-libraries-syntax.vim'
Plug 'othree/yajs.vim'
Plug 'chr4/nginx.vim'
Plug 'gre/play2vim'
" programming
Plug 'mattn/emmet-vim'
call plug#end()
let mapleader=","
let &t_Co=256
colorscheme darkblue
colorscheme gruvbox
syntax on
set ignorecase
set tabstop=3
set shiftwidth=3
set smartindent
set showmatch " показывать первую парную скобку после ввода второй
set laststatus=2
set hlsearch
set cursorline
set noswapfile
set previewheight=40 " Высота блока preview (например для git status)
set ffs=unix,dos,mac
set fencs=utf-8,cp1251,koi8-r,ucs-2,cp866
set hidden
set splitbelow
set splitright
set showcmd
set mouse=a
set number
set list
set listchars=
set listchars+=tab:\ \
set listchars+=trail:·
set listchars+=extends:» " show cut off when nowrap
set listchars+=precedes:«
set listchars+=nbsp:⣿
set listchars+=eol:¬
set wildignore+=*/node_modules/**
set wildignore+=*/target/**
set wildignore+=.git,.hg,.svn
set wildignore+=*/vendor/gems/*,*/vendor/cache/*,*/.bundle/*,*/.sass-cache/*,*.gem,*/target/*
set wildignore+=*.aux,*.out,*.toc
set wildignore+=*.o,*.obj,*.exe,*.dll,*.manifest,*.rbc,*.class
set wildignore+=*.ai,*.bmp,*.gif,*.ico,*.jpg,*.jpeg,*.png,*.psd,*.webp
set wildignore+=*.avi,*.m4a,*.mp3,*.oga,*.ogg,*.wav,*.webm
set wildignore+=*.eot,*.otf,*.ttf,*.woff
set wildignore+=*.doc,*.pdf
set wildignore+=*.zip,*.tar.gz,*.tar.bz2,*.rar,*.tar.xz
set wildignore+=*.swp,.lock,.DS_Store,._*
let g:EasyMotion_smartcase = 1
" delimate
let delimitMate_expand_cr = 1
let delimitMate_expand_space = 1
"""""""""""""""""""""""""""""
" signature
"""""""""""""""""""""""""""""
let g:SignatureMap = {
\ 'Leader' : "m",
\ 'PlaceNextMark' : "m,",
\ 'ToggleMarkAtLine' : "m.",
\ 'PurgeMarksAtLine' : "m-",
\ 'DeleteMark' : "dm",
\ 'PurgeMarks' : "m<Space>",
\ 'PurgeMarkers' : "m<BS>",
\ 'GotoNextLineAlpha' : "')",
\ 'GotoPrevLineAlpha' : "'(",
\ 'GotoNextSpotAlpha' : "`)",
\ 'GotoPrevSpotAlpha' : "`(",
\ 'GotoNextLineByPos' : "]'",
\ 'GotoPrevLineByPos' : "['",
\ 'GotoNextSpotByPos' : "]`",
\ 'GotoPrevSpotByPos' : "[`",
\ 'GotoNextMarker' : "[+",
\ 'GotoPrevMarker' : "[-",
\ 'GotoNextMarkerAny' : "]=",
\ 'GotoPrevMarkerAny' : "[=",
\ 'ListBufferMarks' : "m/",
\ 'ListBufferMarkers' : "m?"
\ }
let g:polyglot_disabled = ['javascript']
let g:javascript_enable_domhtmlcss = 1
" Insert mode completion
imap <c-x><c-k> <plug>(fzf-complete-word)
imap <c-x><c-f> <plug>(fzf-complete-path)
imap <c-x><c-j> <plug>(fzf-complete-file-ag)
imap <c-x><c-l> <plug>(fzf-complete-line)
" Advanced customization using autoload functions
inoremap <expr> <c-x><c-k> fzf#vim#complete#word({'down': '35%'})
nmap <silent> <End> :edit!<CR>
nmap <silent> <Del> :bdelete<CR>
nmap <silent> <C-Del> :tabc<CR>
nmap <silent> <Ins> :tabnew<CR>
nmap <silent> <leader>f :Files<CR>
nmap <silent> <leader>hi :History<CR>
nmap <silent> <leader>b :Buffers<CR>
nmap <silent> <leader>w :Windows<CR>
nmap <silent> <leader>ll :Lines<CR>
nmap <silent> <leader>lb :BLines<CR>
nmap <silent> <leader>gf :GitFiles<CR>
nmap <silent> <leader>m :Marks<CR>
nnoremap <silent> <Space>/ :execute 'Ag ' . input('Ag/')<CR>
nnoremap <silent> K :call SearchWordWithAg()<CR>
vnoremap <silent> K :call SearchVisualSelectionWithAg()<CR>
function! SearchWordWithAg()
execute 'Ag' expand('<cword>')
endfunction
function! SearchVisualSelectionWithAg() range
let old_reg = getreg('"')
let old_regtype = getregtype('"')
let old_clipboard = &clipboard
set clipboard&
normal! ""gvy
let selection = getreg('"')
call setreg('"', old_reg, old_regtype)
let &clipboard = old_clipboard
execute 'Ag' selection
endfunction
" easy motion
map <Space>f <Plug>(easymotion-bd-f)
nmap <Space>f <Plug>(easymotion-overwin-f)
map <Space>t <Plug>(easymotion-bd-t)
nmap <Space>t <Plug>(easymotion-overwin-t)
" s{char}{char} to move to {char}{char}
nmap <Space><Space> <Plug>(easymotion-overwin-f2)
" Move to line
map <Space>l <Plug>(easymotion-bd-jk)
nmap <Space>l <Plug>(easymotion-overwin-line)
" Move to word
map <Space>w <Plug>(easymotion-bd-w)
nmap <Space>w <Plug>(easymotion-overwin-w)
" easy align
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
" highlight word by *
nnoremap * *N
" highlight selected block in visual mode
vnoremap * y :execute ":let @/=@\""<CR> :execute "set hlsearch"<CR>
" off hightlight
nmap <silent> // :nohlsearch<CR>
noremap <leader>hl :set hlsearch! hlsearch?<CR>
nnoremap <silent> <F10> :qa<CR>
nnoremap <silent> <F5> :w<CR>
inoremap <silent> <F5> <Esc>:w<CR>
nmap <silent> <F3> :Autoformat<CR>
imap <silent> <F3> <Esc>:Autoformat<CR>
nmap <C-\> :NERDTreeFind<CR>
nmap <silent> <Bslash><Bslash> :NERDTreeToggle<CR>
cmap w!! %!sudo tee > /dev/null %"
" Toggle paste mode
nmap <silent> <F4> :set invpaste<CR>:set paste?<CR>
imap <silent> <F4> <ESC>:set invpaste<CR>:set paste?<CR>
imap jj <Esc>
" Map ctrl-movement keys to window switching
nmap <silent> <Tab> <C-w>w
map <PageUp> <Nop>
map <PageDown> <Nop>
imap <PageUp> <Nop>
imap <PageDown> <Nop>
autocmd FileType html imap <PageDown> <CR><Esc>O
nmap <Space>h i<Space><Esc>l
nmap <Space>l a<Space><Esc>h
" Remove upper/down line
nmap d[ mz-dd`zdmz
nmap d] mz<CR>dd`zdmz
nmap [w :tabp<CR>
nmap ]w :tabn<CR>