2022-08-09 23:56:06 +00:00
|
|
|
" --- custom format settings ------------------------------------------
|
|
|
|
" {{{
|
2020-11-04 21:09:09 +00:00
|
|
|
function FormatFileType(indent, expandtab, foldmethod, foldlevel, spell)
|
|
|
|
let &l:tabstop = a:indent
|
|
|
|
let &l:softtabstop = a:indent
|
|
|
|
let &l:shiftwidth = a:indent
|
|
|
|
|
|
|
|
let &l:expandtab = a:expandtab
|
|
|
|
|
|
|
|
let &l:foldmethod = a:foldmethod
|
|
|
|
let &l:foldlevel = a:foldlevel
|
|
|
|
|
|
|
|
let &l:spell = a:spell
|
|
|
|
endfunction
|
|
|
|
|
2022-08-09 19:29:47 +00:00
|
|
|
augroup forced_filetype_recognition
|
|
|
|
autocmd BufRead,BufNewFile *.tmux setfiletype tmux
|
|
|
|
autocmd BufRead,BufNewFile *.clisp setfiletype lisp
|
|
|
|
autocmd BufRead,BufNewFile *.lsp setfiletype lisp
|
|
|
|
autocmd BufRead,BufNewFile Dockerfile* setfiletype dockerfile
|
|
|
|
autocmd BufRead,BufNewFile *i3.conf setfiletype i3config
|
|
|
|
autocmd BufRead,BufNewFile *.template.yaml set filetype=yaml.cloudformation
|
|
|
|
autocmd BufRead,BufNewFile git.conf setfiletype gitconfig
|
|
|
|
|
|
|
|
let g:tex_flavor = "latex"
|
|
|
|
augroup end
|
|
|
|
|
2019-09-26 22:00:03 +00:00
|
|
|
augroup filetype_specific_formatting
|
|
|
|
autocmd!
|
2020-11-04 21:09:09 +00:00
|
|
|
autocmd FileType python call FormatFileType(4, v:true, 'indent', 99, v:false)
|
|
|
|
autocmd FileType java call FormatFileType(4, v:true, 'indent', 99, v:false)
|
|
|
|
autocmd FileType cpp call FormatFileType(4, v:true, 'indent', 99, v:false)
|
2020-11-11 20:10:16 +00:00
|
|
|
autocmd FileType cmake call FormatFileType(4, v:true, 'indent', 99, v:false)
|
2020-11-04 21:09:09 +00:00
|
|
|
autocmd FileType cs call FormatFileType(4, v:true, 'indent', 99, v:false)
|
2021-09-21 15:30:43 +00:00
|
|
|
autocmd FileType css call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2021-12-14 19:09:06 +00:00
|
|
|
autocmd FileType sass call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2020-11-04 21:09:09 +00:00
|
|
|
autocmd FileType html call FormatFileType(2, v:true, 'indent', 99, v:false)
|
|
|
|
autocmd FileType javascript call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2021-12-14 19:09:06 +00:00
|
|
|
autocmd FileType typescript call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2020-11-04 21:09:09 +00:00
|
|
|
autocmd FileType vim call FormatFileType(4, v:false, 'marker', 99, v:false)
|
|
|
|
autocmd FileType sh call FormatFileType(4, v:false, 'indent', 99, v:false)
|
|
|
|
autocmd FileType zsh call FormatFileType(4, v:false, 'indent', 99, v:false)
|
|
|
|
autocmd FileType lisp call FormatFileType(2, v:true, 'indent', 99, v:false)
|
|
|
|
autocmd FileType markdown call FormatFileType(2, v:false, 'indent', 99, v:true )
|
|
|
|
autocmd FileType tex call FormatFileType(8, v:false, 'indent', 99, v:true )
|
|
|
|
autocmd FileType postscr call FormatFileType(2, v:true, 'indent', 99, v:false)
|
|
|
|
autocmd FileType haskell call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2020-11-11 20:10:16 +00:00
|
|
|
autocmd FileType perl call FormatFileType(4, v:true, 'indent', 99, v:false)
|
2020-12-30 17:43:32 +00:00
|
|
|
autocmd FileType kotlin call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2021-04-09 21:25:32 +00:00
|
|
|
autocmd FileType dockerfile call FormatFileType(4, v:true, 'indent', 99, v:false)
|
2021-06-28 17:24:34 +00:00
|
|
|
autocmd FileType vue call FormatFileType(2, v:true, 'indent', 99, v:false)
|
2021-08-23 22:36:56 +00:00
|
|
|
autocmd FileType go call FormatFileType(4, v:false, 'manual', 99, v:false)
|
|
|
|
autocmd FileType json call FormatFileType(2, v:false, 'indent', 99, v:false)
|
2019-12-31 21:26:32 +00:00
|
|
|
augroup end
|
2019-09-26 22:00:03 +00:00
|
|
|
|
2022-08-09 23:56:06 +00:00
|
|
|
let g:markdown_fenced_languages = ['javascript', 'json', 'python', 'bash', 'yaml', 'shell=zsh']
|
2019-09-26 22:00:03 +00:00
|
|
|
" }}}
|
2019-09-22 21:00:32 +00:00
|
|
|
|
2020-11-04 21:09:09 +00:00
|
|
|
|
2022-08-09 23:56:06 +00:00
|
|
|
" --- (e)xe(c)ute -----------------------------------------------------
|
|
|
|
" (i)nteractive
|
|
|
|
" (b)uild
|
|
|
|
" auto-(f)ormat
|
|
|
|
" (t)ests
|
|
|
|
" {{{
|
|
|
|
augroup file_specific_command_overrides
|
|
|
|
nnoremap <Leader>ec :call SplitPaneTest('%:p', v:true)<CR>
|
|
|
|
nnoremap <Leader>ei :echohl ErrorMsg <bar> echom 'ERROR: no interactive execute defined' <bar> echohl None<CR>
|
|
|
|
nnoremap <Leader>eb :echohl ErrorMsg <bar> echom 'ERROR: no build steps defined' <bar> echohl None<CR>
|
|
|
|
nnoremap <Leader>ef :echohl ErrorMsg <bar> echom 'ERROR: no auto-format steps defined' <bar> echohl None<CR>
|
|
|
|
nnoremap <Leader>et :echohl ErrorMsg <bar> echom 'ERROR: no test steps defined' <bar> echohl None<CR>
|
2020-09-22 04:50:54 +00:00
|
|
|
|
2022-08-09 23:56:06 +00:00
|
|
|
autocmd FileType tex nnoremap <Leader>ec :! scwrypts -n latex/open-pdf -- %:p<CR>
|
|
|
|
autocmd FileType tex nnoremap <Leader>eb :! scwrypts -n latex/build-pdf -- %:p<CR>
|
|
|
|
autocmd FileType tex nnoremap <Leader>ef :! scwrypts -n latex/cleanup -- %:p<CR>
|
2020-09-22 04:50:54 +00:00
|
|
|
|
2022-08-17 06:46:55 +00:00
|
|
|
autocmd FileType markdown nnoremap <Leader>ec :!xdg-open %:p<CR>
|
2021-08-23 22:36:56 +00:00
|
|
|
|
2022-08-09 23:56:06 +00:00
|
|
|
autocmd FileType go nnoremap <Leader>ec :!clear<CR><CR>q:?GoRun<CR><CR>
|
|
|
|
autocmd FileType go nnoremap <silent> <Leader>ef <Plug>(go-imports)
|
|
|
|
autocmd FileType go nnoremap <silent> gd <Plug>(go-def-tab)
|
|
|
|
|
|
|
|
autocmd FileType python nnoremap <Leader>ec :call SplitPaneTest('bpython %')<CR>
|
|
|
|
autocmd FileType python nnoremap <Leader>ei :call SplitPaneTest('bpython -qi %')<CR>
|
2021-08-23 22:36:56 +00:00
|
|
|
augroup end
|
2020-09-22 04:50:54 +00:00
|
|
|
" }}}
|
|
|
|
|
2019-09-22 21:00:32 +00:00
|
|
|
|
2022-08-09 23:56:06 +00:00
|
|
|
" --- organization overrides ------------------------------------------
|
|
|
|
" {{{
|
|
|
|
|
|
|
|
source $WRYNVIMPATH/override/rentdynamics.vim
|
|
|
|
source $WRYNVIMPATH/override/directus.vim
|
|
|
|
|
2019-09-22 21:00:32 +00:00
|
|
|
" }}}
|
2020-09-10 15:24:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
syntax on
|