Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions vim.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Getting started
| `:qa` | Close all files |
| --- | --- |
| `:w` | Save |
| `:q!` | Force Close file |
| `:qa!` | Force Close all file |
| `:wq` _/_ `:x` | Save and close file |
| --- | --- |
| `ZZ` | Save and quit |
Expand Down Expand Up @@ -51,14 +53,16 @@ Getting started
| Shortcut | Description |
| --- | --- |
| `0` _(zero)_ | Start of line |
| `^` | Start of line _(after whitespace)_ |
| `_` | Start of line _(after whitespace)_ |
| `$` | End of line |
{: .-shortcuts}

#### Character

| `fc` | Go forward to character `c` |
| `Fc` | Go backward to character `c` |
| `fc` | Go forward on character `c` |
| `Fc` | Go backward on character `c` |
| `tc` | Go forward to character `c` |
| `Tc` | Go backward to character `c` |
{: .-shortcuts}

#### Document
Expand Down Expand Up @@ -115,6 +119,7 @@ Getting started
| `a` | Append |
| `A` | Append from end of line |
| `i` | Insert |
| `I` | Append from Start of line |
| `o` | Next line |
| `O` | Previous line |
| --- | --- |
Expand Down Expand Up @@ -175,9 +180,11 @@ See [Operators](#operators) for other things you can do.

### Find & Replace

| Shortcut | Description |
| --- | --- |
| :%s/foo/bar/g | Replace foo with bar in whole document |
| Shortcut | Description |
| --- | --- |
| :%s/foo/bar | Replace foo with bar in whole document `(first occurrence in line)` |
| :%s/foo/bar/g | Replace foo with bar in whole document `(all occurrences in line)`|
| :%s#foo#bar#g | Replace foo with bar in whole document `(all occurrences in line)`|

Operators
---------
Expand Down