Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.vim

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.

New machine

git clone --recurse-submodules https://github.com/theptrk/.vim.git ~/.vim
brew install fzf ripgrep

Open a Python file and install Pyright once:

:LspInstallServer pyright-langserver

Run 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.bak

Keys

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

Plugins

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"

Details

  • 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); termguicolors is on so the hex values take effect.
  • after/ftplugin/beancount.vim sets 2-space indentation for *.beancount files.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages