From 3223ca6c0e6290840ca3041d47c50ae03dbe9729 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 27 Oct 2013 09:57:16 +0000 Subject: [PATCH] Added cheatsheet for vi --- cheatsheets/vi | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cheatsheets/vi diff --git a/cheatsheets/vi b/cheatsheets/vi new file mode 100644 index 0000000..3695572 --- /dev/null +++ b/cheatsheets/vi @@ -0,0 +1,37 @@ +# To edit text (enter "insert" mode) +i + +# To disable editing +Esc + +# To exit and save changes +:x + +# To quit without saving +:q! + +# The following commands only work when not in insert mode + +# To delete a line +dd + +# To copy a line +y + +# To paste a line +p + +# To search for some text +/searchtext + +# To search and replace +:1,$s/searchtext/replacetext/ + +# To move to the start of a line +0 + +# To move to the end of a line +$ + +# To move to the next word +w