diff options
author | Divay Prakash <divayprakash@users.noreply.github.com> | 2018-10-24 11:04:05 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-24 11:04:05 +0530 |
commit | 4a7d678c2553bc379542a5901177b8bb2730ce65 (patch) | |
tree | b2896f9f02b5a752f860a71a36b1e16c566a8ed7 /vim.html.markdown | |
parent | e2949649f054ca069e95a05b04d99bccc30ba45d (diff) | |
parent | 8f5a67190705c9a3101653901d8f8a7b48eb1775 (diff) |
Merge branch 'master' into master
Diffstat (limited to 'vim.html.markdown')
-rw-r--r-- | vim.html.markdown | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vim.html.markdown b/vim.html.markdown index 15144b8d..0eb2c37e 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -21,6 +21,7 @@ specific points in the file, and for fast editing. :q # Quit vim :w # Save current file :wq # Save file and quit vim + ZZ # Save file and quit vim :q! # Quit vim without saving file # ! *forces* :q to execute, hence quiting vim without saving :x # Save file and quit vim, shorter version of :wq @@ -33,6 +34,11 @@ specific points in the file, and for fast editing. k # Move up one line l # Move right one character + Ctrl+B # Move back one full screen + Ctrl+F # Move forward one full screen + Ctrl+D # Move forward 1/2 a screen + Ctrl+U # Move back 1/2 a screen + # Moving within the line 0 # Move to beginning of line @@ -48,6 +54,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 # Jumping to characters @@ -167,6 +174,20 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns': ddp # Swap position of consecutive lines, dd then p . # Repeat previous action :w !sudo tee % # Save the current file as root + :set syntax=c # Set syntax highlighting to 'c' + :sort # Sort all lines + :sort! # Sort all lines in reverse + :sort u # Sort all lines and remove duplicates + ~ # Toggle letter case of selected text + u # Selected text to lower case + U # Selected text to upper case + + # Fold text + zf # Create fold from selected text + zo # Open current fold + zc # Close current fold + zR # Open all folds + zM # Close all folds ``` ## Macros |