miv

September 10, 2026 · View on GitHub

Personal Vim / NeoVim configuration (my vim). A single configuration serves both Vim and NeoVim, with plugins managed by vim-plug.

Features

  • One config, two editors — Vim reads .vimrc; NeoVim goes through init.lualegacy.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.

Requirements

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

Installation

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

Layout

PathDescription
.vimrcMain config: plugin list, key maps, general and filetype settings
.vim/UltiSnips snippets, autoload, ftplugin, syntax, etc.
.config/nvim/init.luaNeoVim entry point; loads legacy config, then Lua plugins and keymaps
.config/nvim/legacy.vimSets runtimepath and sources ~/.vimrc
.config/nvim/lua/config/neo_tree.luaFile explorer (F1), with O / gO to hand an entry to the system opener
.config/nvim/lua/config/fzf.luaFuzzy finder (Ctrl+P) and Git file pickers (<leader>gc / <leader>gs)
.config/nvim/lua/config/git_worktree.luaWorktree switching/creation, statusline branch indicator
.config/nvim/lua/config/diffview.luaGit diff and file-history keymaps
.config/nvim/lua/config/live_preview.luaMarkdown live preview with PlantUML/D2 rendering

Key Bindings

<leader> is the default \.

Interface & Navigation

KeyAction
F1 / <leader>fToggle 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)
F2Toggle symbol outline — aerial.nvim in NeoVim, Tagbar in Vim
F3 / F4Open all folds zR / close all folds zM
SpaceToggle fold on the current line
Ctrl+J/KMove to window below / above
F7 / Ctrl+HPrevious tab
F8 / Ctrl+LNext tab
Ctrl+Tab / Ctrl+Shift+TabNext / previous tab
/ Previous / next buffer
Ctrl+PFuzzy find files/buffers/MRU — fzf-lua in NeoVim, CtrlP in Vim (Git repositories only; searches from the repository root)
<leader>bCtrlP most-recently-used files (Vim)
<leader>tOpen current file in a new tab
<leader>ctToggle jb.nvim dark/light theme (NeoVim; Vim keeps desert)
<leader>w / <leader>qSave / quit
QQuit
gxOpen 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).

KeyAction
<leader>mHighlight the word under the cursor (toggle off if already marked)
{Visual}<leader>mHighlight the visual selection
{N}<leader>mHighlight with color group {N} — group terms by color (6 groups by default)
<leader>nClear the mark under the cursor; elsewhere, disable all marks (like :nohlsearch)
<leader>rHighlight 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
:MarksList all mark groups and their patterns
:Mark / :MarkClearDisable all marks / clear all marks (irreversible)
<leader>dJump to diff separator line
Visual * / #Search forward / backward for the selection

Editing & Alignment

KeyAction
<leader>tmTable Mode
<leader>nr / :NR / :NRV / :NWNrrwRgn narrowed-region editing
gaip= / vipga=EasyAlign on =
\sfFilePathConvert path-format conversion
TabExpand UltiSnips snippet
Ctrl+A/E/B/F, etc.Emacs-style motion / deletion in insert & command mode

Git (NeoVim)

KeyAction
<leader>gwSwitch Git worktree
<leader>tcCreate Git worktree
<leader>gcFuzzy 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>gsFuzzy find uncommitted Git changes (git status, staged and untracked included)
<leader>ddOpen Git diff
<leader>duCompare with origin/main or origin/master
<leader>dqClose Git diff
<leader>dh / <leader>dHCurrent file / repository Git history

Git (Vim)

KeyAction
<leader>gw / :GitWorktreePick and switch to a linked Git worktree in the current tab

<leader>tw remains available as a legacy alias for switching worktrees.

Formatting (NeoVim)

KeyAction
<leader>FFormat buffer (conform.nvim)

Markdown / PlantUML (macOS)

KeyAction
<leader>NOpen preview in MacDown
<leader>MRender HTML via pandoc and open
<leader>u / <leader>URender PlantUML to PNG / SVG and open
<leader>pIn 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>PSave a clipboard path image into assets with the legacy helper
<leader>mvToggle in-buffer Markdown rendering (markview.nvim, Obsidian-like block-level view) — NeoVim
<leader>mpLive-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.

Custom Commands

CommandAction
:TrimRStrip trailing whitespace
:RemoveBlankLinesCollapse extra blank lines
:DiffOrigDiff against the file on disk
:DrawItEnter ASCII drawing mode
:PasteImagePaste a system clipboard image using img-clip.nvim (NeoVim)

ctags

# Generate tags, skipping Python imports
ctags -R --python-kinds=-i

Migrating from Vim to NeoVim

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.