X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/4850f4c28bd13b74c18979652de1c4b850cdc86f..d928d58f1d1502c9751068ee52244c8c94fce31a:/etc/vim/.vimrc?ds=sidebyside diff --git a/etc/vim/.vimrc b/etc/vim/.vimrc index 3c96a4f..7a142e4 100644 --- a/etc/vim/.vimrc +++ b/etc/vim/.vimrc @@ -1,35 +1,49 @@ source $VIMRUNTIME/defaults.vim -let x = ($XDG_CONFIG_HOME??($HOME."/.config"))."/vim" +let x = ($XDG_CONFIG_HOME??($HOME.'/.config')).'/vim' execute 'set runtimepath='.x.','.&runtimepath.','.x.'/after' execute 'set packpath='.x.','.&packpath.','.x.'/after' packadd matchit -let x = ($XDG_DATA_HOME??($HOME."/.local/share"))."/vim" +let x = ($XDG_STATE_HOME??($HOME.'/.local/state')).'/vim' if !isdirectory(x) - call mkdir(x, "p", 0700) + call mkdir(x, 'p', 0700) +endif +execute 'set viminfofile='.x.'/.viminfo' + +let y = x.'/swap' +if !isdirectory(y) + call mkdir(y, 'p', 0700) +endif +execute 'set directory='.y.'//' + +let y = x.'/backup' +if !isdirectory(y) + call mkdir(y, 'p', 0700) endif set backup -execute 'set backupdir='.x.'//' +execute 'set backupdir='.y.'//' set backupcopy=yes -let x = ($XDG_STATE_HOME??($HOME."/.local/state"))."/vim" -if !isdirectory(x) - call mkdir(x, "p", 0700) + +let y = x.'/undo' +if !isdirectory(y) + call mkdir(y, 'p', 0700) endif set undofile -execute 'set undodir='.x.'//' -execute 'set viminfofile='.x.'/.viminfo' +execute 'set undodir='.y.'//' + unlet x +unlet y set autoindent set colorcolumn=80 highlight ColorColumn term=NONE ctermbg=0 -autocmd FileType python setlocal tabstop=4 shiftwidth=4 expandtab -autocmd FileType markdown setlocal tabstop=4 shiftwidth=4 expandtab -autocmd FileType javascript setlocal tabstop=2 shiftwidth=2 expandtab -autocmd FileType json setlocal tabstop=2 shiftwidth=2 expandtab -autocmd FileType html setlocal tabstop=2 shiftwidth=2 expandtab +autocmd FileType python setlocal softtabstop=4 shiftwidth=4 expandtab +autocmd FileType markdown setlocal softtabstop=4 shiftwidth=4 expandtab +autocmd FileType javascript setlocal softtabstop=2 shiftwidth=2 expandtab +autocmd FileType json setlocal softtabstop=2 shiftwidth=2 expandtab +autocmd FileType html setlocal softtabstop=2 shiftwidth=2 expandtab autocmd FileType todo setlocal colorcolumn=0 set cursorline @@ -44,7 +58,7 @@ autocmd FocusLost * setlocal norelativenumber autocmd FocusGained * setlocal relativenumber highlight WhiteSpaceBol ctermfg=DarkBlue highlight WhiteSpaceMol ctermfg=Black -match WhiteSpaceMol / / -2match WhiteSpaceBol /\(^ \+\)\|\( \+$\)/ +autocmd BufEnter * 2match WhiteSpaceBol /\(^ \+\)\|\( \+$\)/ +autocmd BufEnter * match WhiteSpaceMol / / -" vim: set et fenc=utf-8 ft=vim sts=4 sw=4 ts=8 tw=79 : +let g:EditorConfig_enable_for_new_buf = 1