From 2c40178eb1f089d12692a141af3a8d713f0c77ea Mon Sep 17 00:00:00 2001 From: Ryan Olson Date: Wed, 22 Jan 2020 16:38:21 -0700 Subject: [PATCH] vim: helpful additions Closes #3779 --- pages/common/vim.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pages/common/vim.md b/pages/common/vim.md index c846191e0..94c44cef8 100644 --- a/pages/common/vim.md +++ b/pages/common/vim.md @@ -1,20 +1,28 @@ # vim -> Vi IMproved, a programmer's text editor, provides several modes for different kinds of text manipulation. +> Vim (Vi IMproved), a programmer's command-line text editor, provides several modes for different kinds of text manipulation. > Pressing `i` enters edit mode. `` goes back to normal mode, which doesn't allow regular text insertion. > More information: . - Open a file: -`vim {{file}}` +`vim {{path/to/file}}` -- Enter text editing mode (insert mode): +- Save a file: -`i` +`:write` -- Copy ("yank") or cut ("delete") the current line (paste it with `P`): +- Quit without saving: -`{{yy|dd}}` +`:quit!` + +- Open a file at a specified line number: + +`vim +{{line_number}} {{path/to/file}}` + +- View help for setting (such as {{set number}}): + +`:help '{{setting_name}}'` - Undo the last operation: @@ -27,11 +35,3 @@ - Perform a regex substitution in the whole file: `:%s/{{pattern}}/{{replacement}}/g` - -- Save (write) the file, and quit: - -`:wq` - -- Quit without saving: - -`:q!`