Skip to content

Repository files navigation

Installing

# HTTPS needs no SSH key - use it on a fresh or contract machine.
git clone https://github.com/dudarev/dotvim.git ~/.vim
# or, once keys are set up: git clone git@github.com:dudarev/dotvim.git ~/.vim
cd ~/.vim

# This repository is public. Before committing, configure a repository-local
# public or GitHub noreply email so a work identity never enters its history.
# For example: git config --local user.email YOUR_PUBLIC_OR_NOREPLY_EMAIL

Neovim (active)

mkdir -p ~/.config/nvim
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.

Local machine settings

Personal paths and machine-specific settings belong in ~/.vim/local.vim. That file is loaded automatically by both configurations and ignored by Git. For example, keep Python provider paths there rather than editing the tracked nvim_init.vim:

if has('nvim')
  let g:python_host_prog = '/full/path/to/neovim/bin/python'
  let g:python3_host_prog = '/full/path/to/neovim/bin/python'
endif

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

IdeaVim (optional)

ln -s ~/.vim/ideavimrc ~/.ideavimrc

Plain Vim / MacVim (legacy)

This lineage uses pathogen and the bundle/ submodules. It is intentionally inactive in the normal Neovim setup; initialize it only when explicitly using plain Vim or MacVim.

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

ln -s ~/.vim/vimrc ~/.vimrc
ln -s ~/.vim/mvimrc ~/.mvimrc
git submodule update --init --recursive

Appearance: following the macOS light/dark setting

On macOS, Neovim follows the host's system appearance without depending on a terminal profile's light/dark colours. This works in terminals such as iTerm2 and Ghostty. When Neovim runs on a non-macOS host, including Linux over SSH, mac_appearance.vim is skipped; it cannot inherit the client Mac's appearance.

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 match Neovim's defaults - block in normal and terminal modes, thin bar in insert mode - but 'guicursor' also names the Cursor highlight group in every entry:

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

Neovim's default normal/insert entries name no highlight group, while its stock terminal-mode entry uses TermCursor. Assigning 'guicursor' replaces that whole default, so this configuration explicitly assigns Cursor to every mode; otherwise the omitted modes fall back to the terminal profile's cursor colour.

In the TUI, naming a highlight group lets Neovim request the cursor colour from compatible terminals. 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.

No custom terminal colour is required. If iTerm2's Context-aware cursor color is already enabled and overrides the requested box cursor, disable that setting in the active profile.

Legacy submodule maintenance

These commands apply only to the inactive plain-Vim/pathogen lineage.

When a new submodule is installed remotely

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."

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