1
- " Cobbled together from various sources, including the spf-13 .vimrc
2
-
3
1
set nocompatible " Must be first line
4
2
5
- " Set up Vundle
6
- filetype on
7
- filetype off
8
- set rtp += ~/.vim/bundle/Vundle.vim
9
- call vundle#begin ()
10
-
11
- Plugin ' flazz/vim-colorschemes'
12
- Plugin ' tpope/vim-fugitive'
13
- Plugin ' Lokaltog/vim-easymotion'
14
- Plugin ' mileszs/ack.vim'
15
- Plugin ' ctrlpvim/ctrlp.vim'
16
- Plugin ' FelikZ/ctrlp-py-matcher'
3
+ " Force python3
4
+ if has (' python3' )
5
+ endif
6
+
7
+ " vim-plug
8
+ call plug#begin (' ~/.vim/plugged' )
9
+
10
+ Plug ' flazz/vim-colorschemes'
11
+ Plug ' mbbill/undotree'
12
+ Plug ' ervandew/supertab'
13
+
14
+ Plug ' ctrlpvim/ctrlp.vim'
15
+ Plug ' raghur/fruzzy' , {' do' : { - > fruzzy#install ()}}
16
+
17
+
18
+ Plug ' vim-airline/vim-airline'
19
+ Plug ' vim-airline/vim-airline-themes'
20
+
21
+ " Initialize plugin system
22
+ call plug#end ()
23
+
24
+ " Plugin 'tpope/vim-fugitive'
25
+ " Plugin 'Lokaltog/vim-easymotion'
26
+ " Plugin 'mileszs/ack.vim'
17
27
" Plugin 'Valloric/YouCompleteMe'
18
- Plugin ' ervandew/supertab.git'
19
- Plugin ' davidhalter/jedi-vim.git'
28
+ " Plugin 'davidhalter/jedi-vim.git'
20
29
21
- Plugin ' skammer/vim-css-color'
30
+ " Plugin 'skammer/vim-css-color'
22
31
23
32
" TODO potentially remove
24
- Plugin ' terryma/vim-multiple-cursors'
33
+ " Plugin 'terryma/vim-multiple-cursors'
25
34
26
35
" Plugin 'Lokaltog/powerline', {'rtp':'/powerline/bindings/vim'}
27
- Plugin ' vim-airline/vim-airline'
28
- Plugin ' vim-airline/vim-airline-themes'
29
- Plugin ' godlygeek/csapprox'
30
- Plugin ' mbbill/undotree'
31
- Plugin ' nathanaelkane/vim-indent-guides'
32
- Plugin ' airblade/vim-gitgutter'
33
- Plugin ' scrooloose/nerdcommenter'
34
- Plugin ' godlygeek/tabular'
35
- Plugin ' w0rp/ale'
36
+ " Plugin 'godlygeek/csapprox'
37
+ " Plugin 'nathanaelkane/vim-indent-guides'
38
+ " Plugin 'airblade/vim-gitgutter'
39
+ " Plugin 'scrooloose/nerdcommenter'
40
+ " Plugin 'w0rp/ale'
36
41
37
42
38
43
" TODO potentially use, settings below
39
44
" Plugin 'klen/python-mode'
40
45
41
- Plugin ' kchmck/vim-coffee-script'
42
- Plugin ' pangloss/vim-javascript'
43
- Plugin ' mxw/vim-jsx'
44
- Plugin ' elzr/vim-json'
45
- Plugin ' hail2u/vim-css3-syntax'
46
- Plugin ' tpope/vim-haml'
47
- Plugin ' slim-template/vim-slim.git'
48
- Plugin ' tpope/vim-rails.git'
49
- Plugin ' vim-ruby/vim-ruby.git'
50
- Plugin ' ngmy/vim-rubocop'
51
- Plugin ' tpope/vim-bundler.git'
52
- Plugin ' chase/vim-ansible-yaml'
53
- Plugin ' mtscout6/vim-cjsx'
54
-
55
- " May need to use classic vim-latex-suite as this is a fork
56
- " Plugin 'gerw/vim-latex-suite'
57
- Plugin ' lervag/vimtex'
58
-
59
- Plugin ' freitass/todo.txt-vim'
60
-
61
- Plugin ' hashivim/vim-terraform'
62
-
63
- call vundle#end ()
46
+ " Plugin 'pangloss/vim-javascript'
47
+ " Plugin 'mxw/vim-jsx'
48
+ " Plugin 'elzr/vim-json'
49
+ " Plugin 'hail2u/vim-css3-syntax'
50
+ " Plugin 'tpope/vim-haml'
51
+ " Plugin 'slim-template/vim-slim.git'
52
+ " Plugin 'tpope/vim-rails.git'
53
+ " Plugin 'vim-ruby/vim-ruby.git'
54
+ " Plugin 'ngmy/vim-rubocop'
55
+ " Plugin 'tpope/vim-bundler.git'
56
+ " Plugin 'chase/vim-ansible-yaml'
57
+
58
+ " Plugin 'freitass/todo.txt-vim'
59
+
60
+ " Plugin 'hashivim/vim-terraform'
61
+
64
62
filetype plugin indent on " Automatically detect file types.
65
63
66
64
set background = dark
@@ -87,9 +85,6 @@ set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatib
87
85
88
86
set spell
89
87
set spell spelllang = en
90
- au FileType apache set spell nospell
91
- au FileType conf set spell nospell
92
- au FileType make set spell nospell
93
88
set dictionary = /usr/ share/dict/ words
94
89
95
90
" http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
@@ -154,23 +149,23 @@ highlight clear SignColumn
154
149
" in relative mode. Things like vim-gitgutter will match LineNr highlight
155
150
highlight clear LineNr
156
151
157
- if has (' cmdline_info' )
158
- set ruler " Show the ruler
159
- set rulerformat = % 30 (% = \: b % n % y % m % r % w \ % l ,% c % V\ % P % ) " A ruler on steroids
160
- set showcmd " Show partial commands in status line and selected characters/lines in visual mode
161
- endif
162
-
163
- if has (' statusline' )
164
- set laststatus = 2
165
-
166
- " Broken down into easily includeable segments
167
- set statusline = % <% f \ " Filename
168
- set statusline += % w % h % m % r " Options
169
- set statusline += % {fugitive#statusline ()} " Git Hotness
170
- set statusline += \ [% {&ff }/% Y] " Filetype
171
- set statusline += \ [% {getcwd ()}] " Current dir
172
- set statusline += % = % -14 .(% l ,% c % V% )\ % p %% " Right aligned file nav info
173
- endif
152
+ " if has('cmdline_info')
153
+ " set ruler " Show the ruler
154
+ " set rulerformat=%30(%=\:b%n%y%m%r%w\ %l,%c%V\ %P%) " A ruler on steroids
155
+ " set showcmd " Show partial commands in status line and selected characters/lines in visual mode
156
+ " endif
157
+
158
+ " if has('statusline')
159
+ " set laststatus=2
160
+ "
161
+ " " Broken down into easily includeable segments
162
+ " set statusline=%<%f\ " Filename
163
+ " set statusline+=%w%h%m%r " Options
164
+ " set statusline+=%{fugitive#statusline()} " Git Hotness
165
+ " set statusline+=\ [%{&ff}/%Y] " Filetype
166
+ " set statusline+=\ [%{getcwd()}] " Current dir
167
+ " set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
168
+ " endif
174
169
175
170
set backspace = indent ,eol ,start " Backspace for dummies
176
171
set linespace = 0 " No extra spaces between rows
@@ -219,12 +214,15 @@ au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
219
214
au FileType yaml setl sw = 2 sts = 2 et
220
215
au FileType ruby setl sw = 2 sts = 2 et
221
216
au FileType slim setl sw = 2 sts = 2 et
222
- au FileType coffee setl sw = 2 sts = 2 et
223
217
au FileType sass setl sw = 2 sts = 2 et
224
218
au FileType scss setl sw = 2 sts = 2 et
225
219
au FileType javascript.jsx setl sw = 2 sts = 2 et
226
220
au FileType javascript setl sw = 2 sts = 2 et
227
221
222
+ au FileType apache set spell nospell
223
+ au FileType conf set spell nospell
224
+ au FileType make set spell nospell
225
+
228
226
" Remove trailing whitespaces and ^M chars in programs
229
227
function ! StripTrailingWhitespace ()
230
228
" Preparation: save last search, and cursor position.
@@ -237,8 +235,7 @@ function! StripTrailingWhitespace()
237
235
let @/ = _s
238
236
call cursor (l , c )
239
237
endfunction
240
- " autocmd FileType c,cpp,java,go,php,ruby,javascript,python,haml,xml,yml,coffee autocmd BufWritePre <buffer> call StripTrailingWhitespace()
241
- autocmd BufNewFile ,BufReadPost *.coffee setl shiftwidth = 2 expandtab
238
+ autocmd FileType c,cpp,java,go,php,ruby,javascript,python,haml,xml,yml autocmd BufWritePre <buffer> call StripTrailingWhitespace ()
242
239
243
240
let mapleader = ' \'
244
241
@@ -324,33 +321,19 @@ map <Leader>e :e <C-R>=expand("%:p:h") . "/" <CR>
324
321
map zl zL
325
322
map zh zH
326
323
327
- " Plugin-specific configuration
328
-
329
- " Tabularize
330
- nmap <Leader> a& :Tabularize /&<CR>
331
- vmap <Leader> a& :Tabularize /&<CR>
332
- nmap <Leader> a= :Tabularize /=<CR>
333
- vmap <Leader> a= :Tabularize /=<CR>
334
- nmap <Leader> a: :Tabularize /:<CR>
335
- vmap <Leader> a: :Tabularize /:<CR>
336
- nmap <Leader> a:: :Tabularize /:\zs<CR>
337
- vmap <Leader> a:: :Tabularize /:\zs<CR>
338
- nmap <Leader> a, :Tabularize /,<CR>
339
- vmap <Leader> a, :Tabularize /,<CR>
340
- nmap <Leader> a,, :Tabularize /,\zs<CR>
341
- vmap <Leader> a,, :Tabularize /,\zs<CR>
342
- nmap <Leader> a<Bar> :Tabularize /<Bar><CR>
343
- vmap <Leader> a<Bar> :Tabularize /<Bar><CR>
344
-
345
- " JSON: TODO figure out what this does, from spf13
346
324
nmap <leader> jt <Esc> :%!python -m json.tool<CR><Esc> :set filetype=json<CR>
347
325
326
+ " Plugin-specific configuration
327
+
348
328
" PyMode TODO figure out whether to use, from spf13
349
329
" let g:pymode_lint_checker = "pyflakes"
350
330
" let g:pymode_utils_whitespaces = 0
351
331
" let g:pymode_options = 0
352
332
353
- " ctrlp
333
+ " ctrlp / fruzzy
334
+ let g: fruzzy #usenative = 1
335
+ let g: fruzzy #sortonempty = 1
336
+
354
337
let g: ctrlp_working_path_mode = ' ra'
355
338
nnoremap <silent> <Leader> t :CtrlP<CR>
356
339
nnoremap <silent> <Leader> y :CtrlPMRU<CR>
@@ -370,37 +353,38 @@ let g:ctrlp_user_command = {
370
353
\ ' fallback' : ' find %s -type f'
371
354
\ }
372
355
let g: ctrlp_follow_symlinks = 1
373
- let g: ctrlp_match_func = { ' match' : ' pymatcher#PyMatch' }
356
+ let g: ctrlp_match_func = {' match' : ' fruzzy#ctrlp#matcher' }
357
+ let g: ctrlp_match_current_file = 1 " to include current file in matches
374
358
375
359
" Fugitive
376
- nnoremap <silent> <leader> gs :Gstatus<CR>
377
- nnoremap <silent> <leader> gd :Gdiff<CR>
378
- nnoremap <silent> <leader> gc :Gcommit<CR>
379
- nnoremap <silent> <leader> gb :Gblame<CR>
380
- nnoremap <silent> <leader> gl :Glog<CR>
381
- nnoremap <silent> <leader> gp :Git push<CR>
382
- nnoremap <silent> <leader> gr :Gread<CR> :GitGutter<CR>
383
- nnoremap <silent> <leader> gw :Gwrite<CR> :GitGutter<CR>
384
- nnoremap <silent> <leader> ge :Gedit<CR>
385
- nnoremap <silent> <leader> gg :GitGutterToggle<CR>
360
+ " nnoremap <silent> <leader>gs :Gstatus<CR>
361
+ " nnoremap <silent> <leader>gd :Gdiff<CR>
362
+ " nnoremap <silent> <leader>gc :Gcommit<CR>
363
+ " nnoremap <silent> <leader>gb :Gblame<CR>
364
+ " nnoremap <silent> <leader>gl :Glog<CR>
365
+ " nnoremap <silent> <leader>gp :Git push<CR>
366
+ " nnoremap <silent> <leader>gr :Gread<CR>:GitGutter<CR>
367
+ " nnoremap <silent> <leader>gw :Gwrite<CR>:GitGutter<CR>
368
+ " nnoremap <silent> <leader>ge :Gedit<CR>
369
+ " nnoremap <silent> <leader>gg :GitGutterToggle<CR>
386
370
387
371
" gitgutter
388
- set signcolumn = yes
372
+ " set signcolumn=yes
389
373
390
374
" UndoTree
391
375
nnoremap <Leader> u :UndotreeToggle<CR>
392
376
" If undotree is opened, it is likely one wants to interact with it.
393
377
let g: undotree_SetFocusWhenToggle= 1
394
378
395
379
" indent_guides
396
- let g: indent_guides_start_level = 2
397
- let g: indent_guides_guide_size = 1
398
- let g: indent_guides_enable_on_vim_startup = 1
380
+ " let g:indent_guides_start_level = 2
381
+ " let g:indent_guides_guide_size = 1
382
+ " let g:indent_guides_enable_on_vim_startup = 1
399
383
400
384
" vim-airline
401
385
let g: airline_theme = ' murmur'
402
386
let g: airline_enable_branch = 1
403
- let g: airline #extensions#ale#enabled = 1
387
+ " let g:airline#extensions#ale#enabled = 1
404
388
set ttimeoutlen = 50
405
389
406
390
" vim-powerline symbols
@@ -442,37 +426,6 @@ else
442
426
endif
443
427
endif
444
428
445
- " let g:tex_flavor = 'latex'
446
- " let g:Tex_MultipleCompileFormat = 'pdf,aux'
447
- " let g:Tex_TreatMacViewerAsUNIX = 0
448
- " let g:Tex_DefaultTargetFormat = 'pdf'
449
- " let g:Tex_CompileRule_pdf = 'pdflatex -synctex=1 --interaction=nonstopmode $*'
450
- " let g:Tex_ViewRule_pdf = 'Skim'
451
-
452
- let g: vimtex_view_general_viewer
453
- \ = ' /Users/arjun/Applications/Skim.app/Contents/SharedSupport/displayline'
454
- let g: vimtex_view_general_options = ' -r @line @pdf @tex'
455
-
456
- " This adds a callback hook that updates Skim after compilation
457
- let g: vimtex_latexmk_callback_hooks = [' UpdateSkim' ]
458
- function ! UpdateSkim (status)
459
- if ! a: status | return | endif
460
-
461
- let l: out = b: vimtex .out ()
462
- let l: tex = expand (' %:p' )
463
- let l: cmd = [g: vimtex_view_general_viewer , ' -r' ]
464
- if ! empty (system (' pgrep Skim' ))
465
- call extend (l: cmd , [' -g' ])
466
- endif
467
- if has (' nvim' )
468
- call jobstart (l: cmd + [line (' .' ), l: out , l: tex ])
469
- elseif has (' job' )
470
- call job_start (l: cmd + [line (' .' ), l: out , l: tex ])
471
- else
472
- call system (join (l: cmd + [line (' .' ), shellescape (l: out ), shellescape (l: tex )], ' ' ))
473
- endif
474
- endfunction
475
-
476
429
" Run a shell command
477
430
function ! s: RunShellCommand (cmdline)
478
431
botright new
0 commit comments