Vim configuration with plugins vendored as git submodules. Cloning this repo
to ~/.vim is the whole install — vim reads ~/.vim/vimrc natively, so there
is no ~/.vimrc and nothing to symlink.
git clone --recurse-submodules https://github.com/theptrk/.vim.git ~/.vim
brew install fzf ripgrepOpen a Python file and install Pyright once:
:LspInstallServer pyright-langserverRun that command while editing a Python file, then restart Vim. Language
servers are installed under
~/.local/share/vim-lsp-settings/servers/, not committed to this repository.
fzf is loaded from /opt/homebrew/opt/fzf by the vimrc; ripgrep backs the
:RG live grep.
A ~/.vimrc file, if one exists, shadows this repo's vimrc. Move it out of
the way:
[ -f ~/.vimrc ] && mv ~/.vimrc ~/.vimrc.bakLeader is space. Press space and wait 1500ms for a which-key popup listing these mappings:
| Keys | Action |
|---|---|
space n |
toggle the NERDTree file tree |
space f |
reveal the current file in the tree |
space p |
fuzzy-find files by name (:Files) |
space r |
recent files (:History) |
space g |
live-grep file contents with ripgrep (:RG) |
space b |
switch between open buffers |
fd in insert mode |
escape |
When a language server is active:
| Keys | Action |
|---|---|
gd |
go to definition |
gr |
find references |
K |
show hover/type information |
[g / ]g |
previous/next diagnostic |
j/k move by display lines on wrapped text; with a count (5j) they move
by logical lines, so relative line numbers still work.
Native vim 8 packages under pack/plugins/start/ — no plugin manager. Each
plugin is a git submodule pinned to a commit.
- fzf.vim — file/buffer/grep pickers (the base fzf plugin it needs comes from Homebrew, not this repo)
- nerdtree — file tree
- vim-which-key — leader-key popup menu
- vim-lsp — Language Server Protocol client and semantic navigation
- vim-lsp-settings — installs and configures language servers such as Pyright
The Gruvbox Material colorscheme is tracked separately under
pack/colors/start/, also as a Git submodule.
Add a plugin:
git submodule add https://github.com/user/plugin.git pack/plugins/start/plugin
git commit -m "Add plugin"Update all plugins to their latest commits:
git submodule update --remote --merge
git commit -am "Update plugins"Remove a plugin:
git submodule deinit -f pack/plugins/start/plugin
git rm -f pack/plugins/start/plugin
git commit -m "Remove plugin"- Swap files go to
~/.vim/swap/, which ships with the repo but its contents are git-ignored. - The which-key popup is repainted to GitHub Dark High Contrast colors in the
vimrc (vim's default Pmenu colors make it unreadable);
termguicolorsis on so the hex values take effect. after/ftplugin/beancount.vimsets 2-space indentation for*.beancountfiles.