diff --git a/ChangeLog b/ChangeLog index ffe50d49..ea9489b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@
date:
* version 0.4
+ * support for 'wildmode' completion setting
+ * changed regexp search to normal text search for completion -> massive speedup, but limited functionality
+ * support for :open ./ , :open .. and :open ... (patch from Lee Hinman)
* Esc now doesn't stop loading the webpage, use Ctrl-c instead, :stop command added
* changed hinttags to work with dict.leo.org and hintstyle to work with digg.com
* :back! goes to beginning of history now
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index e49a78a4..83aa1ec2 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -26,21 +26,30 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
+const COMMANDS = 0;
+const USAGE = 1;
+const SHORTHELP = 2;
+const HELP = 3;
+const FUNCTION = 4;
+const COMPLETEFUNC = 5;
+
+
/* all built-in :ex-commands of Vimperator
* format:
* [
* 0: [all names of this command],
* 1: usage,
- * 2: helptext
- * 3: function (arguments in this order: args, special, count, modifiers)
- * 4: completefunc
+ * 2: short help
+ * 3: helptext
+ * 4: function (arguments in this order: args, special, count, modifiers)
+ * 5: completefunc
* ]
*/
var g_commands = [/*{{{*/
[
["addons"],
["addons"],
- "Show available Browser Extensions and Themes
" +
+ "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
@@ -48,7 +57,7 @@ var g_commands = [/*{{{*/
[
["back", "ba"],
["{count}ba[ck][!]"],
- "Go back in the browser history
" +
+ "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); },
@@ -57,7 +66,7 @@ var g_commands = [/*{{{*/
[
["bdelete", "bd", "bwipeout", "bw", "bunload", "bun", "tabclose", "tabc"],
["{count}bd[elete][!]"],
- "Delete current buffer (=tab)
"+
+ "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
@@ -66,13 +75,14 @@ var g_commands = [/*{{{*/
["beep"],
["beep"],
"Play a system beep",
+ null,
beep,
null
],
[
["bmadd"],
["bmadd [-tT] [url]"],
- "Add a bookmark
" +
+ "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.
" +
@@ -85,7 +95,7 @@ var g_commands = [/*{{{*/
[
["bmdel"],
["bmdel [-T] {url}"],
- "Delete a bookmark
"+
+ "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.
" +
"The following options WILL be interpretted in the future:
" +
" -T comma,separated,tag,list
",
@@ -95,7 +105,7 @@ var g_commands = [/*{{{*/
[
["bookmarks", "bm"],
["bm[!] [-T] {regexp}"],
- "Show bookmarks
" +
+ "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.
" +
"The following options WILL be interpretted in the future:
" +
@@ -105,23 +115,25 @@ var g_commands = [/*{{{*/
],
[
["buffer", "b"],
- ["b[uffer]"],
- "Go to buffer number n. Full completion works.",
+ ["b[uffer] {url|index}"],
+ "Go to buffer from buffer list",
+ "Argument can be either the buffer index or the full URL.",
buffer_switch,
function (filter) {return get_buffer_completions(filter);}
],
[
["buffers", "files", "ls"],
["buffers"],
- "Shows a list of all buffers.
If the list is already shown, close the preview window.",
+ "Shows a list of all buffers",
+ "If the list is already shown, close the preview window.",
buffer_preview_toggle,
null
],
[
["downloads", "dl"],
["downloads"],
- "Show progress of current downloads
" +
- "Open the original Firefox download dialog in a new tab.
" +
+ "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
@@ -129,7 +141,7 @@ var g_commands = [/*{{{*/
[
["echo", "ec"],
["ec[ho]"],
- "Display a string at the bottom of the window
" +
+ "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
@@ -137,7 +149,7 @@ var g_commands = [/*{{{*/
[
["echoerr", "echoe"],
["echoe[rr]"],
- "Display an error string at the bottom of the window
",
+ "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
@@ -145,7 +157,7 @@ var g_commands = [/*{{{*/
[
["execute", "exe"],
["exe[cute] {expr1} [ ... ]"],
- "Executes the string that results from the evaluation of {expr1} as an Ex command.
"+
+ "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
@@ -153,7 +165,7 @@ var g_commands = [/*{{{*/
[
["forward", "fw"],
["{count}forward[!]"],
- "Go forward in the browser history
" +
+ "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); },
@@ -162,23 +174,24 @@ var g_commands = [/*{{{*/
[
["hardcopy", "ha"],
["ha[rdcopy]"],
- "Print current document
" +
- "Open a GUI dialog where you can select the printer, number of copies, orientation, etc.",
+ "Print current document",
+ "NOT FUNCTIONAL YET. Open a GUI dialog where you can select the printer, number of copies, orientation, etc.",
function() { goDoCommand('cmd_print'); },
null
],
[
["help", "h"],
["h[elp] {subject}"],
- "Open the help window in the current tab. It can jump to the specified {subject} with :help {subject}.",
+ "Open the help window",
+ "You can jump to the specified {subject} with :help {subject}.",
help,
function(filter) { return get_help_completions(filter); }
],
[
["history", "hs"],
- ["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.
" +
+ ["hs {filter}"],
+ "Show recently visited URLs",
+ "Open the preview window at the bottom of the screen for all history items which match the filter string 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); }
@@ -186,7 +199,7 @@ var g_commands = [/*{{{*/
[
["javascript", "js"],
["javascript {cmd}", "javascript <<{endpattern}
{script}
{endpattern}"],
- "Run any javascript command through eval()
" +
+ "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.
" +
@@ -206,7 +219,7 @@ var g_commands = [/*{{{*/
[
["mark", "ma"],
["ma[rk] {arg}"],
- "Mark current location within the webpage
" +
+ "Mark current location within the webpage",
"Not implemented yet",
set_location_mark,
null
@@ -214,19 +227,21 @@ var g_commands = [/*{{{*/
[
["marks"],
["marks {arg}"],
- "Show all location marks of current webpage
" +
+ "Show all location marks of current webpage",
"Not implemented yet",
set_location_mark,
null
],
[
- ["edit", "e", "open", "op", "o"],
- ["edit [url] [| [url]]"],
- "Open one ore more URLs
" +
- "Opens one ore more URLs in the current buffer.
"+
+ ["open", "op", "o", "edit", "e"],
+ ["open [url] [| [url]]"],
+ "Open one ore more URLs in the current tab",
"Multiple URLs can be separated with the | character.
" +
"Each |-separated token is analazed and in this order:
"+
"- Opened with the specified search engine if the token looks like a search string and the first word of the token is the name of a search engine (
:open wiki linus torvalds will open the wikipedia entry for linux torvalds). "+
+ " - Transformed to a relative URL of the current location if it starts with . or .. or ...;
... is special and goes to the moves up the directory hierarchy as far as possible.
"+
+ " - :open ... with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com
"+
+ " - :open ./foo.html with current location http://www.example.com/dir1/dir2/file.html will open http://www.example.com/dir1/dir2/foo.html "+
" - Opened with the default search engine if the first word is no search engine (
:open linus torvalds will open a google search for linux torvalds). "+
" - Passed directly to Firefox in all other cases (
:open www.osnews.com | www.slashdot.org will open OSNews in the current, and Slashdot in a new background tab).
"+
"You WILL be able to use :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.
"+
@@ -252,13 +267,14 @@ var g_commands = [/*{{{*/
["pclose", "pc"],
["pc[lose]"],
"Close preview window on bottom of screen",
+ null,
function() { preview_window.hidden = true; },
null
],
[
["preferences", "prefs"],
["preferences"],
- "Show Browser Preferences
" +
+ "Show Browser Preferences",
"You can change the browser preferences from this dialog.
Be aware that not all Firefox preferences work, because Vimperator overrides some keybindings and changes Firefox's GUI.
"+
"Works like :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,
@@ -275,6 +291,7 @@ var g_commands = [/*{{{*/
[
["quitall", "quita", "qall", "qa"],
["quita[ll]"],
+ "Quit Vimperator",
"Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.",
function (args) { quit(false); },
null
@@ -282,7 +299,7 @@ var g_commands = [/*{{{*/
[
["reload", "re"],
["re[load]"],
- "Reload current page
" +
+ "Reload current page",
"Forces reloading of the current page, or of all open pages, if ! is given.",
function(args, special) { reload(special); },
null
@@ -291,13 +308,14 @@ var g_commands = [/*{{{*/
["restart"],
["restart"],
"Forces the browser to restart.",
+ null,
restart,
null
],
[
["saveas", "sav"],
["sav[eas]"],
- "Save current web page to disk
" +
+ "Save current web page to disk",
"Open the original Firefox \"Save page as...\" dialog in a new tab.
" +
"There, you can save the current web page to disk with various options.",
function() { goDoCommand('Browser:SavePage'); },
@@ -306,7 +324,7 @@ var g_commands = [/*{{{*/
[
["set", "se"],
["se[t][!]", "se[t] {option}[?]", "se[t] {option}[+-]={value}"],
- "Set an option
" +
+ "Set an option",
"Permanently change an option. In contrast to Vim options are stored throughout sessions.
"+
"Boolean options must be set with :set option and :set nooption.
"+
":set without an argument opens about:config in a new tab to change advanced Firefox options.
"+
@@ -319,7 +337,7 @@ var g_commands = [/*{{{*/
[
["source", "so"],
[":so[urce][!] {file}"],
- "Read Ex commands from {file}
" +
+ "Read Ex commands from {file}",
"The .vimperatorrc file in your home directory is always sourced at start up.
"+
"~ is supported as a shortcut for the $HOME directory.
" +
"If ! is specified, errors are not printed.",
@@ -329,7 +347,7 @@ var g_commands = [/*{{{*/
[
["stop", "st"],
["st[op]"],
- "Stop loading
" +
+ "Stop loading",
"Stop loading current web page.",
BrowserStop,
null
@@ -337,31 +355,33 @@ var g_commands = [/*{{{*/
[
["tab"],
["tab {cmd}"],
- "Executes {cmd} and tells it to output in a new tab. Works for commands that support it.
" +
- "Example: :tab help tab Opens the help in a new tab.",
+ "Execute {cmd} and tell it to output in a new tab",
+ "Works for only commands that support it.",
+ "Example: :tab help tab opens the help in a new tab.",
tab,
null
],
[
["tabnext", "tabn", "tn", "tnext"],
["tabn[ext]"],
- "Switch to the next tab
" +
+ "Switch to the next tab",
"Cycles to the first tab, when the last is selected.",
function(args, special, count) { tab_go(0); },
null
],
[
- ["tabedit", "tabe", "tabnew", "tabopen", "t", "to", "topen"],
- ["tabedit [url] [| [url]]"],
- "Open one or more URLs in a new tab
" +
- "Like :open but open URLs in a new tab. If used with !, the 'tabopen' value of the 'activate' setting is negated.",
+ ["tabopen", "t", "to", "topen", "tabnew", "tabedit", "tabe"],
+ ["tabopen [url] [| [url]]"],
+ "Open one or more URLs in a new tab",
+ "Like :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"],
["tabp[revious]"],
- "Switch to the previous tab
" +
+ "Switch to the previous tab",
"Cycles to the last tab, when the first is selected.",
function(args, count) { tab_go(-1); },
null
@@ -369,23 +389,23 @@ var g_commands = [/*{{{*/
[
["undo", "u"],
["{count}undo"],
- "Undo closing of a tab
" +
+ "Undo closing of a tab",
"If a count is given, don't close the last but the n'th last tab",
function(args, special, count) { if(count < 1) count = 1; undoCloseTab(count-1); },
null
],
[
["qmarkadd", "qmadd"],
- ["qmarkadd"],
- "Mark a URL with a letter for quick access
" +
+ ["qmarkadd {a-zA-Z0-9} [url]"],
+ "Mark a URL with a letter for quick access",
"Not implemented yet",
function(args) { set_url_mark("mark", "url"); }, // FIXME
function(filter) { return [["a", ""], ["b", ""]]; }
],
[
["qmarkdel", "qmdel"],
- ["qmarkdel"],
- "Mark a URL with a letter for quick access
" +
+ ["qmarkdel {a-zA-Z0-9}"],
+ "Remove a marked URL" +
"Not implemented yet",
function(args) { set_url_mark("mark", "url"); }, // FIXME
function(filter) { return [["a", ""], ["b", ""]]; }
@@ -393,7 +413,7 @@ var g_commands = [/*{{{*/
[
["qmarks", "qms"],
["qmarks"],
- "Shows marked URLs
" +
+ "Shows marked URLs",
"Not implemented yet",
function(args) { show_url_marks(args); }, // FIXME
null
@@ -402,13 +422,14 @@ var g_commands = [/*{{{*/
["version", "ve"],
["ve[rsion]"],
"Show version information",
+ null,
function () { echo("Vimperator version: " + g_vimperator_version); },
null
],
[
- ["winedit", "wine", "winopen", "w", "wo", "wopen"],
- ["wine[dit] [url] [| [url]]"],
- "Open an URL in a new window
" +
+ ["winopen", "w", "wo", "wopen", "winedit", "wine"],
+ ["win[open] [url] [| [url]]"],
+ "Open an URL in a new window",
"Not implemented yet",
function () { echo("winopen not yet implemented"); },
null
@@ -416,7 +437,7 @@ var g_commands = [/*{{{*/
[
["xall", "xa", "wqall", "wqa", "wq"],
["wqa[ll]", "xa[ll]"],
- "Save the session and quit
" +
+ "Save the session and quit",
"Quit Vimperator, no matter how many tabs/windows are open. The session is stored.",
function (args) { quit(true); },
null
@@ -424,7 +445,7 @@ var g_commands = [/*{{{*/
[
["zoom", "zo"],
["zo[om] {value}"],
- "Set zoom value of the webpage
" +
+ "Set zoom value of the webpage",
"{value} can be between 25 and 500%. If it is omitted, zoom is reset to 100%.",
zoom_to,
null
@@ -436,15 +457,16 @@ var g_commands = [/*{{{*/
* [
* 0: [all shortcuts of this command],
* 1: usage,
- * 2: helptext
- * 3: function (arguments in this order: args, special, count)
+ * 2: shorthelp
+ * 3: helptext
+ * 4: function (arguments in this order: args, special, count)
* ]
*/
var g_mappings = [/*{{{*/
[
["]f"],
["]f"],
- "Focus next frame
" +
+ "Focus next frame",
"Flashes the next frame in order with a red color, to quickly show where keyboard focus is.
"+
"This may not work correctly for frames with lots of CSS code.",
focusNextFrame
@@ -452,7 +474,7 @@ var g_mappings = [/*{{{*/
[
["b"],
["b {number}"],
- "Open a prompt to switch buffers
" +
+ "Open a prompt to switch buffers",
"Typing the corresponding number opens switches to this buffer",
function (args) { bufshow("", true); openVimperatorBar('buffer '); }
],
@@ -460,26 +482,27 @@ var g_mappings = [/*{{{*/
["B"],
["B"],
"Toggle the buffer list with all currently opened tabs.",
+ null,
buffer_preview_toggle
],
[
["d"],
["{count}d"],
- "Delete current buffer (=tab)
" +
+ "Delete current buffer (=tab)",
"Count WILL be supported in future releases, then 2d removes two tabs and the one the right is selected.",
function(count) { tab_remove(count, false, 0); }
],
[
["D"],
["{count}D"],
- "Delete current buffer (=tab)
" +
+ "Delete current buffer (=tab)",
"Count WILL be supported in future releases, then 2D removes two tabs and the one the left is selected.",
function(count) { tab_remove(count, true, 0); }
],
[
["ge"],
["ge {cmd}"],
- "Execute an Ex command
" +
+ "Execute an Ex command",
"Go Execute works like :execute.
"+
"This mapping is for debugging purposes, and may be removed in future.",
function(count) { openVimperatorBar('execute '); }
@@ -487,28 +510,28 @@ var g_mappings = [/*{{{*/
[
["gh"],
["gh"],
- "Go home
" +
+ "Go home",
"Opens the homepage in the current tab.",
BrowserHome
],
[
["gH"],
["gH"],
- "Go home in a new tab
" +
+ "Go home in a new tab",
"Opens the homepage in a new tab.",
function(count) { openURLsInNewTab("", true); BrowserHome(); }
],
[
["gP"],
["gP"],
- "Open (put) an URL based on the current Clipboard contents in a new buffer
" +
+ "Open (put) an URL based on the current Clipboard contents in a new buffer",
"Works like P, but inverts the 'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), false); }
],
[
["gt", "", ""],
["{count}gt"],
- "Go to next tab
" +
+ "Go to next tab",
"Cycles to the first tab, when the last is selected.
"+
"Count is supported, 3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count : 0); }
@@ -516,7 +539,7 @@ var g_mappings = [/*{{{*/
[
["gT", "", ""],
["{count}gT"],
- "Go to previous tab
" +
+ "Go to previous tab",
"Cycles to the last tab, when the first is selected.
"+
"Count is supported, 3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count :-1); }
@@ -524,28 +547,28 @@ var g_mappings = [/*{{{*/
[
["o"],
["o"],
- "Open one or more URLs in the current tab
" +
+ "Open one or more URLs in the current tab",
"See :open for more details",
function(count) { openVimperatorBar('open '); }
],
[
["O"],
["O"],
- "Open one ore more URLs in the current tab, based on current location
" +
+ "Open one ore more URLs in the current tab, based on current location",
"Works like o, but preselects current URL in the :open query.",
function(count) { openVimperatorBar('open ' + getCurrentLocation()); }
],
[
["p", ""],
["p", ""],
- "Open (put) an URL based on the current Clipboard contents in the current buffer
" +
+ "Open (put) an URL based on the current Clipboard contents in the current buffer",
"You can also just select some non-URL text, and search for it with the default search engine with p",
function(count) { openURLs(readFromClipboard()); }
],
[
["P"],
["P"],
- "Open (put) an URL based on the current Clipboard contents in a new buffer
" +
+ "Open (put) an URL based on the current Clipboard contents in a new buffer",
"Works like p, but opens a new tab.
"+
"Whether the new buffer is activated, depends on the 'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), true); }
@@ -554,18 +577,20 @@ var g_mappings = [/*{{{*/
["r"],
["r"],
"Forces reloading of the current page.",
+ null,
function(count) { reload(false); }
],
[
["R"],
["R"],
"Forces reloading of all open pages.",
+ null,
function(count) { reload(true); }
],
[
["t"],
["t"],
- "Open one or more URLs in a new tab
" +
+ "Open one or more URLs in a new tab",
"Like o but open URLs in a new tab."+
"See :tabopen for more details",
function(count) { openVimperatorBar('tabopen '); }
@@ -573,70 +598,70 @@ var g_mappings = [/*{{{*/
[
["T"],
["T"],
- "Open one ore more URLs in a new tab, based on current location
" +
+ "Open one ore more URLs in a new tab, based on current location",
"Works like t, but preselects current URL in the :tabopen query.",
function(count) { openVimperatorBar('tabopen ' + getCurrentLocation()); }
],
[
["u"],
["{count}u"],
- "Undo closing of a tab
" +
+ "Undo closing of a tab",
"If a count is given, don't close the last but the n'th last tab",
function(count) { execute_command(count, 'undo', false, ''); }
],
[
["y"],
["y"],
- "Yank current location to the Clipboard
" +
+ "Yank current location to the Clipboard",
"Under UNIX the location is also put into the selection, which can be pasted with the middle mouse button.",
yankCurrentLocation
],
[
["zi", "+"],
["zi", "+"],
- "Zoom in current web page by 25%.
"+
+ "Zoom in current web page by 25%.",
"Currently no count supported.",
function(count) { zoom_in(1); }
],
[
["zI"],
["zI"],
- "Zoom in current web page by 100%.
"+
+ "Zoom in current web page by 100%.",
"Currently no count supported.",
function(count) { zoom_in(4); }
],
[
["zo", "-"],
["zo", "-"],
- "Zoom out current web page by 25%.
"+
+ "Zoom out current web page by 25%.",
"Currently no count supported.",
function(count) { zoom_in(-1); }
],
[
["zO"],
["zO"],
- "Zoom out current web page by 100%.
"+
+ "Zoom out current web page by 100%.",
"Currently no count supported.",
function(count) { zoom_in(-4); }
],
[
["zz"],
["{count}zz"],
- "Set zoom value of the webpage
" +
+ "Set zoom value of the webpage",
"Zoom value can be between 25 and 500%. If it is omitted, zoom is reset to 100%.",
zoom_to
],
[
["ZQ"],
["ZQ"],
- "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.
" +
+ "Quit Vimperator, no matter how many tabs/windows are open. The session is not stored.",
"Works like :qall.",
function(count) { quit(false); }
],
[
["ZZ"],
["ZZ"],
- "Save the session and quit
" +
+ "Save the session and quit",
"Quit Vimperator, no matter how many tabs/windows are open. The session is stored.
" +
"Works like :xall.",
function(count) { quit(true); }
@@ -646,7 +671,7 @@ var g_mappings = [/*{{{*/
[
["0", "^"],
["0", "^"],
- "Scroll to the absolute left of the document
" +
+ "Scroll to the absolute left of the document",
"Unlike in vim, 0 and ^ work exactly the same way.",
function(count) { scrollBufferAbsolute(0, -1); }
],
@@ -654,19 +679,20 @@ var g_mappings = [/*{{{*/
["$"],
["$"],
"Scroll to the absolute right of the document",
+ null,
function(count) { scrollBufferAbsolute(100, -1); }
],
[
["gg", ""],
["{count}gg", "{count}"],
- "Goto the top of the document
" +
+ "Goto the top of the document",
"Count is supported, 35gg vertically goes to 35% of the document",
function(count) { scrollBufferAbsolute(-1, count > 0 ? count : 0); }
],
[
["G", ""],
["{count}G", "{count}"],
- "Goto the end of the document
" +
+ "Goto the end of the document",
"Count is supported, 35G vertically goes to 35% of the document",
function(count) { scrollBufferAbsolute(-1, count >= 0 ? count : 100); }
],
@@ -674,14 +700,14 @@ var g_mappings = [/*{{{*/
["h", ""],
["{count}h", "{count}"],
"Scroll document to the left" +
- "Count is supported: 10h will move 10 times as much to the left.
"+
+ "Count is supported: 10h will move 10 times as much to the left.",
"If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).",
function(count) { scrollBufferRelative(-1, 0); }
],
[
["j", "", ""],
["{count}j", "{count}", "{count}"],
- "Scroll document down
" +
+ "Scroll document down",
"Count is supported: 10j will move 10 times as much down.
"+
"If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).",
function(count) { scrollBufferRelative(0, 1); }
@@ -689,7 +715,7 @@ var g_mappings = [/*{{{*/
[
["k", "", ""],
["{count}k", "{count}", "{count}"],
- "Scroll document up
" +
+ "Scroll document up",
"Count is supported: 10k will move 10 times as much up.
"+
"If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).",
function(count) { scrollBufferRelative(0, -1); }
@@ -697,21 +723,23 @@ var g_mappings = [/*{{{*/
[
["l", ""],
["{count}l", "{count}"],
- "Scroll document to the right
" +
+ "Scroll document to the right",
"Count is supported: 10l will move 10 times as much to the right.
"+
"If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).",
function(count) { scrollBufferRelative(1, 0); }
],
[
- ["", "", ""],
- ["", "", ""],
+ ["", "", "", ""],
+ ["", "", "", ""],
"Scroll up a full page of the current document. No count support for now.",
+ null,
function(count) { goDoCommand('cmd_scrollPageUp'); }
],
[
- ["", "", ""],
- ["", "", ""],
+ ["", "", "", ""],
+ ["", "", "", ""],
"Scroll down a full page of the current document. No count support for now.",
+ null,
function(count) { goDoCommand('cmd_scrollPageDown'); }
],
@@ -719,28 +747,28 @@ var g_mappings = [/*{{{*/
[
[""],
["{count}"],
- "Go to an older position in the jump list
" +
+ "Go to an older position in the jump list",
"The jump list is just the browser history for now",
function(count) { stepInHistory(count > 0 ? -1 * count : -1); }
],
[
[""],
["{count}"],
- "Go to a newer position in the jump list
" +
+ "Go to a newer position in the jump list",
"The jump list is just the browser history for now",
function(count) { stepInHistory(count > 0 ? count : 1); }
],
[
["H", "", ""],
["{count}H", "{count}", "{count}"],
- "Go back in the browser history
" +
+ "Go back in the browser history",
"Count is supported, 3H goes back 3 steps.",
function(count) { stepInHistory(count > 0 ? -1 * count : -1); }
],
[
["L", "", ""],
["{count}L", "{count}", "{count}"],
- "Go forward in the browser history
" +
+ "Go forward in the browser history",
"Count is supported, 3L goes forward 3 steps.",
function(count) { stepInHistory(count > 0 ? count : 1); }
],
@@ -749,7 +777,7 @@ var g_mappings = [/*{{{*/
[
["f"],
["f"],
- "Start QuickHint mode
" +
+ "Start QuickHint mode",
"In QuickHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+
"If you then press the keys for a label, it is followed as soon as it can be uniquely identified and this mode is stopped. Or press <Esc> to stop this mode.
"+
"If you write the hint in ALLCAPS, the hint is followed in a background tab.",
@@ -758,7 +786,7 @@ var g_mappings = [/*{{{*/
[
["F"],
["F"],
- "Start AlwaysHint mode
" +
+ "Start AlwaysHint mode",
"In AlwaysHint mode, every hintable item (according to the 'hinttags' XPath query) is assigned a label.
"+
"If you then press the keys for a label, it is followed as soon as it can be uniquely identified. Labels stay active after following a hint in this mode, press <Esc> to stop this mode.
"+
"This hint mode is especially useful for browsing large sites like Forums as hints are automatically regenerated when switching to a new document.
"+
@@ -768,7 +796,7 @@ var g_mappings = [/*{{{*/
[
[";"],
[";"],
- "Start ExtendedHint mode
" +
+ "Start ExtendedHint mode",
"ExtendedHint mode is useful, since in this mode you can yank link locations, or open them in a new window.
"+
"If you want to yank the location of hint AB, press ; to start this hint mode.
"+
"Then press AB to select the hint. Now press y to yank its location.
"+
@@ -790,7 +818,7 @@ var g_mappings = [/*{{{*/
[
["n"],
["n"],
- "Find next
" +
+ "Find next",
"Repeat the last \"/\" 1 time (until count is supported).",
// don't use a closure for this, is just DoesNotWork (TM)
function(count) { gFindBar.onFindAgainCmd(); } // this does not work, why?: goDoCommand('cmd_findAgain'); }
@@ -798,7 +826,7 @@ var g_mappings = [/*{{{*/
[
["N"],
["N"],
- "Find previous
" +
+ "Find previous",
"Repeat the last \"/\" 1 time (until count is supported) in the opposite direction.",
// don't use a closure for this, is just DoesNotWork (TM)
function(count) { gFindBar.onFindPreviousCmd(); } // this does not work, why?: goDoCommand('cmd_findPrevious'); }
@@ -808,21 +836,21 @@ var g_mappings = [/*{{{*/
[
[""],
[""],
- "Open help window
" +
+ "Open help window",
"The default section is shown, if you need help for a specific topic, try :help <F1> (jumping to a specific section not implemented yet).",
function(count) { help(null); }
],
[
[":"],
[":"],
- "Start command line mode
" +
+ "Start command line mode",
"In command line mode, you can perform extended commands, which may require arguments.",
function(count) { openVimperatorBar(null); }
],
[
["I"],
["I"],
- "Disable vimperator keys
" +
+ "Disable vimperator keys",
"Starts an 'ignorekeys' mode, where all keys except <Esc> are passed to the next event handler.
"+
"This is especially useful, if JavaScript controlled forms like the RichEdit form fields of GMail don't work anymore.
" +
"To exit this mode, press <Esc>. If you also need to pass <Esc>"+
@@ -832,7 +860,7 @@ var g_mappings = [/*{{{*/
[
[""], // if you ever add/remove keys here, also check them in the onVimperatorKeypress() function
[""],
- "Escape next key
" +
+ "Escape next key",
"If you need to pass a certain key to a javascript form field or another extension prefix the key with <C-v>.
"+
"Also works to unshadow Firefox shortcuts like <C-o> which are otherwise hidden in Vimperator.
"+
"When in 'ignorekeys' mode (activated by <I>), <C-v> will pass the next key to Vimperator instead of the webpage.",
@@ -841,14 +869,14 @@ var g_mappings = [/*{{{*/
[
[""],
[""],
- "Stop loading
" +
+ "Stop loading",
"Stops loading the current webpage.",
BrowserStop,
],
[
["", ""], // if you ever add/remove keys here, also check them in the onVimperatorKeypress() function
["", ""],
- "Cancel any operation
" +
+ "Cancel any operation",
"Exits any command line or hint mode and returns to browser mode.
"+
"Also focuses the web page, in case a form field has focus and eats our key presses.",
onEscape
@@ -859,60 +887,70 @@ var g_mappings = [/*{{{*/
["'b"],
["'b"],
"These quick bookmarks will be customizable in future releases, ignore for now",
+ null,
function(count) { openURLs('www.bwin.com'); }
],
[
["'o"],
["'o"],
"These quick bookmarks will be customizable in future releases, ignore for now",
+ null,
function(count) { openURLs('www.osnews.com'); }
],
[
["'s"],
["'s"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLs('www.derstandard.at'); }
],
[
["'w"],
["'w"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLs('wetter.orf.at'); }
],
[
["'t"],
["'t"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLs('www.tvinfo.de'); }
],
[
["\"b"],
["\"b"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLsInNewTab('www.bwin.com'); }
],
[
["\"o"],
["\"o"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLsInNewTab('www.osnews.com'); }
],
[
["\"s"],
["\"s"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLsInNewTab('www.derstandard.at'); }
],
[
["\"w"],
["\"w"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLsInNewTab('wetter.orf.at'); }
],
[
["\"t"],
["\"t"],
"These quick bookmarks will be customizable in future releases, ignore for now
",
+ null,
function(count) { openURLsInNewTab('www.tvinfo.de'); }
]
];/*}}}*/
@@ -998,13 +1036,13 @@ function get_command(cmd) // {{{
var added;
for (var i = 0; i < g_commands.length; i++, added = false)
{
- for (var j = 0; j < g_commands[i][0].length; j++)
+ for (var j = 0; j < g_commands[i][COMMANDS].length; j++)
{
- if (g_commands[i][0][j] == cmd)
+ if (g_commands[i][COMMANDS][j] == cmd)
{
return g_commands[i]; //exact command, returning it
}
- if (g_commands[i][0][j].indexOf(cmd) == 0)
+ if (g_commands[i][COMMANDS][j].indexOf(cmd) == 0)
{
if (!added)
{
@@ -1031,20 +1069,20 @@ function execute_command(count, cmd, special, args, modifiers) // {{{
return;
}
- if (command[3] === null)
+ if (command[FUNCTION] === null)
{
- echoerr("E666: Internal error: command[3] === null");
+ echoerr("E666: Internal error: command[FUNCTION] === null");
return;
}
// valid command, call it:
- command[3].call(this, args, special, count, modifiers);
+ command[FUNCTION].call(this, args, special, count, modifiers);
} // }}}
function tokenize_ex(string, tag)
{
- // removing commends
+ // removing comments
string.replace(/\s*".*$/, '');
if (tag)
{
@@ -1254,7 +1292,7 @@ function stringToURLs(str)
if (urls[url].match(/^(\.$|\.\/\S*)/))
{
var newLocation = getCurrentLocation();
- newLocation = newLocation.replace(/([\s\S]+)\/[^\/]*/, "$1");
+ newLocation = newLocation.replace(/([\s\S]+\/)[^\/]*/, "$1");
if(urls[url].match(/^\.(\/\S+)/))
newLocation += urls[url].replace(/^\.(\/\S+)/, "$1");
@@ -1263,7 +1301,7 @@ function stringToURLs(str)
else if (urls[url].match(/^(\.\.$|\.\.\/[\S]*)/))
{
var newLocation = getCurrentLocation();
- newLocation = newLocation.replace(/([\s\S]+)\/[^\/]*/, "$1/../");
+ newLocation = newLocation.replace(/([\s\S]+\/)[^\/]*/, "$1/../");
if(urls[url].match(/^\.\.(\/\S+)/))
newLocation += urls[url].replace(/^\.\.\/(\S+)/, "$1");
@@ -1810,43 +1848,43 @@ function set(args, special)
}
var get = false; if (matches[3] != undefined ||
- (setting[5] != 'boolean' && matches[4] == undefined)) get = true;
+ (setting[TYPE] != 'boolean' && matches[4] == undefined)) get = true;
var oper = matches[5];
var val = matches[6]; if (val == undefined) val = "";
// read access
if (get)
{
- var cur_val = setting[4].call(this);
- echo(" " + setting[0][0] + "=" + cur_val);
+ var cur_val = setting[GETFUNC].call(this);
+ echo(" " + setting[COMMANDS][0] + "=" + cur_val);
}
// write access
else
{
- var type = setting[5];
+ var type = setting[TYPE];
if (type == "boolean")
{
- setting[3].call(this, !no);
+ setting[SETFUNC].call(this, !no);
}
else if (type == "number")
{
var num = parseInt(val, 10);
if (isNaN(num))
- echoerr("Invalid argument type to option " + setting[0][0] + ": Expects number");
+ echoerr("Invalid argument type to option " + setting[COMMANDS][0] + ": Expects number");
else
{
- var cur_val = setting[4].call(this);
+ var cur_val = setting[GETFUNC].call(this);
if (oper == '+') num = cur_val + num;
if (oper == '-') num = cur_val - num;
- if (setting[7] != null && setting[7].call(this, num) == false)
- echoerr("Invalid argument to option " + setting[0][0] + ": Check help for more details");
+ if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, num) == false)
+ echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
else // all checks passed, execute option handler
- setting[3].call(this, num);
+ setting[SETFUNC].call(this, num);
}
}
else if (type == "charlist" || type == "stringlist" || type == "string")
{
- var cur_val = setting[4].call(this);
+ var cur_val = setting[GETFUNC].call(this);
if (type == "charlist" || type == "string")
{
if (oper == '+' && !cur_val.match(val))
@@ -1863,10 +1901,10 @@ function set(args, special)
val = val.replace(/^,?/, '');
}
}
- if (setting[7] != null && setting[7].call(this, val) == false)
- echoerr("Invalid argument to option " + setting[0][0] + ": Check help for more details");
+ if (setting[CHECKFUNC] != null && setting[CHECKFUNC].call(this, val) == false)
+ echoerr("Invalid argument to option " + setting[COMMANDS][0] + ": Check help for more details");
else // all checks passed, execute option handler
- setting[3].call(this, val);
+ setting[SETFUNC].call(this, val);
}
else
echoerr("Internal error, option format `" + type + "' not supported");
diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js
index 7ac93a3c..82ab768c 100644
--- a/chrome/content/vimperator/completion.js
+++ b/chrome/content/vimperator/completion.js
@@ -482,7 +482,7 @@ function get_help_completions(filter)/*{{{*/
help_array = help_array.concat(get_settings_completions(filter, true));
help_array = help_array.concat(g_mappings);
if (!filter) return help_array.map(function($_) {
- return [$_[0][0], $_[1]];
+ return [$_[COMMANDS][0], $_[SHORTHELP]];
});
return build_longest_common_substring(help_array, filter);
}/*}}}*/
@@ -492,7 +492,7 @@ function get_command_completions(filter)/*{{{*/
g_completions = [];
g_substrings = [];
if (!filter) return g_completions = g_commands.map(function($_) {
- return [$_[0][0], $_[1]];
+ return [$_[COMMANDS][0], $_[SHORTHELP]];
});
return g_completions = build_longest_starting_substring(g_commands, filter);
}/*}}}*/
@@ -508,16 +508,16 @@ function get_settings_completions(filter, unfiltered)/*{{{*/
filter = filter.substr(2);
}
if (unfiltered) return g_settings.filter(function($_) {
- if (no_mode && $_[5] != "boolean") return false;
+ if (no_mode && $_[TYPE] != "boolean") return false;
else return true;
}).map(function($_) {
- return [$_[0], $_[1]];
+ return [$_[COMMANDS], $_[SHORTHELP]];
});
if (!filter) return g_settings.filter(function($_) {
- if (no_mode && $_[5] != "boolean") return false;
+ if (no_mode && $_[TYPE] != "boolean") return false;
else return true;
}).map(function($_) {
- return [$_[0][0], $_[1]];
+ return [$_[COMMANDS][0], $_[SHORTHELP]];
});
@@ -527,11 +527,11 @@ function get_settings_completions(filter, unfiltered)/*{{{*/
filter = filter.substr(0, filter.length-1);
for(var i=0; i';
- for (var j=0; j < commands[i][0].length; j++)
+ for (var j=0; j < commands[i][COMMANDS].length; j++)
{
- var cmd_name = commands[i][0][j];
+ var cmd_name = commands[i][COMMANDS][j];
cmd_name = cmd_name.replace(//g, ">");
- ret += "" +beg+ cmd_name +end+ '';
+ ret += "" +beg+ cmd_name +end+ '';
}
ret += ' ';
- for (var j=0; j < commands[i][1].length; j++)
+ for (var j=0; j < commands[i][USAGE].length; j++)
{
- var usage = commands[i][1][j];
+ var usage = commands[i][USAGE][j];
usage = usage.replace(/<(?!br\/>)/g, "<");
usage = usage.replace(/[^b][^r][^\/]>/g, ">");
@@ -164,12 +164,18 @@ table.settings th {\
ret += ' ';
if (func)
ret += func.call(this, commands[i]);
- if (commands[i][2])
+ if (commands[i][SHORTHELP])
{
if(func)
- ret += "
"
- ret += commands[i][2]; // the help description
+ ret += "
";
+ ret += "";
+ ret += commands[i][SHORTHELP]; // the help description
+ ret += "
";
+ if (commands[i][HELP])
+ ret += commands[i][HELP]; // the help description
}
+ else
+ ret += "Sorry, no help available";
ret += ' ';
}
return ret;
@@ -177,20 +183,20 @@ table.settings th {\
function makeSettingsHelpString(command)
{
var ret = "";
- ret = command[5] + " (default: ";
- if (command[5] == "boolean")
+ ret = command[TYPE] + " (default: ";
+ if (command[TYPE] == "boolean")
{
- if(command[6] == true)
+ if(command[DEFAULT] == true)
ret += "on";
else
ret += "off";
}
else
{
- if (typeof command[6] == 'string' && command[6].length == 0)
+ if (typeof command[DEFAULT] == 'string' && command[DEFAULT].length == 0)
ret += "''";
else
- ret += command[6];
+ ret += command[DEFAULT];
}
ret += ")
";
diff --git a/chrome/content/vimperator/settings.js b/chrome/content/vimperator/settings.js
index 4b48ba10..c0bfb9a6 100644
--- a/chrome/content/vimperator/settings.js
+++ b/chrome/content/vimperator/settings.js
@@ -3,6 +3,13 @@
// handles all persistent storage of information
// to and from the firefox registry
+const TYPE = 4;
+const SETFUNC = 6;
+const GETFUNC = 7;
+const DEFAULT = 8;
+const CHECKFUNC = 9;
+
+
// the global handle to the root of the firefox settings
var g_firefox_prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
var g_vimperator_prefs = null;
@@ -16,214 +23,222 @@ var opt_fullscreen = false;
* [
* 0: [all names of this setting],
* 1: usage,
- * 2: help text,
- * 3: set_function,
- * 4: get_function,
- * 5: type,
- * 6: default,
- * 7: checkfunc,
- * 8: completefunc
+ * 2: shorthelp
+ * 3: help text,
+ * 4: type,
+ * 5: completefunc
+ * 6: set_function,
+ * 7: get_function,
+ * 8: default,
+ * 9: checkfunc,
* ]
*/
var g_settings = [/*{{{*/
[
["activate"],
["activate"],
- "Define when tabs are automatically activated
" +
+ "Define when tabs are automatically activated",
"Not implemented yet",
+ "stringlist",
+ null,
function(value) { set_pref("activate", value); },
function() { return get_pref("activate"); },
- "stringlist",
"quickmark,tabopen,paste",
- null,
null
],
[
["beep", "nobeep"],
["beep"],
"Emit a pc speaker beep on certain errors",
+ null,
+ "boolean",
+ null,
function(value) { set_pref("beep", value); },
function() { return get_pref("beep"); },
- "boolean",
true,
- null,
null
],
[
["complete", "cpt"],
["complete", "cpt"],
- "Order and items which are completed at the :[tab]open prompt
" +
+ "Items which are completed at the :[tab]open prompt",
"Available items:
"+
"- s: Search machines
- "+
" b: Bookmarks
- "+
" h: History
"+
- "The order is important, so :set complete=bs would list bookmarks first, and then any available quick searches.",
+ "The order is important, so :set complete=bs would list bookmarks first, and then any available quick searches.
"+
+ "Set the 'wildsort' setting if you want all entries sorted.",
+ "charlist",
+ null,
function(value) { set_pref("complete", value); },
function() { return get_pref("complete"); },
- "charlist",
"sbh",
- null,
null
],
[
["extendedhinttags", "eht"],
["extendedhinttags", "eht"],
- "XPath string of hintable elements activated by ';'
",
+ "XPath string of hintable elements activated by ';'",
+ null,
+ "string",
+ null,
function(value) { set_pref("extendedhinttags", value); },
function() { return get_pref("extendedhinttags"); },
- "string",
"//*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @class='lk' or @class='s'] | //input[@type!='hidden' or not(boolean(@type))] | //a | //area | //iframe | //textarea | //button | //select",
-
- null,
null
],
[
["focusedhintstyle", "fhs"],
["focusedhintstyle", "fhs"],
"CSS specification of focused hints appearance",
+ "null",
+ "string",
+ null,
function(value) { set_pref("focusedhintstyle", value); },
function() { return get_pref("focusedhintstyle"); },
- "string",
"z-index:5000;font-family:monospace;font-size:12px;color:ButtonText;background-color:ButtonShadow;border-color:ButtonShadow;border-width:1px;border-style:solid;padding:0px 1px 0px 1px;position:absolute;",
- null,
null
],
[
["fullscreen", "fs", "nofullscreen", "nofs"],
["fullscreen", "fs"],
"Shows the current window fullscreen",
+ null,
+ "boolean",
+ null,
function(value) { opt_fullscreen = value; BrowserFullScreen(); },
function() { return opt_fullscreen; },
- "boolean",
false,
- null,
null
],
[
["guioptions", "go"],
["guioptions", "go"],
- "Shows or hides the menu, toolbar and scrollbars
" +
+ "Shows or hides the menu, toolbar and scrollbars",
"Supported characters:
- m: menubar
- T: toolbar
- b: bookmark bar
- s: original Firefox statusbar
",
+ "charlist",
+ null,
function(value) { set_pref("guioptions", value); set_guioptions(value); },
function() { return get_pref("guioptions"); },
- "charlist",
"",
- null,
null
],
[
["hintchars", "hc"],
["hintchars", "hc"],
"String of single characters which can be used to follow hints",
+ "charlist",
+ null,
function(value) { set_pref("hintchars", value); },
function() { return get_pref("hintchars"); },
- "charlist",
"hjklasdfgyuiopqwertnmzxcvb",
- null,
null
],
[
["hintstyle", "hs"],
["hintstyle", "hs"],
"CSS specification of unfocused hints appearance",
+ null,
+ "string",
+ null,
function(value) { set_pref("hintstyle", value); },
function() { return get_pref("hintstyle"); },
- "string",
"z-index:5000;font-family:monospace;font-size:12px;color:black;background-color:yellow;border-color:ButtonShadow;border-width:0px;border-style:solid;padding:0px 1px 0px 1px;position:absolute;",
- null,
null
],
[
["hinttags"],
["hinttags"],
- "XPath string of hintable elements activated by 'f'",
+ "XPath string of hintable elements activated by 'f' and 'F'",
+ null,
+ "string",
+ null,
function(value) { set_pref("hinttags", value); },
function() { return get_pref("hinttags"); },
- "string",
"//*[@onclick or @onmouseover or @onmousedown or @onmouseup or @oncommand or @class='lk' or @class='s'] | //input[@type!='hidden'] | //a | //area | //iframe | //textarea | //button | //select",
- null,
null
],
[
["maxhints", "mh"],
["maxhints", "mh"],
- "Maximum of simultanously shown hints
" +
+ "Maximum number of simultanously shown hints",
"If you want to speed up display of hints, choose a smaller value",
+ "number",
+ null,
function(value) { set_pref("maxhints", value); },
function() { return get_pref("maxhints"); },
- "number",
250,
- function (value) { if (value>=1 && value <=1000) return true; else return false; },
- null
+ function (value) { if (value>=1 && value <=1000) return true; else return false; }
],
[
["preload", "nopreload"],
["preload"],
- "Speed up first time history/bookmark completion
" +
+ "Speed up first time history/bookmark completion",
"History access can be quite slow for a large history. Vimperator maintains a cache to speed it up significantly on subsequent access.
"+
"In order to also speed up first time access, it is cached at startup, if this option is set (recommended).",
+ "boolean",
+ null,
function(value) { set_pref("preload", value); },
function() { return get_pref("preload"); },
- "boolean",
true,
- null,
null
],
[
["previewheight", "pvh"],
["previewheight", "pvh"],
- "Default height for preview window
" +
+ "Default height for preview window",
"Value must be between 1 and 50. If the value is too high, completions may cover the command-line. Close the preview window with :pclose.",
+ "number",
+ null,
function(value) { set_pref("previewheight", value); },
function() { return get_pref("previewheight"); },
- "number",
10,
- function (value) { if (value>=1 && value <=50) return true; else return false; },
- null
+ function (value) { if (value>=1 && value <=50) return true; else return false; }
],
[
["showmode", "smd", "noshowmode", "nosmd"],
["showmode", "smd"],
"Show the current mode in the command line",
+ null,
+ "boolean",
+ null,
function(value) { set_pref("showmode", value); },
function() { return get_pref("showmode"); },
- "boolean",
true,
- null,
null
],
[
["showtabline", "stal"],
["showtabline", "stal"],
- "Control when to show the tab bar of opened web pages
" +
+ "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
- "+
" 2: Always show tab bar
"+
"Not implemented yet.",
+ "number",
+ null,
function(value) { set_pref("showtabline", value); set_showtabline(value); },
function() { return get_pref("showtabline"); },
- "number",
2,
- function (value) { if (value>=0 && value <=2) return true; else return false; },
- null
+ function (value) { if (value>=0 && value <=2) return true; else return false; }
],
[
["usermode", "um", "nousermode", "noum"],
["usermode", "um"],
- "Show current website with a minimal stylesheet to make it easily accessible
" +
+ "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",
+ "boolean",
+ null,
function(value) { opt_usermode = value; setStyleDisabled(value); },
function() { return opt_usermode; },
- "boolean",
false,
- null,
null
],
[
["wildmode", "wim"],
["wildmode", "wim"],
- "Defines how command line completion works
" +
+ "Define how command line completion works",
"It is a comma-separated list of parts, where each part specifies" +
"what to do for each consecutive use of the completion key. The first part" +
"specifies the behavior for the first use of the completion key, the second part" +
@@ -238,43 +253,43 @@ var g_settings = [/*{{{*/
"'list:longest' When more than one match, list all matches and complete till the longest common string. " +
"" +
"When there is only a single match, it is fully completed regardless of the case.",
+ "stringlist",
+ null,
function(value) { set_pref("wildmode", value); },
function() { return get_pref("wildmode"); },
- "stringlist",
"list:full",
- null,
null
],
[
["wildsort", "wis", "nowildsort", "nowis"],
["wildsort", "wis"],
- "Defines whether command line completion is sorted
" +
+ "Define whether command line completion is sorted",
"If you don't want a sorted completion list, set this to false.",
+ "boolean",
+ null,
function(value) { set_pref("wildsort", value); },
function() { return get_pref("wildsort"); },
- "boolean",
false,
- null,
null
]
]/*}}}*/
// return null, if the cmd cannot be found in our g_settings array, or
// otherwise a refernce to our command
-function get_setting(cmd)
+function get_setting(cmd)/*{{{*/
{
for (var i=0; i < g_settings.length; i++)
{
- for (var j=0; j < g_settings[i][0].length; j++)
+ for (var j=0; j < g_settings[i][COMMANDS].length; j++)
{
- if (g_settings[i][0][j] == cmd)
+ if (g_settings[i][COMMANDS][j] == cmd)
{
return g_settings[i];
}
}
}
return null;
-}
+}/*}}}*/
/////////////////////////////////////////////////
// preference getter functions ///////////// {{{1
@@ -294,9 +309,9 @@ function get_pref(name, forced_default)
{
for (var i=0; i b[0])
return 1;
- else return 0;
+ else
+ return 0;
});
+ }
}
}
}