From a2ee84b2010691d7a54a9b335b12e92b366c7eae Mon Sep 17 00:00:00 2001 From: Yan Zhang Date: Thu, 1 Jun 2017 17:31:14 +0800 Subject: fix broken URL for vim (#2744) --- vim.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 96cc20cb..70f43be1 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -7,7 +7,7 @@ filename: LearnVim.txt --- -[Vim](www.vim.org) +[Vim](http://www.vim.org) (Vi IMproved) is a clone of the popular vi editor for Unix. It is a text editor designed for speed and increased productivity, and is ubiquitous in most unix-based systems. It has numerous keybindings for speedy navigation to -- cgit v1.2.3 From 985d23a52b76593a120adff5381c2df3a80fe298 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Wed, 23 Aug 2017 10:14:39 +0200 Subject: Fix a bunch of typos --- vim.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 70f43be1..7723136f 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -40,9 +40,9 @@ specific points in the file, and for fast editing. # Searching in the text - /word # Highlights all occurences of word after cursor - ?word # Highlights all occurences of word before cursor - n # Moves cursor to next occurence of word after search + /word # Highlights all occurrences of word after cursor + ?word # Highlights all occurrences of word before cursor + n # Moves cursor to next occurrence of word after search N # Moves cursor to previous occerence of word :%s/foo/bar/g # Change 'foo' to 'bar' on every line in the file -- cgit v1.2.3 From 6800d632b179661a8902db748fea50b7012e8208 Mon Sep 17 00:00:00 2001 From: Kyle Mendes Date: Fri, 27 Oct 2017 15:50:49 -0400 Subject: Cleaning up whitespace --- vim.html.markdown | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 7723136f..6fc52564 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -8,9 +8,9 @@ filename: LearnVim.txt [Vim](http://www.vim.org) -(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text -editor designed for speed and increased productivity, and is ubiquitous in most -unix-based systems. It has numerous keybindings for speedy navigation to +(Vi IMproved) is a clone of the popular vi editor for Unix. It is a text +editor designed for speed and increased productivity, and is ubiquitous in most +unix-based systems. It has numerous keybindings for speedy navigation to specific points in the file, and for fast editing. ## Basics of navigating Vim @@ -51,12 +51,12 @@ specific points in the file, and for fast editing. # Jumping to characters f # Jump forward and land on - t # Jump forward and land right before + t # Jump forward and land right before - # For example, + # For example, f< # Jump forward and land on < t< # Jump forward and land right before < - + # Moving by word w # Move forward by one word @@ -77,15 +77,15 @@ specific points in the file, and for fast editing. Vim is based on the concept on **modes**. -Command Mode - vim starts up in this mode, used to navigate and write commands -Insert Mode - used to make changes in your file -Visual Mode - used to highlight text and do operations to them +Command Mode - vim starts up in this mode, used to navigate and write commands +Insert Mode - used to make changes in your file +Visual Mode - used to highlight text and do operations to them Ex Mode - used to drop down to the bottom with the ':' prompt to enter commands ``` i # Puts vim into insert mode, before the cursor position a # Puts vim into insert mode, after the cursor position - v # Puts vim into visual mode + v # Puts vim into visual mode : # Puts vim into ex mode # 'Escapes' from whichever mode you're in, into Command mode @@ -102,18 +102,18 @@ Ex Mode - used to drop down to the bottom with the ':' prompt to enter comm ## The 'Grammar' of vim -Vim can be thought of as a set of commands in a +Vim can be thought of as a set of commands in a 'Verb-Modifier-Noun' format, where: -Verb - your action -Modifier - how you're doing your action +Verb - your action +Modifier - how you're doing your action Noun - the object on which your action acts on A few important examples of 'Verbs', 'Modifiers', and 'Nouns': ``` # 'Verbs' - + d # Delete c # Change y # Yank (copy) @@ -135,7 +135,7 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns': s # Sentence p # Paragraph b # Block - + # Sample 'sentences' or commands d2w # Delete 2 words @@ -180,7 +180,7 @@ Here's a sample ~/.vimrc file: ``` " Example ~/.vimrc -" 2015.10 +" 2015.10 " Required for vim to be iMproved set nocompatible -- cgit v1.2.3 From 437adfa5a4f07dfbae9e54c258fb0f8815a6c2dc Mon Sep 17 00:00:00 2001 From: Kyle Mendes Date: Fri, 27 Oct 2017 15:51:05 -0400 Subject: Adding help documentation --- vim.html.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 6fc52564..15144b8d 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -17,6 +17,7 @@ specific points in the file, and for fast editing. ``` vim # Open in vim + :help # Open up built-in help docs about if any exists :q # Quit vim :w # Save current file :wq # Save file and quit vim @@ -73,6 +74,15 @@ specific points in the file, and for fast editing. L # Move to the bottom of the screen ``` +## Help docs: + +Vim has built in help documentation that can accessed with `:help `. +For example `:help navigation` will pull up documentation about how to navigate +your workspace! + +`:help` can also be used without an option. This will bring up a default help dialog +that aims to make getting started with vim more approachable! + ## Modes: Vim is based on the concept on **modes**. -- cgit v1.2.3 From 20af61ee8d723dd9c3b987495261a476d59eff60 Mon Sep 17 00:00:00 2001 From: Neinei0k Date: Tue, 14 Nov 2017 18:14:17 +0000 Subject: [vim/en] Add sorting, folding, change letter case. Replacing new line character to new line character is not practical but an interesting example which shows the difference between representation of new line character in search and replace patterns. --- vim.html.markdown | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 15144b8d..d5c4e865 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 @@ -48,6 +49,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 +169,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 -- cgit v1.2.3 From 6198be809290c8e4abd7ef92815d94ea7ef697c6 Mon Sep 17 00:00:00 2001 From: Joshua Adams Date: Thu, 27 Sep 2018 10:58:55 -0600 Subject: added full screen movement formating more formatting --- vim.html.markdown | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index d5c4e865..0eb2c37e 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -34,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 -- cgit v1.2.3 From 6d033bb705bc216f381bed0d3beaf593868fc88b Mon Sep 17 00:00:00 2001 From: Wes Turner <50891+westurner@users.noreply.github.com> Date: Fri, 21 Dec 2018 15:48:10 -0500 Subject: DOC: vim.html.markdown: markdown listify lists --- vim.html.markdown | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 0eb2c37e..5b84a3ea 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -94,10 +94,10 @@ that aims to make getting started with vim more approachable! Vim is based on the concept on **modes**. -Command Mode - vim starts up in this mode, used to navigate and write commands -Insert Mode - used to make changes in your file -Visual Mode - used to highlight text and do operations to them -Ex Mode - used to drop down to the bottom with the ':' prompt to enter commands +- Command Mode - vim starts up in this mode, used to navigate and write commands +- Insert Mode - used to make changes in your file +- Visual Mode - used to highlight text and do operations to them +- Ex Mode - used to drop down to the bottom with the ':' prompt to enter commands ``` i # Puts vim into insert mode, before the cursor position @@ -122,9 +122,9 @@ Ex Mode - used to drop down to the bottom with the ':' prompt to enter comm Vim can be thought of as a set of commands in a 'Verb-Modifier-Noun' format, where: -Verb - your action -Modifier - how you're doing your action -Noun - the object on which your action acts on +- Verb - your action +- Modifier - how you're doing your action +- Noun - the object on which your action acts on A few important examples of 'Verbs', 'Modifiers', and 'Nouns': -- cgit v1.2.3 From 429a03869cc0d6e040aff6ffce1725cff56637dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Karlstr=C3=B6m?= Date: Thu, 23 Apr 2020 16:11:14 +0200 Subject: [vim/en] Add shortcut for quit vim --- vim.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 5b84a3ea..65efc25c 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -24,6 +24,7 @@ specific points in the file, and for fast editing. ZZ # Save file and quit vim :q! # Quit vim without saving file # ! *forces* :q to execute, hence quiting vim without saving + ZQ # Quit vim without saving file :x # Save file and quit vim, shorter version of :wq u # Undo -- cgit v1.2.3 From a7b0c945de3501cae2ad2e4940bff4553a71ef5c Mon Sep 17 00:00:00 2001 From: Hunter Coleman <35200320+HColeman1@users.noreply.github.com> Date: Sat, 2 May 2020 14:36:06 -0500 Subject: added the join command --- vim.html.markdown | 1 + 1 file changed, 1 insertion(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 65efc25c..27d90f18 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -182,6 +182,7 @@ A few important examples of 'Verbs', 'Modifiers', and 'Nouns': ~ # Toggle letter case of selected text u # Selected text to lower case U # Selected text to upper case + J # Join the current line with the next line # Fold text zf # Create fold from selected text -- cgit v1.2.3 From 02d9674e188a5b6b770f1b75d98a154438259246 Mon Sep 17 00:00:00 2001 From: Yatin Aditya Tekumalla Date: Fri, 12 Jun 2020 10:58:50 +0530 Subject: Update vim.html.markdown Add information about vimtutor, a tutor that comes with vim. --- vim.html.markdown | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vim.html.markdown') diff --git a/vim.html.markdown b/vim.html.markdown index 65efc25c..be3c97f5 100644 --- a/vim.html.markdown +++ b/vim.html.markdown @@ -13,6 +13,9 @@ editor designed for speed and increased productivity, and is ubiquitous in most unix-based systems. It has numerous keybindings for speedy navigation to specific points in the file, and for fast editing. +`vimtutor` is a an excellent application that teaches you how to use `Vim`. It comes with the vim package during installation. You should be able to just run "vimtutor" on the command line to open this tutor. It will guide you through all the major features in `vim`. + + ## Basics of navigating Vim ``` -- cgit v1.2.3