diff --git a/vim.md b/vim.md index 5d8ae26a4..2aba5d876 100644 --- a/vim.md +++ b/vim.md @@ -33,14 +33,18 @@ Getting started ### Navigating -| `h` `j` `k` `l` | Arrow keys | -| `` _/_ `` | Page up/page down | +| Shortcut | Description | +| --- | --- | +| `h` `j` `k` `l` | Arrow keys | +| `` _/_ `` | Page up/page down | {: .-shortcuts} #### Words -| `b` _/_ `w` | Previous/next word | -| `e` _/_ `ge` | Previous/next end of word | +| Shortcut | Description | +| --- | --- | +| `b` _/_ `w` | Previous/next word | +| `e` _/_ `ge` | Previous/next end of word | {: .-shortcuts} #### Line @@ -78,6 +82,18 @@ Getting started | `L` | Move to bottom of screen | {: .-shortcuts} +#### Tab pages + +| Shortcut | Description | +| --- | --- | +| `:tabedit [file]` | Edit file in a new tab | +| `:tabfind [file]` | Open file if exists in new tab | +| `:tabclose` | Close current tab | +| `:tabs` | List all tabs | +| `:tabfirst` | Go to first tab | +| `:tablast` | Go to last tab | +| `:tabn ` | Go to next tab | +| `:tabp ` | Go to previous tab | ### Editing @@ -98,10 +114,10 @@ Getting started ### Exiting insert mode -| Shortcut | Description | -| --- | --- | +| Shortcut | Description | +| --- | --- | | `Esc` _/_ `` | Exit insert mode | -| `` | Exit insert mode, and abort current command | +| `` | Exit insert mode, and abort current command | {: .-shortcuts} ### Clipboard @@ -119,13 +135,17 @@ Getting started ### Visual mode -| `v` | Enter visual mode | -| `V` | Enter visual line mode | -| `` | Enter visual block mode | +| Shortcut | Description | +| --- | --- | +| `v` | Enter visual mode | +| `V` | Enter visual line mode | +| `` | Enter visual block mode | {: .-shortcuts} #### In visual mode +| Shortcut | Description | +| --- | --- | | `d` _/_ `x` | Delete selection | | `s` | Replace selection | | `y` | Yank selection _(Copy)_ | @@ -229,6 +249,13 @@ Text objects let you operate (with an *operator*) in or around text blocks (*obj See [Operators](#operators) for other things you can do. +### Diff + +| Shortcut | Description | +| --- | --- | +| `gvimdiff file1 file2 [file3]` | See differencies between files, in HMI | + + Misc ---- @@ -257,27 +284,29 @@ Uppercase ones are recursive (eg, `zO` is open recursively). | Shortcut | Description | | --- | --- | -| `[(` `[{` `[<` | previous `(` or `{` or `<` | -| `])` | next | +| `[(` `[{` `[<` | Previous `(` or `{` or `<` | +| `])` | Next | | --- | --- | -| `[m` | previous method start | -| `[M` | previous method end | +| `[m` | Previous method start | +| `[M` | Previous method end | {: .-shortcuts} ### Jumping | Shortcut | Description | | --- | --- | -| `` | Go back to previous location | -| `` | Go forward | +| `` | Go back to previous location | +| `` | Go forward | | --- | --- | -| `gf` | go to file in cursor | +| `gf` | Go to file in cursor | {: .-shortcuts} ### Counters -| `` | increment number | -| `` | decrement | +| Shortcut | Description | +| --- | --- | +| `` | Increment number | +| `` | Decrement | {: .-shortcuts} ### Windows @@ -303,12 +332,12 @@ Uppercase ones are recursive (eg, `zO` is open recursively). | Shortcut | Description | | --- | --- | -| `~` | toggle case (Case => cASE) | -| `gU` | uppercase | -| `gu` | lowercase | +| `~` | Toggle case (Case => cASE) | +| `gU` | Uppercase | +| `gu` | Lowercase | | --- | --- | -| `gUU` | uppercase current line (also `gUgU`) | -| `guu` | lowercase current line (also `gugu`) | +| `gUU` | Uppercase current line (also `gUgU`) | +| `guu` | Lowercase current line (also `gugu`) | {: .-shortcuts} Do these in visual or normal mode. @@ -330,16 +359,17 @@ Do these in visual or normal mode. | Shortcut | Description | | --- | --- | -| `.` | repeat last command | -| `]p` | paste under the current indentation level | +| `.` | Repeat last command | +| `]p` | Paste under the current indentation level | {: .-shortcuts} ### Command line | Shortcut | Description | | --- | --- | -| `` | insert current word into the command line | -| `"` | paste from " register | +| `` | Insert current word into the command line | +| `"` | Paste from " register | +| `` | Auto-completion of path in insert mode | {: .-shortcuts} ### Text alignment @@ -352,7 +382,9 @@ See `:help formatting` ### Calculator - =128/2 +| Shortcut | Description | +| --- | --- | +| `=128/2` | Shows the result of the division : '64' | Do this in insert mode.