-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
198 lines (154 loc) · 4.38 KB
/
.vimrc
File metadata and controls
198 lines (154 loc) · 4.38 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
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
" Fast motion.
Plugin 'Lokaltog/vim-easymotion'
" Git
Plugin 'tpope/vim-fugitive'
" FS explorer
Plugin 'scrooloose/nerdtree'
" Easy comment/uncomment
Plugin 'scrooloose/nerdcommenter'
" Color schemes
Plugin 'Lucius'
Plugin 'dracula/vim'
" C++ clever highlight
Plugin 'octol/vim-cpp-enhanced-highlight'
" Matching parenthes are colored with the same color
Plugin 'kien/rainbow_parentheses.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'wellle/targets.vim'
Plugin 'kana/vim-textobj-user'
Plugin 'kana/vim-textobj-function'
Plugin 'kana/vim-textobj-line'
Plugin 'kana/vim-textobj-entire'
Plugin 'kana/vim-operator-user'
" Plugin 'lyuts/vim-rtags'
Plugin 'terryma/vim-multiple-cursors'
Plugin 'airblade/vim-gitgutter'
Plugin 'derekwyatt/vim-fswitch'
Plugin 'vim-scripts/a.vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'terryma/vim-expand-region'
Plugin 'tpope/vim-abolish.git'
Plugin 'vimwiki/vimwiki'
Plugin 'fatih/vim-go'
Plugin 'vim-syntastic/syntastic'
Plugin 'rust-lang/rust.vim'
"Plugin tpope/vim-obsession
" to explore
"Plugin 'tpope/vim-surround'
"Plugin 'derekwyatt/vim-scala'
"Plugin 'plasticboy/vim-markdown'
"Plugin 'vim-scripts/argtextobj.vim'
"
" Fix mappings and use?
" Crazy default keys mapping, but nice
"Plugin 'matze/vim-move'
" Nice line with miscellaneous information
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
syntax on
set background=dark
" misc
set encoding=utf-8
set fileencoding=utf-8
set hlsearch
nnoremap <silent> <C-l> :nohl<CR><C-l>
set cursorline
set autowrite
set wildmenu
" Easymotion will use <Leader> instead of default <Leader><Leader>
map <Leader> <Plug>(easymotion-prefix)
" Color scheme
"colorscheme badwolf
colorscheme lucius
LuciusBlack
"colorscheme dracula
" Rainbow parentheses
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
" When editing a file, always jump to the last known cursor position.
augroup vimrcEx
autocmd!
autocmd BufReadPost *
\ if line("'\"") > 1 && line("'\"") <= line("$") |
\ exe "normal! g`\"" |
\ endif
augroup END
" Persistent undo
set undofile " Save undo's after file closes
set undodir=$HOME/.vim/undo " where to save undo histories
set undolevels=1000 " How many undos
set undoreload=10000 " number of lines to save for undo
silent call system('mkdir -p ' . &undodir) " create undo dir
" clang-format
augroup clangFormat
autocmd!
autocmd BufWritePre *.cpp,*.h,*.hpp,*.c :%py3f ~/.vim/clang-format.py
augroup END
" rust-fmt
let g:rustfmt_autosave = 1
"augroup jsFormat
"autocmd!
"autocmd BufWritePre *.js :silent !standard --fix %
"augroup END
"autocmd bufwritepost *.js :silent !standard --fix 2> /dev/null 2> /dev/null %
" expand region
map <C-k> <Plug>(expand_region_expand)
map <C-j> <Plug>(expand_region_shrink)
let g:expand_region_text_objects = {
\ 'iw' :0,
\ 'iW' :0,
\ 'i"' :0,
\ 'i''' :0,
\ 'i]' :1,
\ 'ib' :1,
\ 'iB' :1,
\ 'ia' :0,
\ 'aa' :0,
\ 'if' :0,
\ 'af' :0,
\ 'il' :0,
\ 'ip' :0,
\ 'ie' :0,
\ }
" Multiple cursors
let g:multi_cursor_exit_from_insert_mode=0
" Move lines
let g:move_key_modifier = 'C'
" fswitch
nmap <silent> <Leader>of :FSHere<cr>
" airline
set laststatus=2
let g:airline_powerline_fonts = 1
let g:airline#extensions#ycm#enabled = 1
let g:go_fmt_fail_silently = 1
let g:syntastic_go_checkers = ['go', 'govet']
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_html_checkers = ['eslint']
"map gm :e <cfile>.md<cr>
set keymap=russian-jcukenwin
"set iminsert=0
"set imsearch=0
"setlocal spell spelllang=ru_ru,en_us
" syntastic
"set statusline+=%#warningmsg#
"set statusline+=%{SyntasticStatuslineFlag()}
"set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
"