Skip to main content

Neovim

My blazingly fast Neovim configuration. See the config here.

What's included

  • LazyVim to load plugins on demand. Produces a startup time of ~70ms in my case.

  • LSP managed via Mason (Node, Go, Python, Rust, and the usual).

  • null-ls for LSP integrations like linting, code formatting.

  • Treesitter for syntax highlighting.

  • Telescope for fuzzy finding.

  • LazyGit for git integration.

  • WhichKey for keybindings.

  • And more...

Keybindings

All keyboard shortcuts so far.

, is Leader.

Basics

  • : ! To execute external commands.
  • x In _Normal_ or _Visual_ Mode - Delete Character under cursor.
  • d w To delete word under cursor.
  • d $ Delete from current position to end of line.
  • 'n' d d Delete next 'n' lines.
  • r followed by any character will replace the character under cursor.
  • R Multiple Replace.
  • c w Delete rest of the word and enter _Insert_ mode. It accepts `$` just like delete.
  • < Unindent line.
  • > Indent line.
  • % Goto matching `()[]`.
  • g g First line of file.
  • G Last line of file.

Undo/Redo

Use :u and :r respectively. Or use u and r from command mode.

Use U to undo all changes in line.

Undo Tree

, z Toggle Undo Tree.

Search and Highlight

In command mode. Press / to enter search. Now type a regex pattern you would like to search. Use ? for reverse direction search.

Navigate results with n and N

Clear the selections by using :noh.

Copy/Paste/Select

To select any text, you must enter visual mode. Press v in normal mode for this.

  • Use arrow keys to expand the selection.

  • d Deletes the selection.
  • y "yank"/copy the selection.
  • p Paste the selection. p will _put_ any recently deleted line with dd if it was deleted after a _yank_. Handy Cut/Paste.
  • Search by using these 4 in conjuntion on the selected text: y q / p

  • r Replace selection with text you will now type.

Copy/Paste Across Terminals

Use: " + y and " + p from visual mode.

For Tiling

  • Ctrl W S (upper case) for horizontal splitting
  • Ctrl W v (lower case) for vertical splitting
  • Ctrl W Q to close one
  • Ctrl W Ctrl W to switch between windows
  • Ctrl W J (x or K, H, L) to switch to adjacent window (intuitively up, down, left, right)

Shift Lines/Blocks

  • Shift k to shift line up.
  • Shift j to shift line down.

Telescope

  • , f f Telescope find_files
  • , f g Telescope live_grep
  • , f b Telescope buffers
  • , f h Telescope help/tags
  • , f u Telescope URLViewer

LSP

  • , r n Renane w/ GUI.
  • , c a Code Action w/ GUI.
  • , k Hover Docs.
  • g s Signature.
  • g h LSP Finder.
  • [ e Previous Diagnostics
  • ] e Next Diagnostics

Diagnostics

  • space e Open Diagnostics.

Misc

  • , p Activate Glow (Markdown Previewer)
  • space z Zen Mode Toggle.

Multiple Cursors

  • Ctrl n Select Word under cursor.
  • Ctrl Up/Down Vertically create cursors.
  • n / N Goto Next/Previous occurence.
  • [ ] Select Next/Previous cursor.
  • q Skip current and get next occurence.
  • Q Remove current cursor.
  • a / i Insert mode.

Find and Replace

Uses Spectre

  • , S Toggles Spectre (No context).
  • , s w Toggles Spectre with word under cursor as context.

Once you've made entries, navigate to the line and use:

  • , r c Replace in current line.
  • , R Replace all.
  • , Enter Go to File.
  • , o Show options.

Tools

  • , g g Toggle Lazygit
  • , g z Toggle czg
  • , e Emoji Picker 🚀