Skip to content
bencaoPublic

About

reusable personalized vim configuration

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

VIMO

Personalized VIM/NeoVim configurations

The same vimrc drives both editors; it branches on has('nvim') only where the two genuinely differ (clipboard register, undo directory, truecolor termcap). Tested on NeoVim 0.12 and Vim 9.1.

Installation

Install NeoVim or Vim first if you haven't done so.

NeoVim

git clone https://github.com/bencao/vimo.git ~/.vimo

~/.vimo/install_neovim.sh

VIM

git clone https://github.com/bencao/vimo.git ~/.vimo

~/.vimo/install_vim.sh

For system-clipboard integration your Vim needs to be built with +clipboard (check with vim --version | grep clipboard). The macOS system Vim qualifies; brew install vim also works.

External tools the plugins use:

brew install ripgrep universal-ctags fzf node

None are required to start vimo, and each install script ends by running check_prereqs.sh, which reports what is missing and which feature it costs you. Two notes: macOS ships a BSD ctags that rejects -R, so <leader>r and vim-gutentags both need Universal Ctags (gutentags stays disabled until it is installed), and ALE's Prettier fixer needs node.

Uninstallation

NeoVim

~/.vimo/uninstall_neovim.sh
rm -rf ~/.vimo

VIM

~/.vimo/uninstall_vim.sh
rm -rf ~/.vimo

Plugins Selection and Why

List of Plugins

Vim Frequently Used Key Bindings

Vimo Help

  • [normal mode] Space then h open vimo help in VIM

Movement Key Bindings

  • [normal mode] Space then f quick jump to any words in the screen Demo
  • [normal mode] Space then r rebuild ctags for current directory
  • [normal mode] Ctrl + ] jump to definition, need to rebuild ctags first
  • [normal mode] Ctrl + o jump back to last cursor position
  • [normal mode] Ctrl + i jump back to next cursor position
  • [normal mode] Space then Space jump to and jump back between the current editing file and the last edited file

Selection Key Bindings

  • [normal mode] Ctrl + n press multiple times to select multiple current word and edit all of them at the same time Demo

Comment Key Bindings

  • [visual mode] g then c toggle comment

Complete Key Bindings

  • [insert mode] Tab auto complete with next candidate
  • [insert mode] Shift + Tab auto complete with previous candidate

Format/Alignment Key Bindings

  • [normal/visual mode] Space then p format the file (ALE; uses Prettier for JS/TS/CSS/JSON/YAML/Markdown, gofmt for Go, rustfmt for Rust)
  • [visual mode] Enter then = align selected lines by =
  • [visual mode] Enter then : align selected lines by :

Search & Navigations Bindings

  • [normal mode] Space then b fuzzy-find files (fzf), use Ctrl + j/Ctrl + k to move between candidates Demo
  • [normal mode] Space then B fuzzy-find open buffers
  • [normal mode] Space then l fuzzy-find lines in the current buffer
  • [normal mode] Space then a search text patterns in directories using Rg (ripgrep), the result will be shown in a Quickfix window
  • [normal mode] Space then k search the word under the cursor (whole words only), same Quickfix window
  • [normal mode] </kbd> same as Space then a

Diagnostics and Code Intelligence Bindings

ALE provides these; each needs the relevant linter or language server on PATH.

  • [normal mode] Space then d show the full diagnostic under the cursor
  • [normal mode] Space then g go to the definition under the cursor
  • [normal mode] ] then w / [ then w next/previous diagnostic
  • [insert mode] Tab completes from the language server when one is running, otherwise from keywords in the buffer

Undo, Tests and Discoverability

  • [normal mode] Space then u toggle the undo history tree
  • [normal mode] Space then n run the test nearest the cursor
  • [normal mode] Space then N run every test in the file
  • [normal mode] Space then ? show the available leader bindings

Bracket Bindings

From vim-unimpaired, plus a few from other plugins:

  • [normal mode] ]/[ then q next/previous quickfix entry (pairs with Space then a)
  • [normal mode] ]/[ then b next/previous buffer
  • [normal mode] ]/[ then c next/previous git hunk (gitgutter)
  • [normal mode] y then o then an option letter toggles that option, e.g. yow for wrap

Windows Key Bindings

  • [normal mode] Space then t toggle directory tree, revealing the current file Demo
  • [normal mode] Space then T toggle directory tree
  • [normal mode] Space then s split a new vertical window to the right
  • [normal mode] Space then S split a new horizontal window below
  • [normal mode] Space then o toggle window/fullscreen
  • [normal mode] Space then w shortcut for :w
  • [normal mode] Space then W shortcut for :w!
  • [normal mode] Space then q shortcut for :q
  • [normal mode] Space then Q shortcut for :q!
  • [normal mode] Ctrl + h/Ctrl + j/Ctrl + k/Ctrl + l move left/up/down/right among windows Demo

List Available Key Bindings

  • :map all mode key mappings
  • :nmap normal mode key mappings
  • :vmap visual mode key mappings
  • :imap insert mode key mappings

About

reusable personalized vim configuration

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages