Merge pull request #4512 from kaymmm/master

[vim/en] add additional fold commands and visual regex; reformat
This commit is contained in:
Marcel Ribeiro Dantas 2022-10-10 10:10:26 +02:00 committed by GitHub
commit 2ed44955b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ category: tool
tool: vim
contributors:
- ["RadhikaG", "https://github.com/RadhikaG"]
- ["kaymmm", "https://github.com/kaymmm"]
filename: LearnVim.txt
---
@ -59,6 +60,7 @@ specific points in the file, and for fast editing.
:%s/foo/bar/g # Change 'foo' to 'bar' on every line in the file
:s/foo/bar/g # Change 'foo' to 'bar' on the current line
:%s/\n/\r/g # Replace new line characters with new line characters
:'<,'>s/foo/bar/g # Change 'foo' to 'bar on every line in the current visual selection
# Jumping to characters
@ -196,10 +198,21 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns':
# Fold text
zf # Create fold from selected text
zd # Delete fold on the current line
zD # Recursively delete nested or visually selected folds
zE # Eliminate all folds in the window
zo # Open current fold
zO # Recursively open nested or visually selected folds
zc # Close current fold
zC # Recursively close nested or visually selected folds
zR # Open all folds
zM # Close all folds
za # Toggle open/close current fold
zA # Recursively toggle open/close nested fold
[z # Move to the start of the current fold
]z # Move to the end of the current fold
zj # Move to the start of the next fold
zk # Move to the end of the previous fold
```
## Macros