-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmin-vimrc
186 lines (156 loc) · 4.6 KB
/
min-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
set mouse=a
set backspace=2
set foldenable
set foldmethod=manual
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=80
set nohls
set cursorline
set number
" File settings {{{
augroup ftype_group
autocmd!
autocmd FileType cpp,c,h,hpp,cc,hh setlocal ts=2 sts=2 sw=2 foldenable foldmethod=syntax
autocmd FileType txt,text,tex,latex setlocal spell spelllang=ru,en complete=".,w,b,u,t,i,kspell"
augroup END
" }}}
filetype plugin indent on
set encoding=utf-8
set nocompatible
syntax enable
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/bundle')
" Text objects and actions on them
Plug 'michaeljsmith/vim-indent-object' " ai ii aI
Plug 'kana/vim-textobj-user' " necessary for the following plugin
Plug 'kana/vim-textobj-entire' " ae ie
Plug 'tommcdo/vim-exchange' " cx<motion> cxx X(visual) cxc(cancel)
Plug 'machakann/vim-highlightedyank'
Plug 'iahmad1337/argtextobj.vim' " aa ia (original plugin conflicts with my mappings)
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
Plug 'haya14busa/incsearch.vim'
Plug 'sirver/ultisnips'
Plug 'honza/vim-snippets'
" Misc
Plug 'mhinz/vim-startify'
Plug 'voldikss/vim-floaterm'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
Plug 'junegunn/fzf.vim'
" Appearence
Plug 'vim-airline/vim-airline'
Plug 'sonph/onehalf', { 'rtp': 'vim' }
call plug#end()
"""""""""""""""
" IncSearch "
"""""""""""""""
map / <Plug>(incsearch-forward)
map ? <Plug>(incsearch-backward)
map g/ <Plug>(incsearch-stay)
set hlsearch
set ignorecase
let g:incsearch#auto_nohlsearch = 1
map n <Plug>(incsearch-nohl-n)
map N <Plug>(incsearch-nohl-N)
map * <Plug>(incsearch-nohl-*)
map # <Plug>(incsearch-nohl-#)
map g* <Plug>(incsearch-nohl-g*)
map g# <Plug>(incsearch-nohl-g#)
"""""""""""""""""""""
" HighlightedYank "
"""""""""""""""""""""
if !exists('##TextYankPost')
nmap y <Plug>(highlightedyank)
xmap y <Plug>(highlightedyank)
omap y <Plug>(highlightedyank)
endif
"""""""""""""""
" UltiSnips "
"""""""""""""""
let g:UltiSnipsExpandTrigger="<Tab>"
let g:UltiSnipsListSnippets="<c-Tab>"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
""""""""""""""""
" ArgTextObj "
""""""""""""""""
let g:argtextobj_pairs="(:),<:>,{:}"
"""""""""""""
" Airline "
"""""""""""""
let g:airline#extensions#keymap#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline_section_y = "" " by default does something
let g:airline_section_z = "Ln:%l/%L Col:%c"
let g:Powerline_symbols='unicode'
"""""""""""""
" fzf.vim "
"""""""""""""
nnoremap <silent> ,f :Files<CR>
nnoremap <silent> ,h :Helptags<CR>
nnoremap <silent> ,b :Buffers<CR>
nnoremap <silent> ,s :Snippets<CR>
nnoremap <silent> ,c :Commands<CR>
nnoremap <silent> ,l :Lines<CR>
""""""""""""""
" Floaterm "
""""""""""""""
let g:floaterm_position='bottom'
let g:floaterm_width=1.0
let g:floaterm_autoclose=2
let g:floaterm_keymap_toggle = ',tt'
"""""""""""""""""
" VimStartify "
"""""""""""""""""
let g:startify_bookmarks = [ '~/.vimrc', '~/.vim', '~/personal']
""""""""""""""""
" EasyEscape "
""""""""""""""""
inoremap jk <ESC>
inoremap kj <ESC>
cnoremap jk <ESC>
cnoremap kj <ESC>
tnoremap jk <ESC>
tnoremap kj <ESC>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" My personal commands "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"kostil"
set langmap=ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz
""""""""""""""""""
" Motion remap "
""""""""""""""""""
"move to the next window in normal mode
nnoremap <space>h <C-w>h
nnoremap <space>j <C-w>j
nnoremap <space>k <C-w>k
nnoremap <space>l <C-w>l
nnoremap Y v$y
"""""""""""""
" Helpers "
"""""""""""""
" highlight trailing spaces and TODOs:
match Error /\v\s+$/
2match Underlined /\vTODO[^.]*/
set wildmenu
" netrw
let g:netrw_liststyle=3
let g:netrw_banner=0
let g:netrw_winsize = 25
" completion & tags
set omnifunc=syntaxcomplete#Complete
colorscheme onehalfdark
let g:airline_theme='onehalfdark'
set term=xterm-256color
set termguicolors
" my handmade export of gnome terminal tango theme
let g:terminal_ansi_colors = ['#2E3436', '#CC0000', '#4E9A06', '#C4A000',
\ '#3465A4', '#75507B', '#06989A', '#D3D7CF', '#555753', '#EF2929', '#8AE234',
\ '#FCE94F', '#729FCF', '#AD7FA8', '#34E2E2', '#EEEEEC']