I am using vim installed via homebrew:
> which vim
/opt/homebrew/bin/vim
> vim --version
VIM - Vi IMproved 9.1 (2024 Jan 02, compiled May 09 2024 07:15:02)
macOS version - arm64
Included patches: 1-400
Compiled by Homebrew
...
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
3rd user vimrc file: "~/.config/vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/opt/homebrew/share/vim"
...
I recently updated iTerm2 and MacOS:
I am now using iTerm2 build 3.5.0
I am now on MacOS Sonoma 14.5
All of a sudden my ~/.vimrc
doesn't seem to be sourcing properly. Notably, when I start vim, my cursorline
is underlined. When I execute :source ~/.vimrc
, the underline disappears, as expected. Relevant settings in my .vimrc
are:
set notermguicolors
set t_Co=16
set cursorlineopt=both
set cursorline
set background=dark
colorscheme default
syntax on
highlight clear CursorLine
highlight clear Todo
highlight signcolumn ctermbg=8
highlight statuslinenc ctermbg=3 ctermfg=8
highlight matchparen ctermbg=1 ctermfg=7
highlight diffchange ctermbg=0
highlight difftext ctermfg=8
Also worth noting that most of my settings seem to load just fine. There are just some minor syntax highlighting changes that happen when I manually source ~/.vimrc
(e.g. brackets and parens change color)
Other noteworthy things: these env vars don't seem to be set?
> echo $VIM
> echo $VIMRUNTIME
>
Prior to updating, my .vimrc
sourced just fine at start up.
Inspecting output from vim -V
has me thinking it's to do with who is setting highlights most recently. But still not sure why it's behaving differently than it used to.
Any suggestions on how to debug this? Thanks!
XDG_CONFIG_HOME
environment variable defined (In iTerm what is the result ofecho $XDG_CONFIG_HOME
)$HOME
environment variable?$VIM
and$VIMRUNTIME
are only set in Vim. Do:echo $VIM
and:echo $VIMRUNTIME
in Vim and add their output to your question, as well as the output of:echo $HOME
and:echo $MYVIMRC
.:syntax
or:colorscheme
command.cursorline
options and one without. Can you edit to make them one example?