`:qunshift' command. This is only available if vimb was compiled with QUEUE
feature.
.TP
+.B ;x
+Hints like ;o, but instead of opening the hinted URI, the
+`x-hint-command' is run in vimb.
+.TP
.B ;y
Yank hint's destination location into primary and secondary clipboard.
.TP
.B CTRL\-V
Pass the next key press directly to gtk.
.TP
-.B CTRL\-R {a-z%:/}
+.B CTRL\-R {a-z%:/;}
Insert the content of given register at cursor position. See also section
REGISTERS.
.SS Command Line History
.TP
.B \[char34]/
Contains the most recent search-pattern.
+.TP
+.B \[char34];
+Contains the last hinted URL. This can be used in `x-hint-command' to get the
+URL of the hint.
.SH COMPLETIONS
The completions are triggered by pressing `<Tab>` or `<shift-tab>` in the
activated inputbox. Depending of the current inserted content different
.B timeoutlen (int)
The time in milliseconds that is waited for a key code or mapped key sequence
to complete.
+.TP
+.B x-hint-command (string)
+Command used if hint mode ;x is fired. The command can be any vimb command
+string. Note that the command is run through the mapping mechanism of vimb so
+it might change the behaviour by adding or changing mappings.
+.RS
+.P
+.PD 0
+.IP ":set x-hint-command=50G"
+Not really useful. If the hint is fired, scroll to the middle of the page.
+.IP ":set x-hint-command=:sh! curl -e <C-R>% <C-R>;"
+This fills the inputbox with the prefilled download command and replaces
+`<C-R>%' with the current URI and `<C-R>;' with the URI of the hinted element.
+.PD
+.RE
.SH FILES
.TP
.B $XDG_CONFIG_HOME/vimb/config
vimb has been compiled with QUEUE feature.
.TP
.B $XDG_CONFIG_HOME/vimb/hsts
-Holds the known hsts hosts if vimb is compliled with HTTP strict transport
+Holds the known hsts hosts if vimb is compiled with HTTP strict transport
security feature.
.TP
.B $XDG_CONFIG_HOME/vimb/scripts.js
gboolean res;
char pmode = '\0';
#ifdef FEATURE_QUEUE
- static char *modes = "eiIoOpPstTyY";
+ static char *modes = "eiIoOpPstTxyY";
static char *g_modes = "IpPstyY";
#else
- static char *modes = "eiIoOstTyY";
+ static char *modes = "eiIoOstTxyY";
static char *g_modes = "IstyY";
#endif
mode_enter('n');
}
- char *v = (value + 5);
- Arg a = {0};
+ char *v = (value + 5);
+ Arg a = {0};
+ /* put the hinted value into register "; */
+ vb_register_add(';', v);
switch (hints.mode) {
/* used if images should be opened */
case 'i':
command_save(&a);
break;
+ case 'x':
+ map_handle_string(GET_CHAR("x-hint-command"), true);
+ break;
+
case 'y':
case 'Y':
a.i = COMMAND_YANK_ARG;
var prop,
/* holds the xpaths for the different modes */
xpathmap = {
- otY: "//*[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //textarea[not(@disabled or @readonly)] | //button | //select",
- e: "//input[not(@type) or @type='text'] | //textarea",
- iI: "//img[@src]",
- OpPsTy: "//*[@href] | //img[@src and not(ancestor::a)] | //iframe[@src]"
+ otY: "//*[@href] | //*[@onclick or @tabindex or @class='lk' or @role='link' or @role='button'] | //input[not(@type='hidden' or @disabled or @readonly)] | //textarea[not(@disabled or @readonly)] | //button | //select",
+ e: "//input[not(@type) or @type='text'] | //textarea",
+ iI: "//img[@src]",
+ OpPsTxy: "//*[@href] | //img[@src and not(ancestor::a)] | //iframe[@src]"
},
/* holds the actions to perform on hint fire */
actionmap = {
- o: function(e) {open(e, false); return "DONE:";},
- t: function(e) {open(e, true); return "DONE:";},
- eiIOpPsTy: function(e) {return "DATA:" + getSrc(e);},
- Y: function(e) {return "DATA:" + (e.textContent || "");}
+ o: function(e) {open(e, false); return "DONE:";},
+ t: function(e) {open(e, true); return "DONE:";},
+ eiIOpPsTxy: function(e) {return "DATA:" + getSrc(e);},
+ Y: function(e) {return "DATA:" + (e.textContent || "");}
};
config = {
#define VB_MARK_SIZE (sizeof(VB_MARK_CHARS) - 1)
#define VB_USER_REG "abcdefghijklmnopqrstuvwxyz"
-#define VB_REG_CHARS VB_USER_REG "%:/"
+#define VB_REG_CHARS VB_USER_REG "%:/;"
#define VB_REG_SIZE (sizeof(VB_REG_CHARS) - 1)
/* enums */
#ifdef FEATURE_HSTS
setting_add("hsts", TYPE_BOOLEAN, &on, hsts, NULL);
#endif
+ setting_add("x-hint-command", TYPE_CHAR, &":o <C-R>;", NULL, NULL);
/* initialize the shortcuts and set the default shortcuts */
shortcut_init();