I just finished setting vim to use XDG variables (mostly taken from here), where:
XDG_CONFIG_HOME
: ~/.config
XDG_CACHE_HOME
: ~/.cache
When I launch MacVim from the terminal using mvim
, everything specified in my vimrc
is read.
However, when I open a file from the file manager (GUI), the vimrc
is not read.
How do I ensure that GUI MacVim behaves like mvim
?
Below in the Vim configuration in my .zshrc
:
# Vim
export VIMINIT='source $MYVIMRC'
export MYVIMRC=$XDG_CONFIG_HOME/vim/vimrc
export VIMDOTDIR=$XDG_CONFIG_HOME/vim
More info:- ZSH is the default shell
There is a .zshenv
file in $HOME
with:
# ZSH
export ZDOTDIR="${ZDOTDIR:-$HOME/.config/zsh}"
# XDG compliant home directory
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
The .zshrc
is located in $HOME/.config/zsh