Introduction
Neovim is one of those apps I actively add new features to then strugle to remember them due to my lack of muscle memory for it. But when I do want to use them I forget what the keymap is. I'd then have to go through my config files to find out the shortcut, which is inconvenient.
Here I am going to document everything I should be needing here so that I can read them when I get the intuition that I forgot something useful.
General
vUuppercase selection.vllowercase selection..redo last action.glandghto go to start and end of the line.]<space>and]<space>to add empty line in the next or previous line.vuwandvuWto select current word.vupto select current paragraph.vu[some symbol like "]to select content within those symbols under context of the cursor.NandEto scroll down and up.:newto open a file in another window.<space>+[hnei]to move cursor to another window.<space>+[HNEI]to move the current window.<space>fopen file switcher.<C-x>to open the file as a split.<C-v>to open the file as a vertical split.<C-t>to open the file in a new tab.<space>Fopen buffer switcher.<space>ddiagnostics.kgo to the next match (from using/).C-ogo to previous match (from using/).;shide search highlights.;qtoggle undo branch tree.;pfind text in the source tree.;rLSP identifier rename (hover over the variable with the cursor then use it).;wLSP definitions.;utoggle LSP diagnostics.ZZquit the editor.Zzto force quit the editor.
Spell Checking
;dto toggle spell checking.]sand[sto go to next or previous spelling error.z=to find suggestions for the current error under cursor.
Macros
qto record macros, e.g.,qqwill record it inqregistry.@to trigger a macro, e.g.,@qwill trigger theqregistry.
Deleting Stuff
- Visual mode
xto delete without copy.dto delete with copy.- Normal mode
xto delete without copy.ddto delete current line without copy.
Substitution
This editor's text replacement feature is accessed via :substitute or :s
- Selecting lines then doing
:will insert something into the command line. Those characters help the command understand that you want to execute it in only the selected area. - They use regular expressions to match stuff.
:%s/hello/hwellothis will replace first "hello" in every line of the file.%selects the entire file.:%s/hello/hwello/gthis will replace all "hello" of the file.%selects the entire file./gwill apply it to every match rather the first one in a line.:%s/^/somethingthis will add "something" to the start of every line.:%s/$/somethingthis will add "something" to the end of every line.
Plugins
Tab Line
Filename: tab-line.lua
This is different from the status line, that is one at the bottom and this one is at the top.
<space>thmove to the previous tab<space>timove to the next tabAlt + <0-9>move to a specific tab.<space>tcclose the tab.<space>t<space>select a tab.
Surrounder
Filename: surrounder.lua
This plugin helps surround/strip a character from visual selection.
<space>kkthen a symbol. To append.<space>krthen a symbol. To replace.<space>kdto delete.
Bufferized File Explorer
Filename: bufferized-file-explorer.lua
<space>trto trigger.g.to toggle hidden files.
Markdown Previews
Filename: markdown-previews.md
View markdown files in a web browser as rendered.
:MaTis an alias to toggle the renderer.
To Title
Filename: text-enhancers.md
Convert to title-case.
gtto convert visual selection.gttto convert the whole line.gt2wto convert the next two words.