|
1 | | -## Vim Key Mappings |
2 | | - |
3 | | -- Rspec + Tmux + Rubocop |
4 | | - - \<space\>rs - Run rspec <file> |
5 | | - - \<space\>ra - Run rspec spec (all files) |
6 | | - - \<space\>rn - Run rspec spec (nearest spec) |
7 | | - - \<space\>rl - Run last spec |
8 | | - - \<space\>ru - Run full rubocop |
9 | | - |
10 | | -- Ctrl-P Fuzzy Finder |
11 | | - - \<space\>t or \<space\>p |
12 | | - - \<space\>b search only on buffer |
13 | | - |
14 | | -- NERDTree |
15 | | - - Ctrl+\\ open and close NERDTree |
16 | | - |
17 | | -- Vim-tmux-runner |
18 | | - - When open vim, it asks you which pane to attach |
19 | | - |
20 | | -- Ag |
21 | | - - K - search current word |
22 | | - |
23 | | -- Global |
24 | | - - vv - opens vertical split |
25 | | - - ss - opens horizontal split |
26 | | - - // - clear current search highlight |
27 | | - - Shift-t - Opens a new tab |
28 | | - - gt - Go to next tab |
29 | | - - Tab - In insert mode, start completion |
30 | | - - \<space\>vr - reload vim configuration |
31 | | - - \<space\>hl - toggle search highlighting on/off |
| 1 | +# Vim Key Mappings |
| 2 | + |
| 3 | +Leader key is `<Space>`. |
| 4 | + |
| 5 | +## Navigation |
| 6 | + |
| 7 | +| Key | Action | |
| 8 | +|---|---| |
| 9 | +| `<Space><Space>` | Switch between the last two files | |
| 10 | +| `C-h` `C-j` `C-k` `C-l` | Navigate between vim/tmux panes seamlessly | |
| 11 | +| `vv` | Open vertical split | |
| 12 | +| `ss` | Open horizontal split | |
| 13 | +| `<Space>-` | Zoom current pane (maximize) | |
| 14 | +| `<Space>=` | Re-balance all panes | |
| 15 | + |
| 16 | +## File Explorer (NERDTree) |
| 17 | + |
| 18 | +| Key | Action | |
| 19 | +|---|---| |
| 20 | +| `C-\` | Toggle NERDTree / reveal current file | |
| 21 | + |
| 22 | +## Fuzzy Finder (CtrlP) |
| 23 | + |
| 24 | +| Key | Action | |
| 25 | +|---|---| |
| 26 | +| `<Space>t` | Open CtrlP file finder | |
| 27 | +| `<Space>b` | Search open buffers | |
| 28 | +| `<Space>m` | Search most recently used files | |
| 29 | + |
| 30 | +## Search |
| 31 | + |
| 32 | +| Key | Action | |
| 33 | +|---|---| |
| 34 | +| `K` | Search current word with Ag (Silver Searcher) | |
| 35 | +| `//` | Clear current search highlight | |
| 36 | +| `<Space>hl` | Toggle search highlighting on/off | |
| 37 | + |
| 38 | +## RSpec (via tmux runner) |
| 39 | + |
| 40 | +| Key | Action | |
| 41 | +|---|---| |
| 42 | +| `<Space>rs` | Run current spec file | |
| 43 | +| `<Space>rn` | Run nearest spec | |
| 44 | +| `<Space>rl` | Run last spec | |
| 45 | +| `<Space>ra` | Run all specs | |
| 46 | + |
| 47 | +## Code Quality (via tmux runner) |
| 48 | + |
| 49 | +| Key | Action | |
| 50 | +|---|---| |
| 51 | +| `<Space>ru` | Run Rubocop on project | |
| 52 | +| `<Space>rfu` | Run Rubocop on current file | |
| 53 | +| `<Space>fl` | Run Flog on current file | |
| 54 | + |
| 55 | +## ERB Templates |
| 56 | + |
| 57 | +| Key | Mode | Action | |
| 58 | +|---|---|---| |
| 59 | +| `C-k` | Insert | Insert `<%= %>` tag | |
| 60 | +| `C-j` | Insert | Insert `<% %>` tag | |
| 61 | + |
| 62 | +## Clipboard |
| 63 | + |
| 64 | +| Key | Action | |
| 65 | +|---|---| |
| 66 | +| `<Space>y` + motion | Copy to system clipboard (e.g., `<Space>yw` copies a word) | |
| 67 | +| `<Space>p` | Paste from system clipboard | |
| 68 | + |
| 69 | +## Tabs |
| 70 | + |
| 71 | +| Key | Action | |
| 72 | +|---|---| |
| 73 | +| `Shift-t` | Open new tab | |
| 74 | +| `Shift-Tab` | Go to next tab | |
| 75 | + |
| 76 | +## Completion |
| 77 | + |
| 78 | +| Key | Mode | Action | |
| 79 | +|---|---|---| |
| 80 | +| `Tab` | Insert | Autocomplete (or insert tab at beginning of line) | |
| 81 | +| `Shift-Tab` | Insert | Next completion | |
| 82 | + |
| 83 | +## Other |
| 84 | + |
| 85 | +| Key | Action | |
| 86 | +|---|---| |
| 87 | +| `<Space>vr` | Reload vim configuration | |
| 88 | +| `<Space>ct` | Generate ctags for the project | |
| 89 | +| `<Space>gs` | Open Git status (fugitive) | |
0 commit comments