-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds VIM cheatsheet for developers #335
Open
Sushant-1999
wants to merge
4
commits into
onecompiler:master
Choose a base branch
from
Sushant-1999:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
--- | ||
title: Vim | ||
description: Vim is a text editor for Unix that comes with Linux, BSD, and macOS | ||
created: 2022-10-09 | ||
updated: 2022-10-12 | ||
--- | ||
|
||
### Exiting | ||
|
||
```sh | ||
:qa # Close all files | ||
:qa! # Close all files, abandon changes | ||
:w # Save | ||
:wq / :x # Save and close file | ||
:q # close file | ||
:q! # Close file, abandon changes | ||
ZZ # Save and quit | ||
ZQ # Quit without checking changes | ||
``` | ||
### Exiting insert mode | ||
|
||
```sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Markdown table |
||
Esc / <C-[> # Exit insert mode | ||
<C-C> # Exit insert mode, and abort current command | ||
``` | ||
|
||
### Visual mode | ||
|
||
```sh | ||
v # Enter visual mode | ||
V # Enter visual line mode | ||
<C-V> # Enter visual block mode | ||
d / x # Delete selection | ||
s # Replace selection | ||
``` | ||
|
||
### Navigating | ||
|
||
```sh | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Markdown table |
||
h j k l # Arrow keys | ||
<C-U> / <C-D> # Half-page up/down | ||
<C-B> / <C-F> # Page up/down | ||
b / w # Previous/next word | ||
ge / e # Previous/next end of word | ||
fc # Go forward to character c | ||
Fc # Go backward to character c | ||
gg # First line | ||
G # Last line | ||
zz # Center this line | ||
zb # Bottom this line | ||
n # Next matching search pattern | ||
N # Previous match | ||
* # Next whole word under cursor | ||
^ # Start of line (after whitespace) | ||
``` | ||
|
||
### Editing | ||
|
||
```sh | ||
a # Append | ||
A # Append from end of line | ||
i # Insert | ||
o # Next line | ||
O # Previous line | ||
S # Delete line and insert | ||
C # Delete until end of line and insert | ||
<C-R> # Redo changes | ||
``` | ||
|
||
### Clipboard | ||
|
||
```sh | ||
x # Delete character | ||
dd # Delete line (Cut) | ||
yy # Yank line (Copy) | ||
"*p / "+p # Paste from system clipboard | ||
"*y / "+y # Paste to system clipboard | ||
``` | ||
|
||
### Jumping | ||
|
||
```sh | ||
<C-O> # Go back to previous location | ||
<C-I> # Go forward | ||
gf # Go to file in cursor | ||
``` | ||
|
||
### Counters | ||
|
||
```sh | ||
<C-A> # Increment number | ||
<C-X> # Decrement | ||
``` | ||
|
||
### Spell Checking | ||
|
||
```sh | ||
]s # Move to next misspelled word after the cursor | ||
[s # Move to previous misspelled word before the cursor | ||
z= # Suggest spellings for the word under/after the cursor | ||
zg # Add word to spell list | ||
zw # Mark word as bad/mispelling | ||
``` | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Markdown table