-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
291 lines (218 loc) · 6.67 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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
" VIMRC for Ankur Gupta
" Vundle Init
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Vundle Plugins
" Vundle Base Plugin
Plugin 'VundleVim/Vundle.vim'
" Theme
" Plugin 'jpo/vim-railscasts-theme'
" Plugin 'pR0Ps/molokai-dark'
" Plugin 'dracula/vim'
" Plugin 'junegunn/seoul256.vim'
" Plugin 'chriskempson/base16-vim'
" Plugin 'ajmwagar/vim-deus'
" Plugin 'dracula/vim'
" Plugin 'liuchengxu/space-vim-dark'
" Plugin 'danilo-augusto/vim-afterglow'
" Plugin 'nightsense/carbonized'
" Plugin 'challenger-deep-theme/vim'
" Plugin 'w0ng/vim-hybrid'
" Plugin 'morhetz/gruvbox'
" Plugin 'chriskempson/base16-vim'
Plugin 'drewtempelmeyer/palenight.vim'
" Plugins for bars on the top and the bottom
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
" File viewer
Plugin 'scrooloose/nerdtree'
" Guides for Indents
" Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'Yggdroot/indentLine'
" Display marks in the gutter
Plugin 'kshenoy/vim-signature'
" Autocomplete braces and such
Plugin 'Raimondi/delimitMate'
" IDE type autocomplete
Plugin 'ajh17/VimCompletesMe'
" Snippets
" Plugin 'SirVer/ultisnips'
" Fuzzy File Finder
" Plugin 'kien/ctrlp.vim'
" Plugin 'wincent/command-t'
Plugin 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plugin 'junegunn/fzf.vim'
" Advanced search
Plugin 'wincent/ferret'
" Autocomplete when searching
Plugin 'vim-scripts/SearchComplete'
" Openscad Support
Plugin 'sirtaj/vim-openscad'
" Async Code Execution
Plugin 'skywind3000/asyncrun.vim'
" Grammar checking
" Plugin 'rhysd/vim-grammarous'
" LaTeX Live Preview
Plugin 'xuhdev/vim-latex-live-preview'
" Scala support
Plugin 'derekwyatt/vim-scala'
" Easy surroundings modifications
Plugin 'tpope/vim-surround'
" Show git diffs in the gutter
Plugin 'mhinz/vim-signify'
" Even more efficient vim motions
Plugin 'easymotion/vim-easymotion'
" Differnet colors on parentheses to make them ook better
" Plugin 'kien/rainbow_parentheses.vim'
" Dockerfile support
Plugin 'ekalinin/Dockerfile.vim'
" Tag support
Plugin 'majutsushi/tagbar'
" Vertical Alignment
Plugin 'godlygeek/tabular'
" Linter
Plugin 'w0rp/ale'
" Python autocompletion
" Plugin 'davidhalter/jedi-vim'
" Doxygen Toolkit
Plugin 'vim-scripts/DoxygenToolkit.vim'
Plugin 'posva/vim-vue'
" Vundle Closing
call vundle#end()
" ---- Plugin Settings
" Custom fzf commands
" --column: Show column number
" --line-number: Show line number
" --no-heading: Do not show file headings in results
" --fixed-strings: Search term as a literal string
" --ignore-case: Case insensitive search
" --no-ignore: Do not respect .gitignore, etc...
" --hidden: Search hidden files and folders
" --follow: Follow symlinks
" --glob: Additional conditions for search (in this case ignore everything in the .git/ folder)
" --color: Search color options
command! -bang -nargs=* RG call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --no-ignore --hidden --follow --glob "!.git/*" --glob "!*.log" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
" ++ NERD Tree settings
" Disable NERD Tree arrows
let g:NERDTreeDirArrows=0
" Set F2 to open NERD Tree
" Set F3 to find the currently opened file
" Set F4 to peek at a file
silent! map <F2> :NERDTreeToggle<CR>
silent! map <F3> :NERDTreeFind<CR>
let g:NERDTreeToggle="<F2>"
let g:NERDTreeMapActivateNode="<F3>"
let g:NERDTreeMapPreview="<F4>"
" ALE settings
let b:ale_linters = ['flake8, pylint', 'gcc']
" Bind grammar window to control - g
nmap <C-g> <Plug>(grammarous-open-info-window)
" Use vim spell check
let g:grammarous#use_vim_spelllang = 1
" Change PDF viewer to zathura
let g:livepreview_previewer = 'zathura'
" Change updates to 500 ms
set updatetime=500
let g:airline#extensions#tabline#enabled = 1
" let g:UltiSnipsSnippetsDir="~/.vim/UltiSnips/"
" let g:UltiSnipsExpandTrigger="<c-]>"
" let g:UltiSnipsJumpForwardTrigger="<c-]>"
" let g:UltiSnipsJumpBackwardTrigger="<s-tab>"
" let g:UltiSnipsEditSplit="vertical"
" let g:UltiSnipsRemoveSelectModeMappings = 0
filetype plugin indent on
" ---- User settings ----
" Shows syntax
syntax on
" Show line numbering
set number
set relativenumber
" Soft wrapping
set wrap
set linebreak
" Highlight seraches by default
set hls
" Add incremental search
set incsearch
" Make searching case insensitive by default
set ignorecase
set smartcase
" Dabbing, wait, shit! I mean tabbing!
set tabstop=2
set shiftwidth=2
set softtabstop=2
" Left column width
set foldcolumn=6
" Fix backspace
set backspace=indent,eol,start
" Pretty dank cursor column highlighting
set cursorcolumn
" Wrap guide at 80 chars... psych! Welcome to the modern age, where we can now afford a whopping 100
" chars!. However, diffs are nice to see side by side, so the limit has just been bumped up.
set colorcolumn=80
set tw=80
" Forgive me lord, for I have become a pleb
set mouse=a
" Conceal settings for doers, not lookers
set concealcursor=""
" 'nuff said
set encoding=utf-8
if has('nvim') || has('termguicolors')
set termguicolors
endif
" Choose color scheme
set background=dark
colorscheme palenight
" colorscheme gruvbox
" colorscheme space-vim-dark
" colorscheme railscasts
" colorscheme molokai-dark
" colorscheme darcula
" color dracula
" colo seoul256
" colorscheme default
" colorscheme ron
" color dracula
" colorscheme base16-default-dark
" Range: 233 (darkest) ~ 238 (lightest)
" Default: 235
" let g:space_vim_dark_background = 235
" color space-vim-dark
let g:palenight_terminal_italics=1
" Macros for windowed mode
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
map <F7> <C-w>+
map <F8> <C-w>-
map <F9> <C-w><
map <F10> <C-w>>
" Adding lines when in normal mode
map <Enter> o<ESC>
" Toggle folds with space bar in normal mode
nnoremap <space> za
" Surround the highlighted string
map <Leader>9 s()<ESC>P
map <Leader>[ s[]<ESC>P
map <Leader>; s''<ESC>P
map <Leader>' s""<ESC>P
map <Leader>, s<><ESC>P
map <Leader>d <ESC>`>x`<x
" Adding support for moving up and down on wrapped lines
map j gj
map k gk
" File specific commands
autocmd FileType markdown setlocal spell spelllang=en_us
autocmd FileType markdown setlocal concealcursor=" "
autocmd FileType tex setlocal spell spelllang=en_us
autocmd FileType tex setlocal concealcursor=" "
" Add Google Apps script support
autocmd BufNewFile,BufRead *.gs set filetype=javascript
" Regulation tabbing for python
autocmd FileType python set tabstop=4
autocmd FileType python set shiftwidth=4
autocmd FileType python set softtabstop=4