From 989a349f9a5da58f5b158c448c93e6a6005cb867 Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Tue, 16 Jan 2018 23:23:13 +0100 Subject: Added a few shortcuts to shortcuts.txt --- doc/shortcuts.txt | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/shortcuts.txt b/doc/shortcuts.txt index d70855f..015684e 100644 --- a/doc/shortcuts.txt +++ b/doc/shortcuts.txt @@ -28,12 +28,26 @@ caw = select 'a word' :g!/foo/s/bar//g = on lines not containing foo replace bar with nothing :g!/^foo/execute("normal dd") delete lines starting with foo +flags, end: after the last / +g = replace globally (all occurances on the current line) +c = confirm each replace, also allows to switch to g (use the flag to see the help message) +e = places the cursor in the end of the selection + +flags, within the search string: +\v = use very magic search (more like perl) +\V = use no very magic, more like searching verbatim +\zs .. \ze = mark begin and end of a sub pattern (like perl lookaround assertions) + + + [visual mode] # with selected lines gq = formats text so that it fits in whatever :set textwidth was set iB = select block between curly braces (:help object-select) [commands] +command line mode begins with : and has its own key mappings starting with c like in cnormap + :spell [word] = adds a word to the current dictionary (no mistake any more) :set list = display non printable characters :retab = replaces tabs with spaces @@ -42,6 +56,8 @@ iB = select block between curly braces (:help object-select) :Lex = use netrw as project drawer (stays open in its own window) :only = 'maximize' current buffer + = auto completion with the word under the cursor (interesting with incsearch) + [navigation] = look up the tag under the cursor (help links as well) @@ -68,10 +84,12 @@ notice, that registers get used for both: macro recordings and copying text [marker] ma = set marker a-z (a in this case) +mA = create a session persistent file marker which can be used to reopen a file (not bound to the buffer) `a = go to marker a (line & column) 'a = go to marker a (line, first non blank), same as `a^ + [hotkeys] , = increment, decrement number under the cursor @@ -82,6 +100,8 @@ ma = set marker a-z (a in this case) w = moves the cursor to the next window and back [dir] = moves the cursor in that direction (use hjkl or arrow keys) [HK] = make a vertical split horizontal and vice versa +o = only: close all other windows +c = close: current window in which the cursor sits [vimdiff] @@ -133,6 +153,11 @@ CTRL-R = in insert mode and command line: paste contents of CTRL-R = in normal mode: redoes what has been undone with u "p = in normal mode: paste paste contents of +[registers] +"/ = last search expression +": = last command entered +"= = expression register (to do calculations or call vim functions) + [netrw] @@ -159,9 +184,13 @@ viB:sort = sort inner block by name :finish = from within a viml-script: stop sourcing it + +[programs] +gpm - cut and paste helper for the linux console (to get text from CTRL-ALT-F2 to CTRL-ALT-F3) + + [vim modeline] filetype can have multiple values, like python.django The last line can be a mode line, which holds settings like tab width: - # vim: noai:ts=2:sw=2 filetype=dosini.text -- cgit v1.2.3