-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
216 lines (191 loc) · 5.72 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
" # Basic Config #
" ## UTF-8 ##
set encoding=UTF-8
" ## vim not vi ##
set nocompatible
" ## Space as leader ##
let mapleader=' '
" ## See leader command ##
set showcmd
" ## Hybrid line numbers ##
set number relativenumber
" ## Backspace ##
set backspace=start,eol,indent
" ## Last status ##
set laststatus=2
" ## Persistant Undo ##
set undodir=~/.vim/undodir
set undofile
" ## Delete comment character on joining commented lines ##
set formatoptions+=j
" ## Colors ##
set term=xterm-256color
set termguicolors
" ## margin lines ##
set scrolloff=4
" ## incremental search ##
set incsearch
" ## Split below and to the right ##
set splitright splitbelow
" # Autocmds #
" Track last tab in variable
let g:lasttab=1
augroup TabLast
autocmd!
autocmd TabLeave * let g:lasttab = tabpagenr()
augroup END
" # Close vim if Quickfix is the last window/tab #
augroup CloseQF
autocmd!
autocmd WinEnter * if winnr('$') == 1 && &buftype == "quickfix"|q|endif
augroup END
" # Normal Mode Mappings #
" ## Change Ex mode to last macro ##
nnoremap Q @@
" ## <C-hjkl> for split navigation ##
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
" ## Split Resizing ##
nnoremap <silent> <leader>= :exe "resize " . (winheight(0) * 5/4)<CR>
nnoremap <silent> <leader>- :exe "resize " . (winheight(0) * 4/5)<CR>
" ## <Alt-h/l> => prev tab/next tab by index ##
" nnoremap h gT " <a-h>
" nnoremap l gt " <a-l>
" ## <Alt-j/k> toggles between previous and last opened tab ##
" nnoremap <silent> j :exe "tabn ".g:lasttab<CR>
" nnoremap <silent> k :exe "tabn ".g:lasttab<CR>
" ## Easier delete to null register ##
nnoremap <leader>d "_d
" ## cd to file directory ##
nnoremap <leader>cd :lcd %:h<CR>
" ## open ~/.vimrc in new tab ##
nnoremap <leader>vimrc :tabedit $MYVIMRC<CR>
" ## toggle conceal between 0 and 2 ##
nnoremap <leader>rd :setlocal conceallevel=<c-r>=&conceallevel == 0 ? '2' : '0'<cr><cr>
" ## make Y yank to end of line instead of yy ##
nnoremap Y y$"
" ## map yank to clipboard ##
nnoremap <leader>y "+y
nnoremap <leader>Y "+y$
" ## map put from clipboard ##
nnoremap <leader>p "+p
nnoremap <leader>P "+P
" ## map from select (three finger/middle click) ##
nnoremap <leader>o "*p
nnoremap <leader>O "*P
" # Insert Mode Mappings #
" ## Quick Spellcheck fix ##
imap <C-Q> <Esc>[s1z=`]a
" ## – with control on dash ##
imap <C-_> <C-k>-N
" # Visual Mode Mappings #
" ## Sort selected text ##
vmap <leader>abc :sort<CR>
" # Internal Plugins #
" ## Syntax highlighting from ~/.vim/syntax ##
syntax enable
" ## Filtetype specific plugins from ~/.vim/ftplugin ##
filetype plugin on
" ## Filtetype based indenting from ~/.vim/indent ##
filetype indent on
" # External Plugins #
" ## Variable Init ##
let g:coc_node_path = '/usr/bin/node'
let $FZF_DEFAULT_COMMAND.=' --hidden'
let $PYTHONUNBUFFERED=1
let g:maximizer_set_default_mapping = 0
let g:goyo_width = 81
" ## Loading the Plugins ##
call plug#begin("~/.vim/plugged")
" ## Manually managed vimballs
" # Plug '~/.vim/vimballs/plugged/AnsiEsc'
" ## Custom text objects ##
" ### Base ###
Plug 'kana/vim-textobj-user'
" ### Community defined ###
Plug 'fvictorio/vim-textobj-backticks'
Plug 'kana/vim-textobj-diff'
Plug 'kana/vim-textobj-entire'
Plug 'kana/vim-textobj-indent'
Plug 'kana/vim-textobj-line'
Plug 'lucapette/vim-textobj-underscore'
Plug 'mattn/vim-textobj-url'
Plug 'adolenc/vim-textobj-toplevel'
Plug 'jasonlong/vim-textobj-css'
Plug 'rbonvall/vim-textobj-latex'
Plug 'coachshea/vim-textobj-markdown'
" ## Comment manipulations ##
Plug 'scrooloose/nerdcommenter'
" ## File explorer ##
Plug 'preservim/nerdtree'
" ## Date Incrementing ##
Plug 'tpope/vim-speeddating'
" ## Quote, (), and [] manipulations ##
Plug 'tpope/vim-surround'
" ## '.' support for plugins ##
Plug 'tpope/vim-repeat'
" ## Weird mix of case combination handling ##
Plug 'tpope/vim-abolish'
" ## Unimpaired ##
Plug 'tpope/vim-unimpaired'
" ## FftT across lines ##
Plug 'dahu/vim-fanfingtastic'
" ## Align GH markdown charts ##
Plug 'junegunn/vim-easy-align'
" ## Async Stuff ##
" ### Async Make Dispatch (vimspector) ###
Plug 'tpope/vim-dispatch'
" ### Async Make (vim-test) ###
Plug 'neomake/neomake'
" ### Async Runner (my runners) ###
Plug 'skywind3000/asyncrun.vim'
"## Language specific plugins ##
Plug 'tomlion/vim-solidity'
Plug 'vyperlang/vim-vyper'
" ### Pandoc markdown formatting and conceal ###
Plug 'vim-pandoc/vim-pandoc-syntax'
" ### A solid catchall language pack ###
" Plug 'sheerun/vim-polyglot'
" ### Python autoformatter ###
" Plug 'psf/black', { 'branch': 'stable' }
" ### Go autoformatter and inputs
Plug 'darrikonn/vim-gofmt', { 'do': ':GoUpdateBinaries' }
" ## fzf ##
Plug 'junegunn/fzf.vim'
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
" ## COC (VSCode extensions) ##
Plug 'neoclide/coc.nvim', {'branch': 'release', 'do': { -> coc#util#install()}}
" ## Interactive Testing ##
Plug 'vim-test/vim-test'
" ## Interactive Debugging ##
Plug 'puremourning/vimspector'
" ## Highlight and fix trailing whitespace ##
Plug 'ntpeters/vim-better-whitespace'
" ## Highlight what was yanked. ##
Plug 'machakann/vim-highlightedyank'
" ## Snippets ##
Plug 'honza/vim-snippets'
" ## Onedark Colorscheme ##
Plug 'joshdick/onedark.vim'
" ## Paper Colorscheme ##
Plug 'NLKNguyen/papercolor-theme'
" ## Split 'Zoom' Behavior ##
Plug 'szw/vim-maximizer'
" ## Centered View, 'focus-mode' ##
Plug 'junegunn/goyo.vim'
" ## Dim all text not in current paragraph ##
Plug 'junegunn/limelight.vim'
" ## Status Line ##
Plug 'itchyny/lightline.vim'
" ## COC Functions for Status Line ##
Plug 'josa42/vim-lightline-coc'
" ## Hightlighting of hex color codes in that color ##
Plug 'ap/vim-css-color'
" ## ANSI Codes ##
Plug 'powerman/vim-plugin-AnsiEsc'
" !!! MUST BE FINAL IMPORT !!!
" ## UTF-8 font icons ##
Plug 'ryanoasis/vim-devicons'
call plug#end()