2015-08-13 22:28:46 +00:00
|
|
|
" Functions {{
|
2015-03-27 00:54:29 +00:00
|
|
|
function! s:smart_source_rc(name)
|
|
|
|
call s:source_rc(a:name . '.rc.vim')
|
|
|
|
call s:source_rc(a:name . '.local.rc.vim')
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function! s:source_rc(path)
|
2020-02-22 01:09:00 +00:00
|
|
|
let l:f_path = fnameescape(expand('~/.vim/rc/' . a:path))
|
|
|
|
if filereadable(l:f_path)
|
|
|
|
execute 'source' . l:f_path
|
|
|
|
endif
|
2015-03-27 00:54:29 +00:00
|
|
|
endfunction
|
2015-08-13 22:28:46 +00:00
|
|
|
" }} Functions
|
2015-03-27 00:54:29 +00:00
|
|
|
|
2020-02-22 01:09:00 +00:00
|
|
|
" General
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'gregsexton/MatchTag'
|
|
|
|
Blink 'tpope/vim-endwise'
|
|
|
|
Blink 'tpope/vim-eunuch'
|
|
|
|
Blink 'tpope/vim-repeat'
|
|
|
|
Blink 'tpope/vim-rsi'
|
|
|
|
Blink 'tpope/vim-surround'
|
|
|
|
Blink 'tpope/vim-vinegar'
|
|
|
|
Blink 'vim-scripts/file-line'
|
2021-08-24 16:15:07 +00:00
|
|
|
call s:smart_source_rc('plugins/airline')
|
|
|
|
call s:smart_source_rc('plugins/startify')
|
|
|
|
call s:smart_source_rc('plugins/goyo-limelight')
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'milkypostman/vim-togglelist'
|
2020-02-22 01:09:00 +00:00
|
|
|
nnoremap <silent> <F6> :call ToggleQuickfixList()<CR>
|
|
|
|
nnoremap <silent> <F7> :call ToggleLocationList()<CR>
|
2024-07-19 22:05:09 +00:00
|
|
|
" Blink 'edkolev/tmuxline.vim' " Removed because this can fail on some machines
|
2020-02-22 01:09:00 +00:00
|
|
|
" let g:tmuxline_powerline_separators = 0
|
2015-03-27 00:45:03 +00:00
|
|
|
|
2020-02-22 01:09:00 +00:00
|
|
|
" Searching
|
2024-07-19 22:05:09 +00:00
|
|
|
if executable('fzf')
|
|
|
|
call s:smart_source_rc('plugins/fzf')
|
|
|
|
else
|
2021-08-24 16:15:07 +00:00
|
|
|
call s:smart_source_rc('plugins/ctrlp')
|
2017-11-14 03:03:12 +00:00
|
|
|
endif
|
2021-08-24 16:15:07 +00:00
|
|
|
call s:smart_source_rc('plugins/vim-grepper')
|
2015-03-26 17:09:26 +00:00
|
|
|
|
2020-02-22 01:09:00 +00:00
|
|
|
" Git / Version control
|
|
|
|
call s:smart_source_rc('plugins/fugitive')
|
|
|
|
call s:smart_source_rc('plugins/gitgutter')
|
|
|
|
|
|
|
|
" Programming
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'FooSoft/vim-argwrap'
|
2020-02-22 01:09:00 +00:00
|
|
|
nnoremap <silent> <leader>a :ArgWrap<CR>
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'tomtom/tcomment_vim'
|
2019-10-24 19:40:10 +00:00
|
|
|
nnoremap // :TComment<CR>
|
|
|
|
vnoremap // :TCommentBlock<CR>
|
|
|
|
|
2020-02-22 01:07:50 +00:00
|
|
|
" IDE stuff
|
|
|
|
|
|
|
|
" Lint and completion
|
2021-08-24 16:15:07 +00:00
|
|
|
if has('nvim') || v:version >= 800
|
|
|
|
" let g:ale_completion_enabled = 1
|
2021-04-30 18:27:39 +00:00
|
|
|
call s:smart_source_rc('plugins/ale')
|
2021-08-24 16:15:07 +00:00
|
|
|
set omnifunc=ale#completion#OmniFunc
|
|
|
|
|
|
|
|
function! s:check_back_space() abort
|
|
|
|
let col = col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~? '\s'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
set completeopt+=preview
|
2024-07-19 22:05:09 +00:00
|
|
|
imap <silent> <C-Space> <Blink>(ale_complete)
|
2021-08-24 16:15:07 +00:00
|
|
|
" inoremap <silent><expr> <C-Space>
|
|
|
|
" \ pumvisible() ? "\<C-n>" :
|
|
|
|
" \ <SID>check_back_space() ? "\<TAB>" :
|
2024-07-19 22:05:09 +00:00
|
|
|
" \ <Blink>(ale_complete)
|
2015-03-26 17:09:26 +00:00
|
|
|
end
|
|
|
|
|
2020-02-22 01:07:50 +00:00
|
|
|
" Programming Tag navigation
|
2021-08-24 16:15:07 +00:00
|
|
|
call s:smart_source_rc('plugins/tagbar')
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'ludovicchabant/vim-gutentags'
|
2021-08-24 16:15:07 +00:00
|
|
|
command! TagsUpdate :GutentagsUpdate
|
2015-03-26 17:09:26 +00:00
|
|
|
|
2020-02-22 01:09:00 +00:00
|
|
|
" Filetype configuration
|
2020-02-05 18:17:32 +00:00
|
|
|
|
|
|
|
" Languages with custom configuration
|
2021-08-24 16:14:01 +00:00
|
|
|
" Custom Go
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'fatih/vim-go'
|
2020-02-05 18:17:32 +00:00
|
|
|
" Custom rust
|
2019-04-11 20:04:32 +00:00
|
|
|
let g:rustfmt_autosave = 1
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'rust-lang/rust.vim'
|
2020-02-05 18:17:32 +00:00
|
|
|
" Lots of custom python
|
2016-11-15 17:25:41 +00:00
|
|
|
call s:smart_source_rc('plugins/python')
|
2021-08-24 16:14:01 +00:00
|
|
|
" Disable polyglot for languages with more robust plugins
|
2020-02-22 01:11:08 +00:00
|
|
|
let g:polyglot_disabled = ['go', 'rust']
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'sheerun/vim-polyglot'
|
2021-01-13 17:22:06 +00:00
|
|
|
" Custom rule for ansible playbook detection
|
|
|
|
augroup ansible_playbook
|
|
|
|
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
|
|
|
|
au BufRead,BufNewFile */playbooks/*.yaml set filetype=yaml.ansible
|
|
|
|
augroup end
|
2020-02-05 18:17:32 +00:00
|
|
|
|
|
|
|
" Languages not in polyglot
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'ViViDboarder/force-vim'
|
|
|
|
Blink 'ViViDboarder/vim-forcedotcom'
|
|
|
|
Blink 'hsanson/vim-android'
|
|
|
|
Blink 'pdurbin/vim-tsv'
|
2015-03-26 17:09:26 +00:00
|
|
|
" }}
|
|
|
|
|
2020-02-22 01:09:00 +00:00
|
|
|
" Themes
|
2024-07-19 22:05:09 +00:00
|
|
|
Blink 'altercation/vim-colors-solarized'
|
|
|
|
Blink 'vim-scripts/wombat256.vim'
|