Skip to content

Repository files navigation

Installing

Based on http://vimcasts.org/episodes/synchronizing-plugins-with-git-submodules-and-pathogen/

git clone git@github.com:dudarev/dotvim.git ~/.vim
ln -s ~/.vim/vimrc ~/.vimrc
ln -s ~/.vim/gvimrc ~/.gvimrc
ln -s ~/.vim/mvimrc ~/.mvimrc
ln -s ~/.vim/ideavimrc ~/.ideavimrc
cd .vim
git submodule init
git submodule update

Neovim

ln -s ~/.vim/nvim_init.vim ~/.config/nvim/init.vim
ln -s ~/.vim/keymap ~/.config/nvim/keymap
ln -s ~/.vim/mac_appearance.vim ~/.config/nvim/mac_appearance.vim

To install Plug:

curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

In nvim: :PlugInstall.

Based on https://github.com/zchee/deoplete-jedi/wiki/Setting-up-Python-for-Neovim

pyenv install 3.13.2  # or latest stable version

pyenv virtualenv 3.13.2 neovim

pyenv activate neovim
pip install neovim
pip install flake8
pip install jedi
pyenv which python  # Note the path

ln -s `pyenv which flake8` ~/bin/flake8  # Assumes that $HOME/bin is in $PATH

Make sure that the path is set correctly in ~/.config/nvim/init.vim

let g:python_host_prog = '/full/path/to/neovim/bin/python'
let g:python3_host_prog = '/full/path/to/neovim/bin/python'

Appearance: following the macOS light/dark setting

Neovim follows the system appearance on its own - no terminal configuration is needed, and it works the same in iTerm2, Ghostty and over ssh.

Two pieces, both at the end of nvim_init.vim (order matters):

  1. mac_appearance.vim sets 'background' from macOS. macOS only creates the AppleInterfaceStyle default in Dark Mode, so defaults read -g AppleInterfaceStyle succeeding means dark and failing means light. It also re-checks on FocusGained, which is how toggling the system theme with Neovim already open re-themes it on the next click into the window.
  2. colorscheme rose-pine is applied after that, so it picks the right variant on the first paint: dawn when light, main when dark.

Cursor

The cursor shapes are Neovim's defaults - block in normal mode, thin bar in insert mode - but 'guicursor' also names the Cursor highlight group:

set guicursor=n-v-c-sm:block-Cursor,i-ci-ve:ver25-Cursor,r-cr-o:hor20-Cursor

That last part matters. Neovim's stock 'guicursor' names no highlight group, so the cursor colour is left entirely to the terminal. On this machine that used to be handled by two iTerm2 settings (Profiles -> Colors):

  • Use separate colors for light and dark mode - separate cursor colours per appearance;
  • Context-aware cursor color (affects box cursor only) - iTerm2 inverting the box cursor against whatever is behind it. Note the parenthetical: the insert-mode bar cursor is excluded, so it fell through to the literal profile colour.

That works, but it lives in iTerm2's preferences rather than in this repo, it differs between the profiles here (Default, NeoVim, nvim, tasks do not agree), and it does not travel. Ghostty with no config gives an invisible cursor on the light background for exactly this reason.

Naming a highlight group makes Neovim emit OSC 12 and own the colour instead. CursorContrast() sets Cursor to Normal reversed - cursor background = text colour - so it contrasts in both variants, and the ColorScheme autocmd re-applies it whenever 'background' flips.

To let Neovim be authoritative in iTerm2 too, uncheck Context-aware cursor color in the profile in use (echo $ITERM_PROFILE to see which one that is).

When new submodule is installed in remote

git submodule update --init --recursive

Update all bundled modules

git submodule foreach git pull origin master

Install a new bundle

git submodule add http://github.com/tpope/vim-fugitive.git bundle/fugitive
git add .
git commit -m "Install Fugitive.vim bundle as a submodule."

To remove a submodule

  1. Delete the relevant section from the .gitmodules file.
  2. Delete the relevant section from .git/config.
  3. Run git rm --cached path_to_submodule (no trailing slash).
  4. Commit and delete the now untracked submodule files.

About

My vim settings and plugins

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages