<commit_before>. (full stop) repeats last command
; (semicolon) repeats last motion (t/f, T/F)
, (comma) reverse last motion (t -> T, f -> F)
@: repeats last :command
    replays (@) the colon macro
@@ repeats the last repeat
    replays (@) the replay (@) of a macro

remove all blank lines
	:g/^\s*/d
remove all lines _not_ matching a pattern
	:g!/somepattern/d

Dealing with huge files, it's better to use d_ to send all matched lines to blackhole register, which will be faster.


x,X (del/backspace) without entering insert mode


~ toggle case (a -> A, A -> a)
    u or U in visual mode to turn selected text to lower/UPPER case
S substitute whole line (from the soft BOL)
C change to EOL


copy all lines matching a pattern into register (a)
qaq:g/pattern/y A

	here, first three commands q,a,q will clera the a register
	last command :g/pattern/y A is effectively global YANK of lines matching into register a (captial A for _appending_ into a)

=====
UNDO/REDO
=====

u
	to undo
Ctrl+r
	to un-undo
	
g- / g+
        previous / next state of the buffer "as was on screen" (navigates the undo tree), unlike a linear history with undo/redo
        this also is good for just navigating to most recently edited location (first go backwards, then forwards g-g+)
        or, go to last insertion point by using "gi"

can also use :earlier :later
like this: :earlier 20s to move to the state of buffer from 20 seconds ago


=====
NAVIGATING
=====
(,) to go to previous/next sentence
{,} to go to previous/next paragraph
[[,]] to go to previous/next section (this could mean the whole file)

backwards by pressing Ctrl+o
forwards by Tabbing

gi goes to insertion mode in the same place where user was last editing.
gv goes to visual mode, selecting the same selection as was in last visual mode.

can jump to any line number by typing the number followed by capital G
    e.g. 1233G
        to go to line 1233

