-
Notifications
You must be signed in to change notification settings - Fork 1
/
.vimrc
253 lines (210 loc) · 5.35 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
set nocompatible
filetype off
autocmd VimEnter * echo "Welcome, Venkat!"
call plug#begin('~/.vim/plugged')
Plug 'jiangmiao/auto-pairs'
"Plug 'ervandew/supertab'
Plug 'morhetz/gruvbox'
Plug 'hzchirs/vim-material'
Plug 'Valloric/YouCompleteMe'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'scrooloose/nerdcommenter'
Plug 'joshdick/onedark.vim'
Plug 'alvan/vim-closetag'
Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'KeitaNakamura/neodark.vim'
Plug 'yuttie/comfortable-motion.vim'
Plug 'junegunn/limelight.vim'
Plug 'dracula/vim'
Plug 'sheerun/vim-polyglot'
Plug 'junegunn/goyo.vim'
Plug 'tpope/vim-sleuth'
Plug 'rking/ag.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'airblade/vim-gitgutter'
Plug 'terryma/vim-multiple-cursors'
Plug 'dhruvasagar/vim-table-mode'
Plug 'majutsushi/tagbar'
Plug 'justinmk/vim-sneak'
Plug 'kien/rainbow_parentheses.vim'
Plug 'junegunn/vim-emoji'
Plug 'rafi/awesome-vim-colorschemes'
Plug 'ryanoasis/vim-devicons'
Plug 'gabrielelana/vim-markdown'
Plug 'kristijanhusak/vim-carbon-now-sh'
Plug 'altercation/vim-colors-solarized'
if has('nvim')
tnoremap <Esc> <C-\><C-n>
endif
call plug#end()
set completefunc=autoprogramming#complete
let b:SuperTabDisabled=1
filetype plugin indent on
syntax on
if (empty($TMUX))
if (has("nvim"))
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
if (has("termguicolors"))
set termguicolors
endif
endif
"let g:gruvbox_contrast_dark = 'medium'
"let g:gruvbox_italic = 1
let g:ycm_autoclose_preview_window_after_completion=1
"let base16colorspace=256
set background=dark
"set t_Co=256
set listchars=tab:➢\ ,trail:~,extends:>,precedes:<
set title
set autoindent
set smartindent
set backspace=indent,eol,start
set hlsearch
set ruler
set incsearch
set encoding=UTF-8
set wildmenu
set number
set showmatch
set tabstop=4 shiftwidth=4
set hidden
set splitbelow
set splitright
set nobackup
set nowb
set noswapfile
let mapleader = "\<Space>"
cmap w!! w !sudo tee %
let g:ctrlp_user_command = ['.git/', 'git --git-dir=%s/.git ls-files -oc --exclude-standard']
let g:table_mode_corner='|'
noremap <silent> <C-up> :call <SID>swap_up()<CR>
noremap <silent> <C-down> :call <SID>swap_down()<CR>
vmap sb "zdi<b><C-R>z</b><Esc>
vmap st "zdi<?= <C-R>z ?><Esc>
nnoremap <A-.> :call MoveToNextTab()<CR>
nnoremap <A-,> :call MoveToPrevTab()<CR>
noremap % v%
:command WQ wq
:command Wq wq
:command W w
:command Q q
:command Set set
nnoremap <CR> :noh<CR><CR>
map <c-o> :NERDTreeToggle<CR>
set laststatus=2
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#fnamemod = ':t'
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1
set ttimeoutlen=0
let g:multi_cursor_use_default_mapping=0
let g:multi_cursor_next_key='<C-n>'
let g:multi_cursor_prev_key='<C-o>'
let g:multi_cursor_skip_key='<C-x>'
let g:multi_cursor_quit_key='<Esc>'
let g:multi_cursor_exit_from_insert_mode=0
let g:multi_cursor_exit_from_visual_mode=0
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
map <leader>e :bp<bar>sp<bar>bn<bar>bd<CR>
function DeleteHiddenBuffers() " Vim with the 'hidden' option
let tpbl=[]
call map(range(1, tabpagenr('$')), 'extend(tpbl, tabpagebuflist(v:val))')
for buf in filter(range(1, bufnr('$')), 'bufexists(v:val) && index(tpbl, v:val)==-1')
silent execute 'bwipeout' buf
endfor
endfunction
command! BB call DeleteHiddenBuffers()
nnoremap <Leader>bb :call DeleteHiddenBuffers()<CR>
function FormatFile()
let l:lines="all"
pyf /usr/share/clang/clang-format.py
endfunction
nnoremap <Leader>cf :call FormatFile()<CR>
function! s:swap_lines(n1, n2)
let line1 = getline(a:n1)
let line2 = getline(a:n2)
call setline(a:n1, line2)
call setline(a:n2, line1)
endfunction
function! s:swap_up()
let n = line('.')
if n == 1
return
endif
call s:swap_lines(n, n - 1)
exec n - 1
endfunction
function! s:swap_down()
let n = line('.')
if n == line('$')
return
endif
call s:swap_lines(n, n + 1)
exec n + 1
endfunction
func! WordProcessorMode()
setlocal formatoptions=1
setlocal noexpandtab
map j gj
map <Down> gj
map k gk
map <Up> gk
setlocal spell spelllang=en_us
set complete+=s
set formatprg=par
setlocal wrap
setlocal linebreak
endfu
com! WP call WordProcessorMode()
func! DistractionFreeModeEnable()
WP
Goyo
Limelight
endfu
com! DF call DistractionFreeModeEnable()
func! DistractionFreeModeDisable()
Goyo
Limelight!
endfu
com! DM call DistractionFreeModeDisable()
func! DayMode()
color base16-gruvbox-light-hard
AirlineTheme gotham
let g:airline_theme='gotham'
endfu
com! Day call DayMode()
func! NightMode()
color gotham
AirlineTheme gotham
endfu
com! Night call NightMode()
func! PlaySound()
silent! exec '!mpv --no-terminal ~/.vim/type/sound1.aiff &'
endfu
func! EnableSound()
autocmd CursorMovedI * call PlaySound()
endfu
com! ClickOn call EnableSound()
func! DisableSound()
autocmd! CursorMovedI
endfu
com! ClickOff call DisableSound()
func! Check()
normal 0lvr€ýc✔€ýc0
endfu
nnoremap <Leader>a :call Check()<CR>
func! UnCheck()
normal 0€krr 0
endfu
nnoremap <Leader>s :call UnCheck()<CR>
nnoremap <Leader>w :bn<CR>
nnoremap <Leader>q :bp<CR>
let g:material_style='oceanic'
colorscheme vim-material
let g:airline_theme='material'