Vim plugin keybindings
by:
2 minutes
415 Words
2017-11-25 19:00 -0500
I pick up all kinds of vim tricks and plugins but I can never remember all the shortcuts. I wrote up this quick reference to help myself memorize how to use these tools.
Caveat: some of these keybindings are unique to my .vimrc.
fzf
Fuzzy Finder| <leader>f | Find files with rg by filename |
|---|---|
| <leader>* | Search file contents with rg (alt-a to select all). Results go in a QuickFix window. |
| <leader>* -t perl | Same as above but only search perl files |
| <leader><tab> | Search all vim mappings |
| <c-x><c-f> | Complete file names |
| <c-x><c-l> | Complete line |
QuickFix keybindings: Search and replace across multiple files
| fn | next |
|---|---|
| fp | prev |
| :cdo <cmd> | For each entry run <cmd> |
| :cdo s/<c-r>"//c | Same as above but don't need to retype the search regexp that was used by fzf |
| :cfdo <cmd> | For each file run <cmd> |
Tagbar
Browse the tags (packages, labels, subroutines, etc) of the current file and get an overview of its structure.| <leader>m | Show tags |
|---|
Buffergator
List, navigate between, and select buffers to edit.| <leader>b | Open a window listing all buffers |
|---|
EasyAlign
Vertically align stuff| <leader>a | Align something |
|---|---|
| <leader>a<ctrl-p> | Align something in interactive mode |
| <leader>a= | Align around first occurance of = |
| <leader>a2= | Align around 2nd = |
| <leader>a*= | Align around all = |
| <leader>a-= | Align around last = |
| <leader>a<ctrl-x> | Align around a regular expression |
gurl
Provides links to the current line/selection on the github website so you easily talk about code with others.| <leader>t | Get a link to the current line/selection |
|---|
PerlHelp
Quick access to perldoc
| <leader>pd | perldoc on the package name under cursor |
|---|---|
| <leader>ph | perldoc on the package name under cursor |
| <leader>pf | perldoc on the function name under cursor |
| <leader>pv | perldoc on the special Perl variable under cursor |
perl-nextmethod
Jump to the next/prev Perl method| ]m | Jump to the next Perl subroutine start |
|---|---|
| ]M | Jump to the next Perl subroutine end |
| [m | Jump to the previous Perl subroutine start |
| [M | Jump to the previous Perl subroutine end |
Read other articles