can easily place marks in file, like so : ma mb mc md etc...
can then navigate back to these marks like so: `a `b `c `d etc... (note, it's a backtick)

Double backtick `` will jump between last visited marked location and your current location. Double single-quote will behave similarly. The difference is that the backtick goes to the same location on the line, whereas the apostrophe goes to the start of the line.


end of line by pressing $
start of line by pressing ^ or 0
    ^ - soft bol - follows indentation
    0 - hard bol - takes you to column 0

Shift+i (I) - insert at (soft) bol - prepend to line
Shift+a (A) - append to line

====
FOLDING
====

zA
    toggle ALL folds on/off (expand/contract)
za
    toggle current fold on/off

zc/zo
    close/open current fold
zr/zm
    reduces/increases folding by opening/closing one more level of folds throughout the whole buffer (the cursor position is not relevant)
    Use zR to open all folds. Use zM to close all folds.

====
BLOCK EDITING
====

Ctrl+v % Shift-i // Esc
    Ctrl+v to enter visual block edit mode
    % motion to visually edit until next matching bracket
    Shift-i means insert at start of line
    // is to be inserted
    Esc to escape visual block editing mode

Ctrl+v % $ Shift-a , Esc
    in a similar manner will append comma to the end of each line in the current block
    trick is first need to move cursor to end of line $ and then "append" with Shift-a
    whatever is typed prior to pressing Esc will be appended to the end of each line in the block

===
FORMATTING CODE
===

= formats code.
	Takes a motion as argument, so to format all code in a file do:
	gg=G
=% formats code up to matching bracket (round, square, angle, squiggly, doesn't matter)
	NB, must position cursor on opening/closing bracket for this to work properly

====
TAGS (xml / html)
Selecting insides/outsides of xml tags
====

vat
    select outside tag in visual mode
vatat
    select outside-outside tag in visual mode
vatatat
    you can guess...
o
    jump to opposite tag, while still in visual mode

vit
    select the inside (/innerHtml) of the current tag
vitit
    select the inside (/innerHtml) of the parent tag
vititit
    you can guess...


=====
COPY-PASTING
=====

copying is called Yanking and so the command y is for yanking
pasting is called Pasting and so the command p is for pasting
cutting is same as deleting - any deleted lines end up in a default register, so can just be pasted after deleting


SELECT TEXT
	press V then up/down arrows to select text
		then press y to copy or d to cut

register can be cleared by recording nothing into it, e.g. to clear the register a, type qaq
to access register a, use double quotes, e.g. to paste contents of register, use the command "ap

The most recent yank and most recent delete are always stored (separately) in the numbered registers. The register 0 holds the most recent yank. The registers 1-9 hold the 9 most recent deletes (with 1 being the most recent).


copy all lines matching a pattern like so:
	qaq:g/pattern/y A
optionally, open new buffer using the :new command
and paste the contents of the a register into it
	"ap

MORE EXAMPLES

to copy the current line into register k, you can type
	"kyy
Or you can append to a register by using a capital letter
	"Kyy
You can then move through the document and paste it elsewhere using
	"kp
To paste from system clipboard ("+ is the sytem clipboard register)
	"+p
To access all currently defined registers type
	:reg



to DUPLICATE A LINE use a combination of yank and paste like so:
YP
	or
Yp
	or
yyp

(yy to yank current line, Y is the same as yy)
(p pastes after the cursor, P paste before the cursor)



====
MACROS
====
q<letter><commands>q
    records a series of commands into a
@a
    replays macro a
@@
    replays previous macro

to replay a macro for each line in a visual block selection, must do:
    :norm! @a
this is required to execute the a macro in normal mode, similarly this is to be used when applying a macro to lines matched with the :g command
    :g/pattern/norm! @a

=====
SEARCHING
=====

/ or ? followed by pattern, then press ENTER to perform the search
	n or N to navigate to next/previous search match


*
	to search for next occurrence of word currently under cursor
[I
	to get a listing of all occurrences of word currently under cursor


** interesting settings for searching

:set hlsearch - to enable search highlighting
:set incsearch - show match as search proceeds
:set ignorecase - case insensitive
:set smartcase - use case if any caps used 

:noh
    to clear highlighted search results (no highlighting - "noh")

====
OTHER SET-tings
====
:set nu
    sets line numbering
:set nonumber
    un-sets line numbering
:set list
:set nolist
    sets and unsets the display of invisible characters, like spaces and tabs, etc.

=====
COMMAND HISTORY
=====

:his
	to list command history
:his /

	to list search history

:<up/down> to go through previous commands
/<up/down> to go through previous searches
to re-run previous search just type / on its own, this re-runs the previous forward search
same goes for ? to re-run the previous backward search


=====
CHANGING
=====
ci)    or    ci" (or any other paired character like ] } etc)
    Changes all text inside quotes or brackets
    Similarly, to change only text from current cursor position up till the next bracket/quote, use:
ct)    or    ct"
    Change 'till, erases all text up to the first occurrence of character pressed after ct
ciw
    change word (as opposed to `cw` which changes from current cursor to the beginning of next word)


=====
REPLACING (SUBSTITUTING)
=====
:%s/searchFor/replaceWith/g
	:% across all lines
	/g across the matched line, replace all matched occurrences, rather than just fist
:s/search/replace/
	on current line, just the first occurrence
in the non-global version of substitute, (i.e. :s/x/y/) use n (to find next occurrence) and & to repeat the substitution
    alternative way is to specify the c option on a global substitute like so:
        :%s/needle/replacement/gc
            here g is for all occurrences on a line
            and c requests a confirmation of each substitution

if seach part is omitted then the last search performed by ? or / is performed. This is a neat trick to search for regex first, then do the substitution without specifying search part:

    /my complicated regexp     " Highlighted as you enter characters
    :%s//replace with this/    " You don't have to type it again

can reference captured groups in the _replace_ by using \1 \2 etc (\0 references the entire match)
however, the _search_ part needs to escape the capturing groups' parentheses like so:
	:%s/\(wrapInQuotes\)/"\1"/g


=====
CLOSING and (not) SAVING
=====

:w
	write current buffer to file (effectively SAVE)
:wa
	write all buffers (save all files)
:wq
	write and quit


:up
	update
:x
	update and quit

:w and :wq will always udate the timestamp, as they will always write the buffer out to the file
:up and :x will not update timestamp if there are no changes to write. Update will only write if there's any changes to update in the underlying file

mental checklist
- do I want to write the file? (w) 
- do I want to quit the file? (q) 
- do I want to quit ALL the files? (a) 
- do I want to write/abandon any changes? (!) 


ZZ	Write current file, if modified, and exit. (same as :x)
ZQ	Quit current file and exit (same as ":q!").



=====
JOINING/SPLITTING LINES
=====

gJ
    to join

splitting done by replacing a character - e.g. a space - with Enter - i.e. r<Enter>
if no character to replace, just enter insert mode and press Enter
    or
yank a blank line and paste as many times as required, e.g. 2p

join multiple lines by selecting them in visual mode, V, then press J
join all lines by pressing:
    ggVGJ
        gg - first line
        V - visual line select
        G - last line
        J - join


=====
BUFFERS
=====

:new
:edit
    reload current buffer from underlying file (if edited outside vim)
:edit <file>
    opens a file in vim
:ls
	list all open buffers
:bd
    buffer delete (effectively close the current file)


=====
VARIOUS
=====
insert new line with o or O but this will leave you in insert mode
dd to delete a line
d$ to delete from current cursor position to the end of line
2dd to delete 2 lines

sort all lines in the buffer like so:
    :sort
sort in reverse order like so:
    :sort!
Sort a range of lines by selecting them (Shift+V to visual line selection mode). This will automatically insert '<, '> into the command line (on pressing `:`).  This translates as "range from start of visual selection to end of visual selection" and you do not need to clear the command line before typing the sort command.
You can also manually specify the range. One way can be to drop a mark at the start (e.g. `ma` drops the a-mark) - then move to the last line of the text-to-be-sorted, then sort the range from the placed mark to the current line like so:
    :'a,.sort
    range from reference to mark a ('a) to (,) current line (.)

You can also sort and REMOVE DUPLICATE LINES
    :sort u
or use numeric sort
    :sort n


:find some-file
    open a file by seraching for it
:read some-file
    include verbatim copy of a file in the edited file
C-x C-f
    in insert mode - fill in a name of a file/directory
C-x C-l
    in insert mode - insert an entire line that is somewhere in the current file

\html
    new snippet thing that is based on remapping the key sequence \html to a command that reads a snippet into current file

creating snippets
    create a keymapping like this and a file to load (snippet):
        
        nnoremap \html :-1read ~/.vim_runtime/snippets/index.html<CR>5jWvitc



===================
REGULAR EXPRESSIONS
===================

The syntax for regexes is weird and different in the world of Vim

\< and \> mark word boundaries

quantifiers:
    * (star) quantifier does not need escaping BUT:
    + (plus) quantifier however DOES need escaping like so \+
    ? is not recognized, use \= instead
    the OPEN curly bracket in quantifiers needs to be escaped, otherwise this works as usual: \{5} \{,3} \{2,} \{2,3}
    round brackets also require escaping, however! note BOTH \( AND \) need to be escaped, not just the open one.



====
MISC
====

Ctrl+a
	increment number under cursor
Ctrl+x
	decrement number under cursor

Ctrl+n
	while typing this will show a list of suggestions for word completion

gx
    this will open the URL currently under cursor in the default browser

Ex mode: switch to Ex mode by typing Q
Commands entered in the Ex mode do not cause the screen to re-draw. One must type "visual" in the ex mode to exit to normal mode, this causes vim to re-draw (one gets "visual" feedback of) the changes on screen.



=======
PLUGINS
=======

visincr.vba - visual-mode increment numbers vimball
    make column selection, then type

    :II

    this will create a sequence (starting from number in first line of selection) that is 0-padded to 2 digits

    :I will create a number range that isn't padded
    :I 2 will create a number range in steps of two


=============================
CONFIGURATION AND KEY MAPPING
=============================

`:map` and `:noremap ` are **recursive** and **non-recursive** versions of the various mapping commands. What that means is that if you do:

```
:map j gg
:map Q j
:noremap W j
```

`j` will be mapped to `gg`. `Q` will also be mapped to `gg`, because `j` will be expanded for the recursive mapping. `W` will be mapped to `j` (and not to `gg`) because `j` will not be expanded for the non-recursive mapping.

For each of these sets of mappings, there is a mapping that works in *normal*, *visual*, *select* and *operator* modes (`:map` and `:noremap`), one that works in normal mode (`:nmap` and `:nnoremap`), one in visual mode (`:vmap` and `:vnoremap`) and so on.



=====
LINKS TO INTERESTING PAGES
=====
using the g command for global pattern matching
	http://vim.wikia.com/wiki/Power_of_g
using vim buffers
	http://vim.wikia.com/wiki/Vim_buffer_FAQ
very nice collection of tips
	https://www.cs.swarthmore.edu/help/vim/home.html
multiline editing
    http://stackoverflow.com/a/11790464/81520
visual mode selecting xml tags
    http://stackoverflow.com/a/10881471/81520

<commit_msg>replacing in vim with yiw/viwp<commit_after>. (full stop) repeats last command
; (semicolon) repeats last motion (t/f, T/F)
, (comma) reverse last motion (t -> T, f -> F)
@: repeats last :command
    replays (@) the colon macro
@@ repeats the last repeat
    replays (@) the replay (@) of a macro

remove all blank lines
	:g/^\s*/d
remove all lines _not_ matching a pattern
	:g!/somepattern/d

Dealing with huge files, it's better to use d_ to send all matched lines to blackhole register, which will be faster.


x,X (del/backspace) without entering insert mode


~ toggle case (a -> A, A -> a)
    u or U in visual mode to turn selected text to lower/UPPER case
S substitute whole line (from the soft BOL)
C change to EOL


copy all lines matching a pattern into register (a)
qaq:g/pattern/y A

	here, first three commands q,a,q will clear the a register
	last command :g/pattern/y A is effectively global YANK of lines matching into register a (captial A for _appending_ into a)

=====
UNDO/REDO
=====

u
	to undo
Ctrl+r
	to un-undo
	
g- / g+
        previous / next state of the buffer "as was on screen" (navigates the undo tree), unlike a linear history with undo/redo
        this also is good for just navigating to most recently edited location (first go backwards, then forwards g-g+)
        or, go to last insertion point by using "gi"

can also use :earlier :later
like this: :earlier 20s to move to the state of buffer from 20 seconds ago


=====
NAVIGATING
=====
(,) to go to previous/next sentence
{,} to go to previous/next paragraph
[[,]] to go to previous/next section (this could mean the whole file)

backwards by pressing Ctrl+o
forwards by Tabbing

gi goes to insertion mode in the same place where user was last editing.
gv goes to visual mode, selecting the same selection as was in last visual mode.

can jump to any line number by typing the number followed by capital G
    e.g. 1233G
        to go to line 1233

can easily place marks in file, like so : ma mb mc md etc...
can then navigate back to these marks like so: `a `b `c `d etc... (note, it's a backtick)

Double backtick `` will jump between last visited marked location and your current location. Double single-quote will behave similarly. The difference is that the backtick goes to the same location on the line, whereas the apostrophe goes to the start of the line.


end of line by pressing $
start of line by pressing ^ or 0
    ^ - soft bol - follows indentation
    0 - hard bol - takes you to column 0

Shift+i (I) - insert at (soft) bol - prepend to line
Shift+a (A) - append to line

====
FOLDING
====

zA
    toggle ALL folds on/off (expand/contract)
za
    toggle current fold on/off

zc/zo
    close/open current fold
zr/zm
    reduces/increases folding by opening/closing one more level of folds throughout the whole buffer (the cursor position is not relevant)
    Use zR to open all folds. Use zM to close all folds.

====
BLOCK EDITING
====

Ctrl+v % Shift-i // Esc
    Ctrl+v to enter visual block edit mode
    % motion to visually edit until next matching bracket
    Shift-i means insert at start of line
    // is to be inserted
    Esc to escape visual block editing mode

Ctrl+v % $ Shift-a , Esc
    in a similar manner will append comma to the end of each line in the current block
    trick is first need to move cursor to end of line $ and then "append" with Shift-a
    whatever is typed prior to pressing Esc will be appended to the end of each line in the block

===
FORMATTING CODE
===

= formats code.
	Takes a motion as argument, so to format all code in a file do:
	gg=G
=% formats code up to matching bracket (round, square, angle, squiggly, doesn't matter)
	NB, must position cursor on opening/closing bracket for this to work properly

====
TAGS (xml / html)
Selecting insides/outsides of xml tags
====

vat
    select outside tag in visual mode
vatat
    select outside-outside tag in visual mode
vatatat
    you can guess...
o
    jump to opposite tag, while still in visual mode

vit
    select the inside (/innerHtml) of the current tag
vitit
    select the inside (/innerHtml) of the parent tag
vititit
    you can guess...


=====
COPY-PASTING
=====

copying is called Yanking and so the command y is for yanking
pasting is called Pasting and so the command p is for pasting
cutting is same as deleting - any deleted lines end up in a default register, so can just be pasted after deleting


SELECT TEXT
	press V then up/down arrows to select text
		then press y to copy or d to cut

register can be cleared by recording nothing into it, e.g. to clear the register a, type qaq
to access register a, use double quotes, e.g. to paste contents of register, use the command "ap

The most recent yank and most recent delete are always stored (separately) in the numbered registers. The register 0 holds the most recent yank. The registers 1-9 hold the 9 most recent deletes (with 1 being the most recent).


copy all lines matching a pattern like so:
	qaq:g/pattern/y A
optionally, open new buffer using the :new command
and paste the contents of the a register into it
	"ap

MORE EXAMPLES

to copy the current line into register k, you can type
	"kyy
Or you can append to a register by using a capital letter
	"Kyy
You can then move through the document and paste it elsewhere using
	"kp
To paste from system clipboard ("+ is the sytem clipboard register)
	"+p
To access all currently defined registers type
	:reg



to DUPLICATE A LINE use a combination of yank and paste like so:
YP
	or
Yp
	or
yyp

(yy to yank current line, Y is the same as yy)
(p pastes after the cursor, P paste before the cursor)



====
MACROS
====
q<letter><commands>q
    records a series of commands into a
@a
    replays macro a
@@
    replays previous macro

to replay a macro for each line in a visual block selection, must do:
    :norm! @a
this is required to execute the a macro in normal mode, similarly this is to be used when applying a macro to lines matched with the :g command
    :g/pattern/norm! @a

=====
SEARCHING
=====

/ or ? followed by pattern, then press ENTER to perform the search
	n or N to navigate to next/previous search match


*
	to search for next occurrence of word currently under cursor
[I
	to get a listing of all occurrences of word currently under cursor


** interesting settings for searching

:set hlsearch - to enable search highlighting
:set incsearch - show match as search proceeds
:set ignorecase - case insensitive
:set smartcase - use case if any caps used 

:noh
    to clear highlighted search results (no highlighting - "noh")

====
OTHER SET-tings
====
:set nu
    sets line numbering
:set nonumber
    un-sets line numbering
:set list
:set nolist
    sets and unsets the display of invisible characters, like spaces and tabs, etc.

=====
COMMAND HISTORY
=====

:his
	to list command history
:his /

	to list search history

:<up/down> to go through previous commands
/<up/down> to go through previous searches
to re-run previous search just type / on its own, this re-runs the previous forward search
same goes for ? to re-run the previous backward search


=====
CHANGING
=====
ci)    or    ci" (or any other paired character like ] } etc)
    Changes all text inside quotes or brackets
    Similarly, to change only text from current cursor position up till the next bracket/quote, use:
ct)    or    ct"
    Change 'till, erases all text up to the first occurrence of character pressed after ct
ciw
    change word (as opposed to `cw` which changes from current cursor to the beginning of next word)


=====
REPLACING (SUBSTITUTING)
=====

simple replace of a word with a yanked word:
yiw
viwp
    this will yank inside a word
    followed by visually selecting inside another word and pasting over it

:%s/searchFor/replaceWith/g
	:% across all lines
	/g across the matched line, replace all matched occurrences, rather than just fist
:s/search/replace/
	on current line, just the first occurrence
in the non-global version of substitute, (i.e. :s/x/y/) use n (to find next occurrence) and & to repeat the substitution
    alternative way is to specify the c option on a global substitute like so:
        :%s/needle/replacement/gc
            here g is for all occurrences on a line
            and c requests a confirmation of each substitution

if seach part is omitted then the last search performed by ? or / is performed. This is a neat trick to search for regex first, then do the substitution without specifying search part:

    /my complicated regexp     " Highlighted as you enter characters
    :%s//replace with this/    " You don't have to type it again

can reference captured groups in the _replace_ by using \1 \2 etc (\0 references the entire match)
however, the _search_ part needs to escape the capturing groups' parentheses like so:
	:%s/\(wrapInQuotes\)/"\1"/g


=====
CLOSING and (not) SAVING
=====

:w
	write current buffer to file (effectively SAVE)
:wa
	write all buffers (save all files)
:wq
	write and quit


:up
	update
:x
	update and quit

:w and :wq will always udate the timestamp, as they will always write the buffer out to the file
:up and :x will not update timestamp if there are no changes to write. Update will only write if there's any changes to update in the underlying file

mental checklist
- do I want to write the file? (w) 
- do I want to quit the file? (q) 
- do I want to quit ALL the files? (a) 
- do I want to write/abandon any changes? (!) 


ZZ	Write current file, if modified, and exit. (same as :x)
ZQ	Quit current file and exit (same as ":q!").



=====
JOINING/SPLITTING LINES
=====

gJ
    to join

splitting done by replacing a character - e.g. a space - with Enter - i.e. r<Enter>
if no character to replace, just enter insert mode and press Enter
    or
yank a blank line and paste as many times as required, e.g. 2p

join multiple lines by selecting them in visual mode, V, then press J
join all lines by pressing:
    ggVGJ
        gg - first line
        V - visual line select
        G - last line
        J - join


=====
BUFFERS
=====

:new
:edit
    reload current buffer from underlying file (if edited outside vim)
:edit <file>
    opens a file in vim
:ls
	list all open buffers
:bd
    buffer delete (effectively close the current file)


=====
VARIOUS
=====
insert new line with o or O but this will leave you in insert mode
dd to delete a line
d$ to delete from current cursor position to the end of line
2dd to delete 2 lines

sort all lines in the buffer like so:
    :sort
sort in reverse order like so:
    :sort!
Sort a range of lines by selecting them (Shift+V to visual line selection mode). This will automatically insert '<, '> into the command line (on pressing `:`).  This translates as "range from start of visual selection to end of visual selection" and you do not need to clear the command line before typing the sort command.
You can also manually specify the range. One way can be to drop a mark at the start (e.g. `ma` drops the a-mark) - then move to the last line of the text-to-be-sorted, then sort the range from the placed mark to the current line like so:
    :'a,.sort
    range from reference to mark a ('a) to (,) current line (.)

You can also sort and REMOVE DUPLICATE LINES
    :sort u
or use numeric sort
    :sort n


:find some-file
    open a file by seraching for it
:read some-file
    include verbatim copy of a file in the edited file
C-x C-f
    in insert mode - fill in a name of a file/directory
C-x C-l
    in insert mode - insert an entire line that is somewhere in the current file

\html
    new snippet thing that is based on remapping the key sequence \html to a command that reads a snippet into current file

creating snippets
    create a keymapping like this and a file to load (snippet):
        
        nnoremap \html :-1read ~/.vim_runtime/snippets/index.html<CR>5jWvitc



===================
REGULAR EXPRESSIONS
===================

The syntax for regexes is weird and different in the world of Vim

\< and \> mark word boundaries

quantifiers:
    * (star) quantifier does not need escaping BUT:
    + (plus) quantifier however DOES need escaping like so \+
    ? is not recognized, use \= instead
    the OPEN curly bracket in quantifiers needs to be escaped, otherwise this works as usual: \{5} \{,3} \{2,} \{2,3}
    round brackets also require escaping, however! note BOTH \( AND \) need to be escaped, not just the open one.



====
MISC
====

Ctrl+a
	increment number under cursor
Ctrl+x
	decrement number under cursor

Ctrl+n
	while typing this will show a list of suggestions for word completion

gx
    this will open the URL currently under cursor in the default browser

Ex mode: switch to Ex mode by typing Q
Commands entered in the Ex mode do not cause the screen to re-draw. One must type "visual" in the ex mode to exit to normal mode, this causes vim to re-draw (one gets "visual" feedback of) the changes on screen.



=======
PLUGINS
=======

visincr.vba - visual-mode increment numbers vimball
    make column selection, then type

    :II

    this will create a sequence (starting from number in first line of selection) that is 0-padded to 2 digits

    :I will create a number range that isn't padded
    :I 2 will create a number range in steps of two


=============================
CONFIGURATION AND KEY MAPPING
=============================

`:map` and `:noremap ` are **recursive** and **non-recursive** versions of the various mapping commands. What that means is that if you do:

```
:map j gg
:map Q j
:noremap W j
```

`j` will be mapped to `gg`. `Q` will also be mapped to `gg`, because `j` will be expanded for the recursive mapping. `W` will be mapped to `j` (and not to `gg`) because `j` will not be expanded for the non-recursive mapping.

For each of these sets of mappings, there is a mapping that works in *normal*, *visual*, *select* and *operator* modes (`:map` and `:noremap`), one that works in normal mode (`:nmap` and `:nnoremap`), one in visual mode (`:vmap` and `:vnoremap`) and so on.



=====
LINKS TO INTERESTING PAGES
=====
using the g command for global pattern matching
	http://vim.wikia.com/wiki/Power_of_g
using vim buffers
	http://vim.wikia.com/wiki/Vim_buffer_FAQ
very nice collection of tips
	https://www.cs.swarthmore.edu/help/vim/home.html
multiline editing
    http://stackoverflow.com/a/11790464/81520
visual mode selecting xml tags
    http://stackoverflow.com/a/10881471/81520


{'fraction_non_alphanumeric': 0.07529018090557356, 'fraction_numerical': 0.004391927219491791, 'mean_word_length': 3.3949142156862746, 'pattern_counts': {'":': 2, '<': 21, '<?xml version=': 0, '>': 29, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1097974', 'n_tokens_mistral': 8613, 'n_tokens_neox': 8070, 'n_words': 4516}