Skip to content

Latest commit

 

History

History
236 lines (188 loc) · 5.32 KB

File metadata and controls

236 lines (188 loc) · 5.32 KB

Keybindings Quick Reference

Leader key: ,

File Navigation & Search

Key Action
<Leader>. Fuzzy find files (fzf)
<C-p> Fuzzy find files (alternative)
<Leader>, Browse buffers
<Leader>a Search in files (ripgrep)
<C-g> Toggle NERDTree

Git Operations

Key Action
<Leader>gd Git diff
<Leader>gb Git blame
[h Previous git hunk
]h Next git hunk

Code Navigation (LSP)

Key Action
gd Go to definition
gy Go to type definition
gi Go to implementation
gr Find references
K Show documentation
<Leader>rn Rename symbol

Diagnostics & Errors

Key Action
[g Previous LSP diagnostic
]g Next LSP diagnostic
[e Previous ALE error
]e Next ALE error
<Leader>qf Quick fix current issue

Code Editing

Key Action
<Leader>F Format selected code
<Leader>s Substitute (abolish.vim)
gc Toggle comment (commentary)
Y Yank to end of line (like D, C)

Completion

Key Action
<Tab> Next completion / trigger
<S-Tab> Previous completion
<CR> Accept completion
<C-Space> Trigger completion
<C-@> Trigger completion (terminal)

Buffer Navigation

Key Action
<Leader>b Buffer surf back
<Leader>f Buffer surf forward

Undo History

Key Action
<S-u> Toggle undotree

Tags & Symbols

Key Action
<Leader>t Open tagbar
<Home> Previous tag
<End> Next tag

Location List Navigation

Key Action
<PageDown> Next location
<PageUp> Previous location

Tabular Alignment

Key Action
\= Align on =
\: Align on :
\> Align on =>
\, Align on ,
\{ Align on {
| Align on |
\& Align on & or \

Window Management

Key Action
_ Horizontal split
| Vertical split
<Up> Decrease height
<Down> Increase height
<Left> Decrease width
<Right> Increase width

Toggle Options

Key Action
<F1> Toggle paste mode
<F2> Toggle spell check
<F3> Toggle line wrap
<Leader>/ Clear search highlight

Visual Mode

Key Action
. Repeat last command
@ Execute macro
s Sort lines
u Sort unique

tmux/Screen Integration

Key Action
<C-\> Open vertical screen shell
<Leader>r Run rspec at cursor
<Leader>e Run cucumber at cursor
<Leader>w Set breakpoint
<Leader>m Repeat last command

Command Mode

Command Action
w!! Save with sudo

Custom Text Objects (from plugins)

Key Action
cs"' Change surrounding " to '
ds" Delete surrounding "
ysiw" Surround word with "
S" Surround selection with " (visual)

Navigation (Display Lines)

Key Action
j Move down (display line)
k Move up (display line)

Plugin Commands Reference

vim-plug

  • :PlugInstall - Install plugins
  • :PlugUpdate - Update plugins
  • :PlugClean - Remove unlisted plugins
  • :PlugUpgrade - Upgrade vim-plug itself
  • :PlugStatus - Check plugin status
  • :PlugDiff - Review changes from updates

coc.nvim

  • :CocInstall <name> - Install extension
  • :CocUninstall <name> - Uninstall extension
  • :CocUpdate - Update all extensions
  • :CocInfo - Show coc info
  • :CocConfig - Edit coc-settings.json
  • :CocList extensions - List extensions
  • :CocList diagnostics - Show diagnostics
  • :CocRestart - Restart coc services

ALE

  • :ALEFix - Fix issues in current buffer
  • :ALEInfo - Show ALE info
  • :ALEToggle - Toggle ALE
  • :ALELint - Lint current file

fzf

  • :Files - Find files
  • :Buffers - Browse buffers
  • :Rg - Ripgrep search
  • :Lines - Search lines in buffers
  • :BLines - Search lines in current buffer
  • :Tags - Browse tags
  • :Commits - Browse git commits
  • :Colors - Browse color schemes
  • :History - Browse command history

fugitive

  • :Git or :G - Git command
  • :Gstatus - Git status
  • :Gdiff - Git diff
  • :Gblame - Git blame
  • :Gcommit - Git commit
  • :Gpush - Git push
  • :Gpull - Git pull

NERDTree

  • :NERDTreeToggle - Toggle tree
  • :NERDTreeFind - Find current file
  • Inside NERDTree:
    • o - Open file/directory
    • i - Open in split
    • s - Open in vsplit
    • m - Menu (create, delete, move)
    • R - Refresh
    • ? - Help

undotree

  • :UndotreeToggle - Toggle undo tree
  • :UndotreeShow - Show undo tree
  • :UndotreeHide - Hide undo tree

Tips

  1. Completion: Start typing and use Tab to navigate suggestions
  2. Documentation: Hover over any symbol and press K
  3. Quick Fix: On an error, press <Leader>qf for auto-fix
  4. Refactoring: Use gr to find all references before renaming
  5. Search: Use <Leader>a instead of :grep for faster results
  6. Buffers: Use <Leader>, to quickly switch buffers
  7. Git Changes: Use [h and ]h to review changes before committing