vim/vimrc

27 lines
698 B
VimL
Raw Normal View History

2022-07-02 02:49:40 -04:00
vim9script
if &compatible
set nocompatible
endif
2022-07-02 02:49:40 -04:00
const xdg = {
2023-10-14 04:49:26 -04:00
XDG_CONFIG_HOME: '~/.config',
XDG_CACHE_HOME: '~/.cache',
XDG_DATA_HOME: '~/.local/share',
XDG_STATE_HOME: '~/.local/state',
2022-07-02 02:49:40 -04:00
}
for [key, default] in items(xdg)
2023-10-14 04:49:26 -04:00
if !has_key(environ(), key)
setenv(key, expand(default))
endif
endfor
set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CACHE_HOME/vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$XDG_CONFIG_HOME/vim/after,$XDG_CACHE_HOME/vim/after
set viminfo+=n$XDG_STATE_HOME/vim/viminfo
if exists('+packpath')
2023-10-14 04:49:26 -04:00
set packpath^=$XDG_CONFIG_HOME/vim,$XDG_CACHE_HOME/vim
endif
2022-07-02 02:49:40 -04:00
g:netrw_home = $XDG_CACHE_HOME .. '/vim/netrw'
2022-07-02 02:49:40 -04:00
$MYVIMRC = $XDG_CONFIG_HOME .. '/vim/init.vim'
source $MYVIMRC