nvim/vim links cheatsheet and notes

I really enjoy the vim-style editor experiance. vi/vim/nvim/neovim nuggets, mappings, scripts, plugins that I find useful and use on a day-2-day basis. 80% neovim, 10% ideavim, 5% vsvim...

Resources

Questions

  • Q: How to toggle a setting?
    A: set invspell -> +inv{setting}:w or set spell! (NOTE: ! suffix, prefix means something else). True -> False -> True. Use set spell? to read the value.
  • Q: Close all buffers except current
    A: stack-overflow
  • Q: Explore files current dir?
    A: stack-overflow
  • Q: How to exclude node_modules, dotnet packages from vimrep
    A: set wildignore+=node_modules/**,packages/** stack-overflow

Hint & mappings

  • [<space> add blank line before, ]<space> add blank line after -- stays in NORMAL mode. @tpope/vim-unimpaired
  • Get special chars :digraph - <C+k> + xx
  • In VISUAL mode press o to toggle between start/end of selection.
  • Toggle search hilighting :set hlsearch!, show current :set hlsearch?

Lua / Scripting

  • lua: detect os vim.loop.os_uname().sysname

The extended VIM universe

Git / Fugative

:help Git

compare to master

Gvdiffsplit master
zR - remove all folding
[]c - prev/next change/git hunk