diff --git a/ChangeLog b/ChangeLog index b5ab35b3..79244f7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@
2007-05-02:
* version ???
+ * :help now opens in the current tab even for xhtml pages like "about:"
* hints work on xhtml pages now (you need to reset the 'hinttags' and
'extendedhinttags' settings with :set hinttags& and :set extendedhinttags&
* :set option& resets the option to the default value
diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js
index 77b6f6ef..7788d324 100644
--- a/chrome/content/vimperator/commands.js
+++ b/chrome/content/vimperator/commands.js
@@ -67,7 +67,7 @@ var g_commands = [/*{{{*/
["bdelete", "bd", "bwipeout", "bw", "bunload", "bun", "tabclose", "tabc"],
["{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.",
+ "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
],
@@ -134,7 +134,7 @@ var g_commands = [/*{{{*/
["downloads", "dl"],
["downloads"],
"Show progress of current downloads",
- "Open the original Firefox download dialog in a new tab.
"+
+ "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
@@ -184,14 +184,14 @@ var g_commands = [/*{{{*/
["help", "h"],
["h[elp] {subject}"],
"Open the help window",
- "You can jump to the specified {subject} with :help {subject}.
"+
+ "You can jump to the specified {subject} with :help {subject}.
"+
"Make sure you use the full vim notation when jumping to {subject}. This means:
"+
":help :help for commands (: prefix):help 'complete' for settings (surrounded by ' and '):help o for mappings (no pre- or postfix):help :help for commands (: prefix):help 'complete' for settings (surrounded by ' and '):help o for mappings (no pre- or postfix):help he will complete :help :help",
+ "You can however use partial stings in the tab completion, so :help he<Tab> will complete :help :help",
help,
function(filter) { return get_help_completions(filter); }
],
@@ -206,7 +206,7 @@ var g_commands = [/*{{{*/
],
[
["javascript", "js"],
- ["javascript {cmd}", "javascript <<{endpattern}\\n{script}\\n{endpattern}"], // \\n is changed to eval().:javascript alert('Hello world') would show a dialog box with the text \"Hello world\".:open wikipedia linus torvalds will open the wikipedia entry for linux torvalds).'defsearch' setting) if the first word is no search engine (:open linus torvalds will open a google search for linux torvalds).: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\":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.: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\":open wikipedia linus torvalds "+
+ "will open the wikipedia entry for linux torvalds).'defsearch' setting) "+
+ "if the first word is no search engine (: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.:set!, but opens the dialog in a new window instead of a new tab. Use this, if you experience problems/crashes when using :set!",
+ "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,
null
],
@@ -338,7 +346,7 @@ var g_commands = [/*{{{*/
":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& resets 'option' to the default value.:set option& resets 'option' to the default value.:set option+=foo and :set option-=foo WILL add/remove foo from list options.:tab help tab opens the help in a new tab.",
+ "Example: :tab help tab opens the help in a new tab.",
tab,
null
],
@@ -382,7 +390,7 @@ var g_commands = [/*{{{*/
["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.:open but open URLs in a new tab.:wq is different as in vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that.",
+ ":wq is different as in vim, as it closes the window instead of just one tab by popular demand. Complain on the mailing list, if you want to change that.",
function (args) { quit(true); },
null
],
@@ -529,21 +537,21 @@ var g_mappings = [/*{{{*/
["d"],
["{count}d"],
"Delete current buffer (=tab)",
- "Count WILL be supported in future releases, then 2d removes two tabs and the one the right is selected.",
+ "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)",
- "Count WILL be supported in future releases, then 2D removes two tabs and the one the left is selected.",
+ "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",
- "Go Execute works like :execute.Go Execute works like :execute.P, but inverts the 'activate' setting.",
+ "Works like P, but inverts the 'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), false); }
],
[
@@ -573,7 +581,7 @@ var g_mappings = [/*{{{*/
["{count}gt"],
"Go to next tab",
"Cycles to the first tab, when the last is selected.3gt goes to the third tab.",
+ "Count is supported, 3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count : 0); }
],
[
@@ -581,36 +589,36 @@ var g_mappings = [/*{{{*/
["{count}gT"],
"Go to previous tab",
"Cycles to the last tab, when the first is selected.3gt goes to the third tab.",
+ "Count is supported, 3gt goes to the third tab.",
function(count) { tab_go(count > 0 ? count :-1); }
],
[
["o"],
["o"],
"Open one or more URLs in the current tab",
- "See :open for more details",
+ "See :open for more details",
function(count) { openVimperatorBar('open '); }
],
[
["O"],
["O"],
"Open one ore more URLs in the current tab, based on current location",
- "Works like o, but preselects current URL in the :open query.",
+ "Works like o, but preselects current URL in the :open query.",
function(count) { openVimperatorBar('open ' + getCurrentLocation()); }
],
[
["p", "'defsearch' setting) with p",
+ "You can also just select some non-URL text, and search for it with the default search engine or keyword (specified by the 'defsearch' setting) with p",
function(count) { openURLs(readFromClipboard()); }
],
[
["P"],
["P"],
"Open (put) an URL based on the current clipboard contents in a new buffer",
- "Works like p, but opens a new tab.'activate' setting.",
+ "Works like p, but opens a new tab.'activate' setting.",
function(count) { openURLsInNewTab(readFromClipboard(), true); }
],
[
@@ -631,15 +639,15 @@ var g_mappings = [/*{{{*/
["t"],
["t"],
"Open one or more URLs in a new tab",
- "Like o but open URLs in a new tab.:tabopen for more details",
+ "Like o but open URLs in a new tab.:tabopen for more details",
function(count) { openVimperatorBar('tabopen '); }
],
[
["T"],
["T"],
"Open one ore more URLs in a new tab, based on current location",
- "Works like t, but preselects current URL in the :tabopen query.",
+ "Works like t, but preselects current URL in the :tabopen query.",
function(count) { openVimperatorBar('tabopen ' + getCurrentLocation()); }
],
[
@@ -695,7 +703,7 @@ var g_mappings = [/*{{{*/
["ZQ"],
["ZQ"],
"Quit and don't save the session",
- "Works like :qall.",
+ "Works like :qall.",
function(count) { quit(false); }
],
[
@@ -703,7 +711,7 @@ var g_mappings = [/*{{{*/
["ZZ"],
"Quit and save the session",
"Quit Vimperator, no matter how many tabs/windows are open. The session is stored.:xall.",
+ "Works like :xall.",
function(count) { quit(true); }
],
@@ -712,7 +720,7 @@ var g_mappings = [/*{{{*/
["0", "^"],
["0", "^"],
"Scroll to the absolute left of the document",
- "Unlike in vim, 0 and ^ work exactly the same way.",
+ "Unlike in vim, 0 and ^ work exactly the same way.",
function(count) { scrollBufferAbsolute(0, -1); }
],
[
@@ -726,46 +734,46 @@ var g_mappings = [/*{{{*/
["gg", "35gg vertically goes to 35% of the document",
+ "Count is supported, 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",
+ "Count is supported, 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.'beep' is turned off).",
+ "Count is supported: 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.'beep' is turned off).",
+ "Count is supported: 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.'beep' is turned off).",
+ "Count is supported: 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.'beep' is turned off).",
+ "Count is supported: 10l will move 10 times as much to the right.'beep' is turned off).",
function(count) { scrollBufferRelative(1, 0); }
],
[
@@ -802,28 +810,28 @@ var g_mappings = [/*{{{*/
["H", "3H goes back 3 steps.",
+ "Count is supported, 3H goes back 3 steps.",
function(count) { stepInHistory(count > 0 ? -1 * count : -1); }
],
[
["L", "3L goes forward 3 steps.",
+ "Count is supported, 3L goes forward 3 steps.",
function(count) { stepInHistory(count > 0 ? count : 1); }
],
[
["gu", "2gu on http://www.example.com/dir1/dir2/file.htm would open http://www.example.com/dir1/",
+ "Count is supported, 2gu on http://www.example.com/dir1/dir2/file.htm would open http://www.example.com/dir1/",
goUp
],
[
["gU", "gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.gU on http://www.example.com/dir1/dir2/file.htm opens http://www.example.com/.'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.",
+ "Also, most Ctrl-prefixed shortcut keys are available in this mode for navigation.",
function(count) { hah.enableHahMode(HINT_MODE_ALWAYS); }
],
[
@@ -853,20 +861,20 @@ var g_mappings = [/*{{{*/
[";"],
"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 locationY to yank its text descriptiono to open its location in the current tabt to open its location in a new tabO to open its location in an :open query (not implemented yet)T to open its location in an :tabopen query (not implemented yet)s to save its destination (not implemented yet)<C-w> to open its destination in a new windowy to yank its locationY to yank its text descriptiono to open its location in the current tabt to open its location in a new tabO to open its location in an :open query (not implemented yet)T to open its location in an :tabopen query (not implemented yet)s 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.'extendedhinttags' XPath string.",
+ "Multiple hints can be seperated by commas where it makes sense. ;ab,ac,adt opens AB, AC and AD in a new tab.'extendedhinttags' XPath string.",
function(count) { hah.enableHahMode(HINT_MODE_EXTENDED); }
],
@@ -893,7 +901,7 @@ var g_mappings = [/*{{{*/
[":help <F1> (jumping to a specific section not implemented yet).",
+ "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); }
],
[
@@ -907,19 +915,19 @@ var g_mappings = [/*{{{*/
["I"],
["I"],
"Disable vimperator keys",
- "Starts an 'ignorekeys' mode, where all keys except <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>.",
+ "To exit this mode, press <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.<I>), <C-v> will pass the next key to Vimperator instead of the webpage.",
+ "If you need to pass a certain key to a javascript form field or another extension prefix the key with <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); }
],
[
diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js
index 51483f6f..a8defbcb 100644
--- a/chrome/content/vimperator/help.js
+++ b/chrome/content/vimperator/help.js
@@ -33,10 +33,10 @@ function help(section, easter)
echoerr("E478: Don't panic!");
return;
}
- if ((arguments[3] && arguments[3].inTab) || !window.content.document.open)
+ if ((arguments[3] && arguments[3].inTab))// || !window.content.document.open)
openURLsInNewTab("", true);
-
- var doc = window.content.document;
+ else
+ openURLs("about:blank");
// xxx: for firebug: :js Firebug.toggleBar(true)
@@ -52,7 +52,7 @@ function help(section, easter)
for (var i=0; i < commands.length; i++)
{
// the usage information for the command
- ret += '" +beg+ usage +end+ '' +beg+ cmd_name +end+ '' +beg+ cmd_name +end+ 'First there was a Navigator, then there was an Explorer.
\n'+
+ var header = 'Vimperator
\n' +
+ '
First there was a Navigator, then there was an Explorer.
\n'+
'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)
Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor.
' +
'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.
Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
'+
- 'If you really need them, type: :set guioptions=mT to get it back.
\n' +
- 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
' +
- 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
'+
+ 'If you really need them, type: :set guioptions=mT to get it back.
\n' +
+ 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
' +
+ 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.
'+
'For best experience, I therefore recommend the Whitehart theme.