diff --git a/Makefile b/Makefile
index fbaa8e6a..8089e761 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ ZIP = zip
# find the vimperator chrome dir
FIREFOX_DEFAULT = $(wildcard ${HOME}/.mozilla/firefox/*.default)
-VIMPERATOR_CHROME = $(wildcard ${FIREFOX_DEFAULT}/extensions/{f9570b26-e246-4753-9b68-61aa95994237}/chrome/)
+VIMPERATOR_CHROME = $(wildcard ${FIREFOX_DEFAULT}/extensions/vimperator@mozdev.org/chrome/)
# specify V=1 on make line to see more verbose output
Q=$(if ${V},,@)
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index 951cea60..eeebdb1e 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -30,187 +30,201 @@ the terms of any one of the MPL, the GPL or the LGPL.
* format:
* [
* 0: [all names of this command],
- * 1: description,
+ * 1: usage,
* 2: helptext
- * 3: function (arguments in this order: args, special, count)
+ * 3: function (arguments in this order: args, special, count, modifiers)
* 4: completefunc
* ]
*/
var g_commands = [/*{{{*/
[
["addons"],
- "Show available Browser Extensions and Themes",
- "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI.",
+ ["addons"],
+ "Show available Browser Extensions and Themes
" +
+ "You can add/remove/disable browser extensions from this dialog.
Be aware that not all Firefox extensions work, because Vimperator overrides some keybindings and changes Firefox's GUI.",
function() { openURLsInNewTab("chrome://mozapps/content/extensions/extensions.xul", true); },
null
],
[
["back", "ba"],
- "Go back in the browser history",
- "Count is supported, :3back goes back 3 pages in the browser history.
"+
+ ["{count}ba[ck][!]"],
+ "Go back in the browser history
" +
+ "Count is supported, :3back goes back 3 pages in the browser history.
"+
"The special version :back! goes to the beginning of the browser history.",
function(args, special, count) { if(special) historyGoToBeginning(); else stepInHistory(count > 0 ? -1 * count : -1); },
null
],
[
["bdelete", "bd", "bwipeout", "bw", "bunload", "bun", "tabclose", "tabc"],
- "Delete current buffer (=tab)",
- "Count WILL be supported in future releases, then :2bd removes two tabs and the one the right is selected.
Do :bdelete! to select the tab to the left after removing the current tab.",
+ ["{count}bd[elete][!]"],
+ "Delete current buffer (=tab)
"+
+ "Count WILL be supported in future releases, then :2bd removes two tabs and the one the right is selected.
Do :bdelete! to select the tab to the left after removing the current tab.",
function (args, special, count) { tab_remove (count, special, 0); },
null
],
[
+ ["beep"],
["beep"],
"Play a system beep",
- null,
beep,
null
],
[
["bmadd"],
- "Add a bookmark",
- "Usage: :bmadd [-t \"my custom title\"] [-T \"comma,separated,tags\"] [url]
" +
- "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.
"+
- "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.
" +
+ ["bmadd [-t \"my custom title\"] [-T \"comma,separated,tags\"] [url]"],
+ "Add a bookmark
" +
+ "If you don't add a custom title, either the title of the webpage or the URL will be taken as the title.
" +
+ "Tags WILL be some mechanism to classify bookmarks. Assume, you tag a url with the tags \"linux\" and \"computer\" you'll be able to search for bookmarks containing these tags.
" +
"You can omit the optional [url] field, so just do :bmadd to bookmark the currently loaded web page with a default title and without any tags.",
bmadd,
null
],
[
["bmdel"],
- "Delete a bookmark",
- "Usage: :bmdel [-T \"comma,separated,tags\"] <url>
" +
+ ["bmdel [-T \"comma,separated,tags\"] {url}"],
+ "Delete a bookmark
"+
"Deletes all bookmarks which matches the url AND the specified tags. Use <Tab> key on a regular expression to complete the url which you want to delete.",
bmdel,
function(filter) { return get_bookmark_completions(filter); }
],
[
["bookmarks", "bm"],
- "Show bookmarks",
- "Usage: :bm [-T \"comma,separated,tags\"] <regexp>
" +
- "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.
" +
+ ["bm[!] [-T \"comma,separated,tags\"] {regexp}"],
+ "Show bookmarks
" +
+ "Open the preview window at the bottom of the screen for all bookmarks which match the regexp either in the title or URL.
" +
"Close this window with :pclose or open entries with double click in the current tab or middle click in a new tab.",
bmshow,
function(filter) { return get_bookmark_completions(filter); }
],
- [
+ [
["buffer", "b"],
+ ["b[uffer]"],
"Go to buffer number n. Full completion works.",
- null,
function (args) { tab_go(args.split(":")[0]); },
function (filter) {return get_buffer_completions(filter);}
],
[
["buffers", "files", "ls"],
+ ["buffers"],
"Shows a list of all buffers.",
- null,
function (args) {bufshow("", false);},
null
],
[
["downloads", "dl"],
- "Show progress of current downloads",
- "Open the original Firefox download dialog in a new tab.
" +
+ ["downloads"],
+ "Show progress of current downloads
" +
+ "Open the original Firefox download dialog in a new tab.
" +
"Here, downloads can be paused, canceled and resumed.",
function() { openURLsInNewTab("chrome://mozapps/content/downloads/downloads.xul", true); },
null
],
[
["echo", "ec"],
- "Display a string at the bottom of the window",
- "Echo all arguments of this command. Useful for showing informational messages.
Multiple lines WILL be seperated by \\n.",
+ ["ec[ho]"],
+ "Display a string at the bottom of the window
" +
+ "Echo all arguments of this command. Useful for showing informational messages.
Multiple lines WILL be seperated by \\n.",
echo,
null
],
[
["echoerr", "echoe"],
- "Display an error string at the bottom of the window",
- "Echo all arguments of this command highlighted in red. Useful for showing important messages.
Multiple lines WILL be seperated by \\n.",
+ ["echoe[rr]"],
+ "Display an error string at the bottom of the window
",
+ "Echo all arguments of this command highlighted in red. Useful for showing important messages.
Multiple lines WILL be seperated by \\n.",
echoerr,
null
],
[
["execute", "exe"],
- "Executes a string as an Ex command",
- "Usage: :execute {expr1} [ ... ]
" +
- "Executes the string that results from the evaluation of {expr1} as an Ex command.
"+
- ":execute "echo test" would show a message with the text "test".
",
+ ["exe[cute] {expr1} [ ... ]"],
+ "Executes the string that results from the evaluation of {expr1} as an Ex command.
"+
+ ":execute "echo test" would show a message with the text "test".
",
execute,
null
],
[
["forward", "fw"],
- "Go forward in the browser history",
- "Count is supported, :3forward goes forward 3 pages in the browser history.
"+
- "The special version :back! goes to the beginning of the browser history.",
+ ["{count}forward[!]"],
+ "Go forward in the browser history
" +
+ "Count is supported, :3forward goes forward 3 pages in the browser history.
"+
+ "The special version :forward! goes to the end of the browser history.",
function(args, special, count) { if(special) historyGoToEnd(); else stepInHistory(count > 0 ? count : 1); },
null
],
[
["hardcopy", "ha"],
- "Print current document",
+ ["ha[rdcopy]"],
+ "Print current document
" +
"Open a GUI dialog where you can select the printer, number of copies, orientation, etc.",
function() { goDoCommand('cmd_print'); },
null
],
[
["help", "h"],
- "Open help window",
- "Open the help window in the current tab. You WILL be able to show a specific section with :help commands.",
+ ["h[elp] {subject}"],
+ "Open the help window in the current tab. It can jump to the specified {subject} with :help {subject}.",
help,
function(filter) { return get_help_completions(filter); }
],
[
["history", "hs"],
- "Show recently visited URLs",
- "Usage: :hs <regexp>
" +
- "Open the preview window at the bottom of the screen for all history items which match the regexp either in the title or URL.
" +
+ ["hs {regexp}"],
+ "Show recently visited URLs
" +
+ "Open the preview window at the bottom of the screen for all history items which match the regexp either in the title or URL.
" +
"Close this window with :pclose or open entries with double click in the current tab or middle click in a new tab.",
hsshow,
function(filter) { return get_history_completions(filter); }
],
[
["javascript", "js"],
- "Run any javascript command through eval()",
- "Acts as a javascript interpreter by passing the argument to eval().
" +
- ":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" +
- ":javascript <<EOF would read all the lines until a line starting with 'EOF' is found, and will eval() them.
" +
+ ["javascript {cmd}", "javascript <<{endpattern}
{script}
{endpattern}"],
+ "Run any javascript command through eval()
" +
+ "Acts as a javascript interpreter by passing the argument to eval().
" +
+ ":javascript alert('Hello world') would show a dialog box with the text \"Hello world\".
" +
+ ":javascript <<EOF would read all the lines until a line starting with 'EOF' is found, and will eval() them.
" +
"The special version :javascript! will open the javascript console of Firefox.",
function(args, special) {
if (special) // open javascript console
openURLsInNewTab("chrome://global/content/console.xul", true);
else
- eval(args);
+ try {
+ eval(args);
+ } catch(e) {
+ echoerr(e.name + ": " + e.message);
+ }
},
null
],
[
- ["mark"],
- "Mark current location within the webpage",
+ ["mark", "ma"],
+ ["ma[rk] {arg}"],
+ "Mark current location within the webpage
" +
"Not implemented yet",
- function (args) { set_location_mark(args); },
+ set_location_mark,
null
],
[
["marks"],
- "Show all location marks of current webpage",
+ ["marks {arg}"],
+ "Show all location marks of current webpage
" +
"Not implemented yet",
- function (args) { set_location_mark(args); },
+ set_location_mark,
null
],
[
- ["open", "o", "op", "edit", "e"],
- "Open one ore more URLs",
- "Usage: :open <url> [| <url>]
" +
- "Opens one ore more URLs in the current buffer.
"+
- "Multiple URLs can be separated with the | character.
" +
- "Each |-separated token is analazed and in this order:
"+
+ ["edit", "e", "open", "op", "o"],
+ ["edit [url] [| [url]]"],
+ "Open one ore more URLs
" +
+ "Opens one ore more URLs in the current buffer.
"+
+ "Multiple URLs can be separated with the | character.
" +
+ "Each |-separated token is analazed and in this order:
"+
"
:open wiki linus torvalds will open the wikipedia entry for linux torvalds).:open linus torvalds will open a google search for linux torvalds).:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).:open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<Tab> are specified in the 'complete' option.:open [-T \"linux\"] torvalds<Tab> to complete bookmarks with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<Tab> are specified in the 'complete' option.:set!, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using :set!",
openPreferences,
null
],
[
["quit", "q"],
- "Quit current tab or quit Vimperator if this was the last tab",
+ ["q[uit]"],
+ "Quit current tab or quit Vimperator if this was the last tab:set option and :set nooption.:set without an argument opens about:config in a new tab to change advanced Firefox options.:set! opens the GUI preference panel from Firefox in a new tab.:set option? or :set option shows the current value of the option.:set option+=foo and :set option-=foo WILL add/remove foo from list options.:set option and :set nooption.:set without an argument opens about:config in a new tab to change advanced Firefox options.:set! opens the GUI preference panel from Firefox in a new tab.:set option? or :set option shows the current value of the option.:set option+=foo and :set option-=foo WILL add/remove foo from list options.:tab help tab Opens the help in a new tab.",
+ tab,
+ null,
+ ],
+ [
+ ["tabnext", "tabn", "tn", "tnext"],
+ ["tabn[ext]"],
+ "Switch to the next tab:open but open URLs in a new tab. If used with !, the 'tabopen' value of the 'activate' setting is negated.",
function (args, special) { if (args.length > 0) openURLsInNewTab(args, !special); else openURLsInNewTab("about:blank", true); },
function (filter) { return get_url_completions(filter); }
],
[
["tabprevious", "tp", "tprev", "tprevious"],
- "Switch to the previous tab",
+ ["tabp[revious]"],
+ "Switch to the previous tab:zoom 150 zooms to 150% text size.2d removes two tabs and the one the right is selected.",
function(count) { tab_remove(count, false, 0); }
],
[
["D"],
- "Delete current buffer (=tab)",
+ ["{count}D"],
+ "Delete current buffer (=tab)2D removes two tabs and the one the left is selected.",
function(count) { tab_remove(count, true, 0); }
],
[
["ge"],
- "Execute a JavaScript code",
- "Go Execute works like :execute.Go Execute works like :execute.P, but inverts the 'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), false); }
],
[
["gt", "3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count : 0); }
],
[
["gT", "3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count :-1); }
],
[
["o"],
- "Open one or more URLs in the current tab",
+ ["o"],
+ "Open one or more URLs in the current tab:open for more details",
function(count) { openVimperatorBar('open '); }
],
[
["O"],
- "Open one ore more URLs in the current tab, based on current location",
+ ["O"],
+ "Open one ore more URLs in the current tab, based on current locationo, but preselects current URL in the :open query.",
function(count) { openVimperatorBar('open ' + getCurrentLocation()); }
],
[
["p", "p",
function(count) { openURLs(readFromClipboard()); }
],
[
["P"],
- "Open (put) an URL based on the current Clipboard contents in a new buffer",
- "Works like p, but opens a new tab.p, but opens a new tab.'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), true); }
],
[
["r"],
- "Reload current page",
+ ["r"],
"Forces reloading of the current page.",
function(count) { reload(false); }
],
[
["R"],
- "Reload all pages",
+ ["R"],
"Forces reloading of all open pages.",
function(count) { reload(true); }
],
[
["t"],
- "Open one or more URLs in a new tab",
+ ["t"],
+ "Open one or more URLs in a new tabo but open URLs in a new tab."+
"See :tabopen for more details",
function(count) { openVimperatorBar('tabopen '); }
],
[
["T"],
- "Open one ore more URLs in a new tab, based on current location",
+ ["T"],
+ "Open one ore more URLs in a new tab, based on current locationt, but preselects current URL in the :tabopen query.",
function(count) { openVimperatorBar('tabopen ' + getCurrentLocation()); }
],
[
["u"],
- "Undo closing of a tab",
+ ["{count}u"],
+ "Undo closing of a tab150zz zooms to 150% text size.:qall.",
function(count) { quit(false); }
],
[
["ZZ"],
- "Save the session and quit",
- "Quit Vimperator, no matter how many tabs/windows are open. The session is stored.:xall.",
function(count) { quit(true); }
],
@@ -573,65 +630,72 @@ var g_mappings = [/*{{{*/
/* scrolling commands */
[
["0", "^"],
- "Scroll to the absolute left of the document",
+ ["0", "^"],
+ "Scroll to the absolute left of the document0 and ^ work exactly the same way.",
function(count) { scrollBufferAbsolute(0, -1); }
],
[
+ ["$"],
["$"],
"Scroll to the absolute right of the document",
- null,
function(count) { scrollBufferAbsolute(100, -1); }
],
[
["gg", "35gg vertically goes to 35% of the document",
function(count) { scrollBufferAbsolute(-1, count > 0 ? count : 0); }
],
[
["G", "35G vertically goes to 35% of the document",
function(count) { scrollBufferAbsolute(-1, count >= 0 ? count : 100); }
],
[
["h", "10h will move 10 times as much to the left.10h will move 10 times as much to the left.'beep' is turned off).",
function(count) { scrollBufferRelative(-1, 0); }
],
[
["j", "10j will move 10 times as much down.10j will move 10 times as much down.'beep' is turned off).",
function(count) { scrollBufferRelative(0, 1); }
],
[
["k", "10k will move 10 times as much up.10k will move 10 times as much up.'beep' is turned off).",
function(count) { scrollBufferRelative(0, -1); }
],
[
["l", "10l will move 10 times as much to the right.10l will move 10 times as much to the right.'beep' is turned off).",
function(count) { scrollBufferRelative(1, 0); }
],
[
["3H goes back 3 steps.",
function(count) { stepInHistory(count > 0 ? -1 * count : -1); }
],
[
["L", "3L goes forward 3 steps.",
function(count) { stepInHistory(count > 0 ? count : 1); }
],
@@ -665,28 +733,31 @@ var g_mappings = [/*{{{*/
/* hint managment */
[
["f"],
- "Start QuickHint mode",
- "In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.<Esc> to stop this mode.'hinttags' XPath query) is assigned a label.<Esc> to stop this mode.'hinttags' XPath query) is assigned a label.<Esc> to stop this mode.'hinttags' XPath query) is assigned a label.<Esc> to stop this mode.Ctrl-prefixed shortcut keys are available in this mode for navigation.",
function(count) { hah.enableHahMode(HINT_MODE_ALWAYS); }
],
[
[";"],
- "Start ExtendedHint mode",
- "ExtendedHint mode is useful, since in this mode you can yank link locations, or open them in a new window.AB, press ; to start this hint mode.AB to select the hint. Now press y to yank its location.AB, press ; to start this hint mode.AB to select the hint. Now press y to yank its location.y to yank its locationo to open its location in the current tabt to open its location in a new tabs to save its destination (not implemented yet)<C-w> to open its destination in a new window;AB,AC,ADt opens AB, AC and AD in a new tab.;AB,AC,ADt opens AB, AC and AD in a new tab.'extendedhinttags' XPath string.",
function(count) { hah.enableHahMode(HINT_MODE_EXTENDED); }
],
@@ -703,14 +774,16 @@ var g_mappings = [/*{{{*/
/* search managment */
[
["n"],
- "Find next",
+ ["n"],
+ "Find next:help <F1> (jumping to a specific section not implemented yet).",
function(count) { help(null); }
],
[
[":"],
- "Start command line mode",
+ [":"],
+ "Start command line mode<Esc> are passed to the next event handler.<Esc> are passed to the next event handler.<Esc>. If you also need to pass <Esc>"+
"in this mode to the webpage, prepend it with <C-v>.",
function(count) { addMode(MODE_ESCAPE_ALL_KEYS);}
],
[
["<C-v>.<C-o> which are otherwise hidden in Vimperator.<C-v>.<C-o> which are otherwise hidden in Vimperator.<I>), <C-v> will pass the next key to Vimperator instead of the webpage.",
function(count) { addMode(MODE_ESCAPE_ONE_KEY); }
],
[
["" +beg+ cmd_name +end+ '" +beg+ cmd_name +end+ '" +beg+ cmd_name +end+ '';
}
- ret += command + '" +beg+ usage +end+ ':pclose.",
function(value) { set_pref("previewheight", value); },
function() { return get_pref("previewheight"); },
@@ -175,9 +181,9 @@ var g_settings = [/*{{{*/
null
],
[
+ ["showmode", "smd"],
["showmode", "smd"],
"Show the current mode in the command line",
- null,
function(value) { set_pref("showmode", value); },
function() { return get_pref("showmode"); },
"boolean",
@@ -187,7 +193,8 @@ var g_settings = [/*{{{*/
],
[
["showtabline", "stal"],
- "Control when to show the tab bar of opened web pages",
+ ["showtabline", "stal"],
+ "Control when to show the tab bar of opened web pages
" +
"Available items:
"+
"- 0: Never show tab bar
- "+
" 1: Show tab bar only if more than one tab is open
- "+
@@ -202,7 +209,8 @@ var g_settings = [/*{{{*/
],
[
["usermode", "um"],
- "Show current website with a minimal stylesheet to make it easily accessible",
+ ["usermode", "um"],
+ "Show current website with a minimal stylesheet to make it easily accessible
" +
"Note that this is a local setting for now, later it may be split into a global and :setlocal part",
function(value) { opt_usermode = value; setStyleDisabled(value); },
function() { return opt_usermode; },
@@ -213,12 +221,13 @@ var g_settings = [/*{{{*/
],
[
["wildmode", "wim"],
- "Define how command line completion works",
+ ["wildmode", "wim"],
+ "Define how command line completion works
" +
"Not implemented yet.",
function(value) { set_pref("wildmode", value); },
function() { return get_pref("wildmode"); },
"stringlist",
- "menu",
+ "full",
null,
null
]
diff --git a/chrome/content/vimperator/vimperator.js b/chrome/content/vimperator/vimperator.js
index fb545868..89348b98 100644
--- a/chrome/content/vimperator/vimperator.js
+++ b/chrome/content/vimperator/vimperator.js
@@ -537,7 +537,13 @@ function onCommandBarKeypress(evt)/*{{{*/
// unfocus command line first
add_to_command_history(command);
- [prev_match, heredoc, end] = multiliner(command, prev_match, heredoc);
+ try {
+ [prev_match, heredoc, end] = multiliner(command, prev_match, heredoc);
+ } catch(e) {
+ echoerr(e.name + ": " + e.message);
+ prev_match = new Array(5);
+ heredoc = '';
+ }
if (!end)
command_line.value = "";
}
diff --git a/install.rdf b/install.rdf
index e4ec614d..e36fb970 100644
--- a/install.rdf
+++ b/install.rdf
@@ -2,26 +2,26 @@
-
- {f9570b26-e246-4753-9b68-61aa95994237}
- Vimperator
- 0.3
- Make Firefox work like Vim
- Martin Stubenschrott
- http://vimperator.mozdev.org
- http://downloads.mozdev.org/vimperator/update.rdf
-
-
- content/vimperator/
-
-
+
+ vimperator@mozdev.org
+ Vimperator
+ 0.3
+ Make Firefox work like Vim
+ Martin Stubenschrott
+ http://vimperator.mozdev.org
+ http://downloads.mozdev.org/vimperator/update.rdf
+
+
+ content/vimperator/
+
+
-
-
- {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
- 2.0
- 3.0
-
-
-
+
+
+ {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
+ 2.0
+ 3.0
+
+
+