Personal Vim / NeoVim configuration (my vim). A single configuration
serves both Vim and NeoVim, with plugins managed by
vim-plug.
- One config, two editors — Vim reads
.vimrc; NeoVim goes through
init.lua → legacy.vim → .vimrc to reuse the same setup, then layers
Lua plugins on top (NeoVim-only keymaps override the Vim defaults below).
- Syntax highlighting, indentation, and folding for many languages.
- Markdown / PlantUML authoring, table alignment, multiple cursors, and
Emacs-style insert-mode keys.
- NeoVim additionally enables:
- markview.nvim and the
prose-oriented Everforest theme
for in-buffer Markdown authoring and reading.
- jb.nvim as the default
JetBrains-style theme, with dark/light variants toggled by
ToggleTheme.
Everforest (light) and Nordfox (dark) stay installed as alternates.
- neo-tree.nvim as the file explorer
(replaces NERDTree) and aerial.nvim
as the symbol outline (replaces Tagbar).
- fzf-lua as the fuzzy finder
(replaces CtrlP).
- git-worktree.nvim +
telescope.nvim for
switching/creating worktrees, plus vim-fugitive
and a branch/worktree indicator in the statusline.
- diffview.nvim for Git diffs
and file history.
- conform.nvim for
format-on-demand across common languages.
- live-preview.nvim for
live Markdown preview in the browser, with local PlantUML and D2 diagram
rendering.
- Vim or NeoVim
- Git
- For NeoVim clipboard-image pasting on macOS:
pngpaste (brew install pngpaste)
vim-plug is vendored in
.vim/autoload/plug.vim, so there is nothing extra to install.
git clone https://github.com/alswl/miv.git
cd miv
# Create symlinks (-n replaces existing dir links instead of nesting into them)
ln -sfn "$(pwd)/.vim" "$HOME/.vim"
ln -sf "$(pwd)/.vimrc" "$HOME/.vimrc"
mkdir -p "$HOME/.config"
ln -sfn "$(pwd)/.config/nvim" "$HOME/.config/nvim"
# Install plugins (run either one; plug.vim is already bundled)
vim +PlugInstall +qa
nvim +PlugInstall +qa
| Path | Description |
|---|
.vimrc | Main config: plugin list, key maps, general and filetype settings |
.vim/ | UltiSnips snippets, autoload, ftplugin, syntax, etc. |
.config/nvim/init.lua | NeoVim entry point; loads legacy config, then Lua plugins and keymaps |
.config/nvim/legacy.vim | Sets runtimepath and sources ~/.vimrc |
.config/nvim/lua/config/neo_tree.lua | File explorer (F1), with O / gO to hand an entry to the system opener |
.config/nvim/lua/config/fzf.lua | Fuzzy finder (Ctrl+P) and Git file pickers (<leader>gc / <leader>gs) |
.config/nvim/lua/config/git_worktree.lua | Worktree switching/creation, statusline branch indicator |
.config/nvim/lua/config/diffview.lua | Git diff and file-history keymaps |
.config/nvim/lua/config/live_preview.lua | Markdown live preview with PlantUML/D2 rendering |
<leader> is the default \.
| Key | Action |
|---|
F1 / <leader>f | Toggle file explorer — neo-tree.nvim in NeoVim, NERDTree in Vim |
O / gO (in the file explorer) | Open the entry with the system default application / reveal it in the system file manager — Finder on macOS (neo-tree.nvim) |
F2 | Toggle symbol outline — aerial.nvim in NeoVim, Tagbar in Vim |
F3 / F4 | Open all folds zR / close all folds zM |
Space | Toggle fold on the current line |
Ctrl+J/K | Move to window below / above |
F7 / Ctrl+H | Previous tab |
F8 / Ctrl+L | Next tab |
Ctrl+Tab / Ctrl+Shift+Tab | Next / previous tab |
← / → | Previous / next buffer |
Ctrl+P | Fuzzy find files/buffers/MRU — fzf-lua in NeoVim, CtrlP in Vim (Git repositories only; searches from the repository root) |
<leader>b | CtrlP most-recently-used files (Vim) |
<leader>t | Open current file in a new tab |
<leader>ct | Toggle jb.nvim dark/light theme (NeoVim; Vim keeps desert) |
<leader>w / <leader>q | Save / quit |
Q | Quit |
gx | Open URL under cursor (macOS) |
vim-mark highlights several words in
different colors simultaneously, like a multi-term *. Marks are persisted and
restored across sessions (g:mwAutoLoadMarks).
| Key | Action |
|---|
<leader>m | Highlight the word under the cursor (toggle off if already marked) |
{Visual}<leader>m | Highlight the visual selection |
{N}<leader>m | Highlight with color group {N} — group terms by color (6 groups by default) |
<leader>n | Clear the mark under the cursor; elsewhere, disable all marks (like :nohlsearch) |
<leader>r | Highlight a manually entered regular expression |
<leader>* / <leader># | Jump to the next / previous occurrence of the current mark |
<leader>/ / <leader>? | Jump to the next / previous occurrence of any mark |
:Marks | List all mark groups and their patterns |
:Mark / :MarkClear | Disable all marks / clear all marks (irreversible) |
<leader>d | Jump to diff separator line |
Visual * / # | Search forward / backward for the selection |
| Key | Action |
|---|
<leader>tm | Table Mode |
<leader>nr / :NR / :NRV / :NW | NrrwRgn narrowed-region editing |
gaip= / vipga= | EasyAlign on = |
\sf | FilePathConvert path-format conversion |
Tab | Expand UltiSnips snippet |
Ctrl+A/E/B/F, etc. | Emacs-style motion / deletion in insert & command mode |
| Key | Action |
|---|
<leader>gw | Switch Git worktree |
<leader>tc | Create Git worktree |
<leader>gc | Fuzzy find files changed on this branch — working tree against the merge base with the default branch (origin/HEAD, falling back to origin/master, origin/main, master, main) |
<leader>gs | Fuzzy find uncommitted Git changes (git status, staged and untracked included) |
<leader>dd | Open Git diff |
<leader>du | Compare with origin/main or origin/master |
<leader>dq | Close Git diff |
<leader>dh / <leader>dH | Current file / repository Git history |
| Key | Action |
|---|
<leader>gw / :GitWorktree | Pick and switch to a linked Git worktree in the current tab |
<leader>tw remains available as a legacy alias for switching worktrees.
| Key | Action |
|---|
<leader>F | Format buffer (conform.nvim) |
| Key | Action |
|---|
<leader>N | Open preview in MacDown |
<leader>M | Render HTML via pandoc and open |
<leader>u / <leader>U | Render PlantUML to PNG / SVG and open |
<leader>p | In a NeoVim Markdown buffer, paste an image with img-clip.nvim: it is saved to the relative path in front matter's typora-copy-images-to, or to document.assets/ when unset, then linked at the cursor. Vim retains its legacy clipboard helper. |
<leader>P | Save a clipboard path image into assets with the legacy helper |
<leader>mv | Toggle in-buffer Markdown rendering (markview.nvim, Obsidian-like block-level view) — NeoVim |
<leader>mp | Live-preview Markdown in the browser, with local PlantUML/D2 rendering (NeoVim) |
In NeoVim, <CR> auto-continues Markdown lists and > blockquotes
(markdown-plus.nvim + formatoptions+=ro), and the current line's list
item / quote / heading / table stays rendered in insert mode.
| Command | Action |
|---|
:TrimR | Strip trailing whitespace |
:RemoveBlankLines | Collapse extra blank lines |
:DiffOrig | Diff against the file on disk |
:DrawIt | Enter ASCII drawing mode |
:PasteImage | Paste a system clipboard image using img-clip.nvim (NeoVim) |
# Generate tags, skipping Python imports
ctags -R --python-kinds=-i
This repo ships NeoVim config (init.lua + legacy.vim). Symlink
~/.config/nvim as shown in Installation — no need to write
init.vim by hand. See :help nvim-from-vim.