.B tabopen
Open the give url into a new window.
.TP
-.B open-home
-Opens the configured 'home-page' into current window.
+.B (tab)open-home
+Opens the configured 'home-page'.
.TP
-.B tabopen-home
-Opens the home page into a new window.
+.B (tab)open-closed
+Open the last closed page.
.TP
-.B open-closed
-Open the last closed page into current window.
-.TP
-.B tabopen-closed
-Open the last closed page into new window.
+.B (tab)open-clipboard
+Open the url from clipboard.
.SS Input
Switches the browser into Command Mode and prefill the inputbox on th bottom of
the browser with various prefilled content.
{"hint-focus-prev", command_hints_focus, {1}},
{"yank-uri", command_yank, {COMMAND_YANK_PRIMARY | COMMAND_YANK_SECONDARY | COMMAND_YANK_URI}},
{"yank-selection", command_yank, {COMMAND_YANK_PRIMARY | COMMAND_YANK_SECONDARY | COMMAND_YANK_SELECTION}},
+ {"open-clipboard", command_paste, {VP_CLIPBOARD_PRIMARY | VP_CLIPBOARD_SECONDARY | VP_TARGET_CURRENT}},
+ {"tabopen-clipboard", command_paste, {VP_CLIPBOARD_PRIMARY | VP_CLIPBOARD_SECONDARY | VP_TARGET_NEW}},
{"search-forward", command_search, {VP_SEARCH_FORWARD}},
{"search-backward", command_search, {VP_SEARCH_BACKWARD}},
};
return FALSE;
}
+gboolean command_paste(const Arg* arg)
+{
+ Arg a = {.i = arg->i & VP_TARGET_NEW};
+ if (arg->i & VP_CLIPBOARD_PRIMARY) {
+ a.s = gtk_clipboard_wait_for_text(PRIMARY_CLIPBOARD());
+ }
+ if (!a.s && arg->i & VP_CLIPBOARD_SECONDARY) {
+ a.s = gtk_clipboard_wait_for_text(SECONDARY_CLIPBOARD());
+ }
+
+ if (a.s) {
+ vp_load_uri(&a);
+ g_free(a.s);
+
+ return TRUE;
+ }
+ return FALSE;
+}
+
gboolean command_search(const Arg* arg)
{
State* state = &vp.state;
gboolean command_hints(const Arg* arg);
gboolean command_hints_focus(const Arg* arg);
gboolean command_yank(const Arg* arg);
+gboolean command_paste(const Arg* arg);
gboolean command_search(const Arg* arg);
#endif /* end of include guard: COMMAND_H */
{"nmap ;y=hint-yank"},
{"nmap y=yank-uri"},
{"nmap Y=yank-selection"},
+ {"nmap p=open-clipboard"},
+ {"nmap P=tabopen-clipboard"},
{"cmap <tab>=complete"},
{"cmap <shift-tab>=complete-back"},
{"hmap <tab>=hint-focus-next"},
} Type;
enum {
- VP_CLIPBOARD_PRIMARY = (1<<0),
- VP_CLIPBOARD_SECONDARY = (1<<1)
+ VP_CLIPBOARD_PRIMARY = (1<<1),
+ VP_CLIPBOARD_SECONDARY = (1<<2)
};
/* structs */