From 029e57934548b1d37daf216a65a357a48f2e4000 Mon Sep 17 00:00:00 2001 From: NaveenKarippai Date: Mon, 13 Jun 2016 19:10:01 +0000 Subject: [PATCH 1/2] vim_cheat_sheet: Add ex commands and registers section As a vim user, registers make the life easier to get the daily programming tasks done. Additional ex-commands cheat is also handy as ex-editor is at the core of vim editor. * added ex-commands section * added registers section --- share/goodie/cheat_sheets/json/vim.json | 69 ++++++++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/vim.json b/share/goodie/cheat_sheets/json/vim.json index b1fec5d358e..ff736bdc6a1 100644 --- a/share/goodie/cheat_sheets/json/vim.json +++ b/share/goodie/cheat_sheets/json/vim.json @@ -27,7 +27,8 @@ "Visual Commands", "Working with Multiple Files", "Tabs", - "Miscellaneous", + "Registers", + "Additional Ex Commands", "Basic Configuration" ], "sections": { @@ -56,6 +57,43 @@ "val": "move to the previous tab", "key": "[gT] / [:tabprev] / [:tabp]" }], + "Registers": [{ + "val": "view all current registers", + "key": "[:reg] / [:registers]" + }, { + "val": "access register `r` as a variable", + "key": "echo @r" + }, { + "val": "last search pattern register", + "key": "\"/" + }, { + "val": "the black hole register", + "key": "\"_" + }, { + "val": "last yank register", + "key": "\"0" + }, { + "val": "last big delete register", + "key": "\"1" + }, { + "val": "big delete register stack", + "key": "\"2-\"9" + }, { + "val": "system clipboard", + "key": "\"+" + }, { + "val": "small delete register", + "key": "\"-" + }, { + "val": "named registers", + "key": "\"a-\"z" + }, { + "val": "append registers", + "key": "\"A-\"Z" + }, { + "val": "record into register r", + "key": "qr" + }], "Editing": [{ "val": "replace a single character", "key": "r" @@ -429,7 +467,34 @@ "val": "replace all old with new throughout file with confirmations", "key": ":%s/old/new/gc" }], - "Miscellaneous": [{ + "Additional Ex Commands": [{ + "val": "run a compiler and enter quickfix mode", + "key": "[:mak] / [:make]" + }, { + "val": "execute external shell command", + "key": ":!" + }, { + "val": "read external program output into current file", + "key": "[:r] / [:read]" + }, { + "val": "move lines x through y to z (delete + put)", + "key": ":x,ymz" + }, { + "val": "yank lines x through y and put to z (yank + put)", + "key": ":x,ytz" + }, { + "val": "current line (cursor location)", + "key": ":." + }, { + "val": "last line (bottom of file)", + "key": ":$" + }, { + "val": "first line (top of file)", + "key": ":0" + }, { + "val": "list all open files", + "key": ":ls" + },{ "val": "create html representation of current working buffer", "key": ":%TOhtml" }], From 883befed93bf6e55f4485de0e5a8324bc42ef6c4 Mon Sep 17 00:00:00 2001 From: NaveenKarippai Date: Tue, 14 Jun 2016 19:23:47 +0000 Subject: [PATCH 2/2] vim_cheat_sheet: Indent json data --- share/goodie/cheat_sheets/json/vim.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/goodie/cheat_sheets/json/vim.json b/share/goodie/cheat_sheets/json/vim.json index ff736bdc6a1..13067d22226 100644 --- a/share/goodie/cheat_sheets/json/vim.json +++ b/share/goodie/cheat_sheets/json/vim.json @@ -27,7 +27,7 @@ "Visual Commands", "Working with Multiple Files", "Tabs", - "Registers", + "Registers", "Additional Ex Commands", "Basic Configuration" ], @@ -91,7 +91,7 @@ "val": "append registers", "key": "\"A-\"Z" }, { - "val": "record into register r", + "val": "record into register `r`", "key": "qr" }], "Editing": [{