mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 18:47:58 +01:00
Make abbreviations expand on quotes as well as space.
Also added rough documentation for insert mode. TODO: Abbreviations should also expand on <CR> and <Tab>, but right now adding <CR> to the mappings.add() has no effect, and adding <Tab> to the mappings.add() breaks tab completion. TODO: Rather than listing non-keyword characters in two places (ui.js and mappings.js), they should be specified in one location (that could someday be trumped by an 'iskeyword' option).
This commit is contained in:
@@ -878,8 +878,15 @@ function CommandLine() //{{{
|
||||
["<C-c>"], "Focus content",
|
||||
function () { events.onEscape(); });
|
||||
|
||||
// Any "non-keyword" character triggers abbreviation expansion
|
||||
// TODO: Add "<CR>" and "<Tab>" to this list
|
||||
// At the moment, adding "<Tab>" breaks tab completion. Adding
|
||||
// "<CR>" has no effect.
|
||||
// TODO: Make non-keyword recognition smarter so that there need not
|
||||
// be two lists of the same characters (one here and a regexp in
|
||||
// mappings.js)
|
||||
mappings.add(myModes,
|
||||
["<Space>"], "Expand command line abbreviation",
|
||||
["<Space>", '"', "'"], "Expand command line abbreviation",
|
||||
function ()
|
||||
{
|
||||
commandline.resetCompletions();
|
||||
|
||||
@@ -113,11 +113,11 @@ const config = { //{{{
|
||||
// they are sorted by relevance, not alphabetically
|
||||
helpFiles: [
|
||||
"intro.html", "tutorial.html", "starting.html", "browsing.html",
|
||||
"buffer.html", "cmdline.html", "options.html", "pattern.html",
|
||||
"tabs.html", "hints.html", "map.html", "eval.html", "marks.html",
|
||||
"repeat.html", "autocommands.html", "print.html", "gui.html",
|
||||
"styling.html", "message.html", "developer.html", "various.html",
|
||||
"index.html"
|
||||
"buffer.html", "cmdline.html", "insert.html", "options.html",
|
||||
"pattern.html", "tabs.html", "hints.html", "map.html", "eval.html",
|
||||
"marks.html", "repeat.html", "autocommands.html", "print.html",
|
||||
"gui.html", "styling.html", "message.html", "developer.html",
|
||||
"various.html", "index.html"
|
||||
],
|
||||
|
||||
scripts: [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
HEADER
|
||||
|
||||
|Command-line-mode| |Command-line| +
|
||||
|Command-line-mode| |Command-line| |mode-cmdline| +
|
||||
|
||||
Command-line mode is used to enter Ex commands (":") and text search patterns
|
||||
("/" and "?").
|
||||
|
||||
@@ -4,6 +4,11 @@ HEADER
|
||||
|
||||
This file contains a list of all available commands.
|
||||
|
||||
section:Insert{nbsp}mode[insert-index]
|
||||
|
||||
||<C-i>|| Launch the external editor +
|
||||
||<C-]>|| Expand an insert-mode abbreviation +
|
||||
|
||||
section:Normal{nbsp}mode[normal-index]
|
||||
|
||||
||<C-^>|| Select the alternate tab or the [count]th tab +
|
||||
|
||||
30
vimperator/locale/en-US/insert.txt
Normal file
30
vimperator/locale/en-US/insert.txt
Normal file
@@ -0,0 +1,30 @@
|
||||
HEADER
|
||||
|
||||
|Insert-mode| |Insert| |mode-insert| +
|
||||
|
||||
Insert mode is used to enter text in text boxes and text areas. When
|
||||
'insertmode' is set, focusing on a text area immediately switches to
|
||||
insert mode.
|
||||
|
||||
|i| +
|
||||
||i||
|
||||
________________________________________________________________________________
|
||||
Starts insert mode in text areas when 'insertmode' is not set.
|
||||
________________________________________________________________________________
|
||||
|
||||
|
||||
section:Insert-mode{nbsp}special{nbsp}keys[ins-special-keys]
|
||||
|
||||
|i_<C-i>| +
|
||||
||<C-i>||
|
||||
________________________________________________________________________________
|
||||
Launch the external editor. See the 'editor' option.
|
||||
________________________________________________________________________________
|
||||
|
||||
|i_<C-]>| +
|
||||
||<C-]>||
|
||||
________________________________________________________________________________
|
||||
Expand an insert-mode abbreviation.
|
||||
________________________________________________________________________________
|
||||
|
||||
// vim: set filetype=asciidoc:
|
||||
@@ -189,9 +189,9 @@ contains any non-whitespace character (e.g., "def'").
|
||||
|
||||
Strings that cannot be abbreviations include "a'b" and "a b".
|
||||
|
||||
An abbreviation is recognized when a space is typed after the
|
||||
abbreviation. There are no default abbreviations, and abbreviations are
|
||||
never recursive.
|
||||
An abbreviation is recognized when a space, quote character, or
|
||||
[m]<C-]>[m] is typed after the abbreviation. There are no default
|
||||
abbreviations, and abbreviations are never recursive.
|
||||
|
||||
|:ab| |:abbreviate|
|
||||
||:ab[breviate] {lhs} {rhs}|| +
|
||||
@@ -199,8 +199,8 @@ never recursive.
|
||||
||:ab[breviate]||
|
||||
________________________________________________________________________________
|
||||
Abbreviate a key sequence. Abbreviate {lhs} to {rhs}. If only {lhs} is given,
|
||||
list all abbreviations that start with {lhs}. List all abbreviations, if no
|
||||
arguments are given.
|
||||
list all abbreviations that start with {lhs}. If no arguments are given,
|
||||
list all abbreviations.
|
||||
________________________________________________________________________________
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user