.\" Process this file with
.\" groff -man -Tascii vimb.1
.TH PROJECT 1 "DATE" "PROJECT/VERSION" "Vimb Manual"
+
.SH NAME
PROJECT - Vim Browser - A modal web browser based on webkit thats inspired by
vim the great editor.
+
.SH SYNOPSIS
.BI "PROJECT [" "OPTION" "] [" "URI" "]"
+
.SH DESCRIPTION
PROJECT is a webkit based web browser that behaves like the vimperator
plugin for the firefox and usage paradigms from the great editor vim. The goal
of PROJECT is to build a completely keyboard-driven, efficient and pleasurable
browsing-experience.
+
.SH OPTIONS
Mandatory arguments to long options are mandatory for short options too.
.TP
.TP
.B "\-v, \-\-version"
Print build and version information.
+
.SH MODES
PROJECT is modal an has following main modes:
.TP
.TP
.B Command Mode
Execute PROJECT commands from the builtin inputbox (commandline).
+
.SH COMMANDS
Commands are a central part in PROJECT. They are used for nearly all things
that could be done with this browser. Commands allow to set config variables,
.TP
.B (tab)open-clipboard, (t)oc
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.
keybindings to generate the tabopen command with current uri prefilled. If
.I TEXT
is not given use ':' instead.
+
.SS Navigate
Following commands are used to navigate within the browser history.
.TP
.TP
.B stop, st
Stop loading the current url.
+.TP
+.BI [ N "]descent"
+Go to the \fIN\fPth descendent directory of the current opened.
+.TP
+.B descent!
+Go to the domain of the current opened page.
+
.SS Scroll
Following commands are used to scroll ad jump within the current view.
.TP
.TP
.BI [ N "]scrolldown"
Scroll the page \fIN\fP times the "scrollstep" to the end.
+
.SS Keybinding
To bind a command to a key sequence use the {n,i,c}map command. To map a
keysequence to a command, use this format "nmap {[modkey]key}={command}[ params]".
.TP
.B cunmap
Remove a Command Mode keybinding.
+
.SS Hints
.TP
.BI "hint-link [" PREFIX "], hint-link-new [" PREFIX ]
.BI "hint-editor [" PREFIX "]"
Start hinting to open inputboxes or textareas with external editor. If
\fIPREFIX\fP is given, print this into the inputbox, default ';e'.
+
.SS Yank
.TP
.B yank-uri, yu
.TP
.B yank-selection, ys
Yank the selected text into the primary and secondary clipboard.
+
.SS Shortcuts
Shortcuts allows to open URL build up from a named template with additional
parameters. If a shortcut named 'dd' is defined, you can use it with `:open dd
.BI "shortcut-default " "SHORTCUT"
Set the shortcut for given \fISHORTCUT\fP as the default. It doesn't matter if
the \fISHORTCUT\fP is already in use or not to be able to set it.
+
.SS Configuration
.TP
.BI "set " VAR = VALUE
.TP
.BI "set " VAR !
Toggle the value of boolean variable \fIVAR\fP and display the new set value.
+
.SS Zoom
.TP
.BI [ N "]zoomin, [" N "]zi"
.TP
.B zoomreset, zr
Reset the zoomlevel to the default value.
+
.SS History
.TP
.B hist-prev, hist-next"
history items. A command is not a internal command, but every string entered
into inputbox that begins with \fI[:/?]\fP. So the history contains real
commands and search queries.
+
.SS Bookmark
.TP
.BI "bookmark-add [" TAGS "], bma [" TAGS ]
Save the current opened uri with \fITAGS\fP to the bookmark file.
+
.SS Misc
.TP
.B next, n, prev, p
.TP
.B esc
Got back to normal mode indipendent from current mode.
+
.SS NORMAL_MODE
.TP
.B g\-f
.BI [ N ]ctrl\-i
Go forward \fIN\fP steps in the browser history.
.TP
+.BI [ N ]gu
+Go to the \fIN\fPth descendent directory of the current opened URL.
+.TP
+.B gU
+Go to the domain of the current opened page.
+.TP
.B r
Reload the website.
.TP
.TP
.BI [ N ]N
Search for \fIN\fPnth previous search result.
+
.SS COMMAND_MODE
.TP
.B tab
.TP
.B down
Step through history forward.
+
.SS INSERT_MODE
.TP
.B ctrl-t
If the current active form element is an inputbox or textarea, the content is
copied to temporary file and the file openen with the configured external
editor (setting `editor-command').
+
.SH FILES
.I $XDG_CONFIG_HOME/PROJECT/config
.RS
File for userdefined css styles. These file is used if the config variable
'stylesheet' is enabled.
.RE
+
.SH ENVIRONMENT
.TP
.B HOME
.B http_proxy
If this variable is set to an none empty value, and the configuration option
`proxy' is enabled, this will be used as http proxy.
+
.SH "REPORTING BUGS"
Report bugs to the main project page on
.IR https://github.com/fanglingsu/vimb/issues .
+
.SH AUTHOR
Daniel Carl
{"editor", NULL, command_editor, {0}},
{"next", "n", command_nextprev, {0}},
{"prev", "p", command_nextprev, {1}},
+ {"descent", NULL, command_descent, {0}},
+ {"descent!", NULL, command_descent, {1}},
};
static void editor_resume(GPid pid, int status, OpenEditorData *data);
return true;
}
+gboolean command_descent(const Arg *arg)
+{
+ gboolean result;
+ int count = vb.state.count ? vb.state.count : 1;
+ const char *uri, *p = NULL, *domain = NULL;
+
+ uri = webkit_web_view_get_uri(vb.gui.webview);
+
+ vb_set_mode(VB_MODE_NORMAL, false);
+ if (!uri || *uri == '\0') {
+ return false;
+ }
+
+ /* get domain part */
+ if (!(domain = strstr(uri, "://")) || !(domain = strchr(domain + 3, '/'))) {
+ return false;
+ }
+
+ if (arg->i) {
+ p = domain;
+ } else {
+ /* start at the end */
+ p = uri + strlen(uri);
+ /* if last char is / increment count to step over this first */
+ if (*(p - 1) == '/') {
+ count++;
+ }
+ for (int i = 0; i < count; i++) {
+ while (*(p--) != '/') {
+ if (p == uri) {
+ /* reach the beginning */
+ return false;
+ }
+ }
+ }
+ /* keep the last / in uri */
+ p++;
+ }
+
+ /* if the url is shorter than the domain use the domain instead */
+ if (p < domain) {
+ p = domain;
+ }
+
+ Arg a = {VB_TARGET_CURRENT};
+ a.s = g_strndup(uri, p - uri + 1);
+ result = vb_load_uri(&a);
+ g_free(a.s);
+
+ return result;
+}
+
gboolean command_editor(const Arg *arg)
{
char *file_path = NULL;