Note that his script will load the relevant key mappings, via an autocommand, only when a file ending with *.txt is being edited. The Vim cuteness here consists of:
* getchar – wait for a single keypress, return the numeric key code. One side effect of this function is that pressing Esc will always produce a brief delay, since the function sees Esc as a modifier. To skip this delay, you can perhaps modify the script slightly to also accept, say, "@" as cancel.
* Ctrl-R= - In insert mode, pressing Ctr-R and then = allows one to execute a function, insert the result, and then return to insert mode. This trick is used to return to insert mode. An alternative would be to use "startinsert", but one nice effect of the Ctrl-R method is that abbreviations (eg, "ab im I'm") still work! (Vim r
Attributes | Values |
---|
rdfs:label
| - Autocapitalize the start of every sentence
|
rdfs:comment
| - Note that his script will load the relevant key mappings, via an autocommand, only when a file ending with *.txt is being edited. The Vim cuteness here consists of:
* getchar – wait for a single keypress, return the numeric key code. One side effect of this function is that pressing Esc will always produce a brief delay, since the function sees Esc as a modifier. To skip this delay, you can perhaps modify the script slightly to also accept, say, "@" as cancel.
* Ctrl-R= - In insert mode, pressing Ctr-R and then = allows one to execute a function, insert the result, and then return to insert mode. This trick is used to return to insert mode. An alternative would be to use "startinsert", but one nice effect of the Ctrl-R method is that abbreviations (eg, "ab im I'm") still work! (Vim r
|
Version
| |
dbkwik:vim/property/wikiPageUsesTemplate
| |
Previous
| |
Subpage
| |
Complexity
| |
Created
| |
ID
| |
NEXT
| |
abstract
| - Note that his script will load the relevant key mappings, via an autocommand, only when a file ending with *.txt is being edited. The Vim cuteness here consists of:
* getchar – wait for a single keypress, return the numeric key code. One side effect of this function is that pressing Esc will always produce a brief delay, since the function sees Esc as a modifier. To skip this delay, you can perhaps modify the script slightly to also accept, say, "@" as cancel.
* Ctrl-R= - In insert mode, pressing Ctr-R and then = allows one to execute a function, insert the result, and then return to insert mode. This trick is used to return to insert mode. An alternative would be to use "startinsert", but one nice effect of the Ctrl-R method is that abbreviations (eg, "ab im I'm") still work! (Vim regards using a normal command and then starting insert as an interruption and won't trigger abbreviations. However, using Ctrl-R to call a function that executes normal commands is an odd loophole.)
* "/<del>"</del> - It is possible using Ctrl-R to "insert" a delete command. One way this is helpful is that one can avoid various end-of-line complications by inserting this buffer character, "_".
|