Use a '=' to seperate the kebind and the command for *map command.
authorDaniel Carl <danielcarl@gmx.de>
Sat, 29 Dec 2012 14:50:23 +0000 (15:50 +0100)
committerDaniel Carl <danielcarl@gmx.de>
Sat, 29 Dec 2012 14:50:23 +0000 (15:50 +0100)
This changed makes the commands format more generic for all commands. From the
point of view of the command, there is no difference between the set command
and the various *map commands. Now we use the following format for all
commands:

[count]command[ param1[=value1]].

This will make the commands easier to use and learn and will make our lives
easier in later implementations. For example would be the parsing of
[count] command[ param1=[value1] param2 param3[=value3]] easy.

doc/config
src/config.h
src/keybind.c

index dda7453..3a9e587 100644 (file)
@@ -1,36 +1,36 @@
 # default config
-nmap gf source
-nmap <shift-:> input
-nmap o inputopen
-nmap t inputtabopen
-nmap O inputopencurrent
-nmap T inputtabopencurrent
-nmap d quit
-nmap <ctrl-o> back
-nmap <ctrl-i> forward
-nmap r reload
-nmap R reload!
-nmap <ctrl-c> stop
-nmap <ctrl-f> pagedown
-nmap <ctrl-b> pageup
-nmap <ctrl-d> halfpagedown
-nmap <ctrl-u> halfpageup
-nmap gg jumptop
-nmap G jumpbottom
-nmap 0 jumpleft
-nmap $ jumpright
-nmap h scrollleft
-nmap l scrollright
-nmap k scrollup
-nmap j scrolldown
-nmap f hint-link
-nmap F hint-link-new
-nmap ;o hint-input-open
-nmap ;t hint-input-tabopen
-nmap ;y hint-yank
-nmap y yank-uri
-nmap Y yank-selection
-cmap <tab> complete
-cmap <shift-tab> complete-back
-hmap <tab> hint-focus-next
-hmap <shift-tab> hint-focus-prev
+nmap gf=source
+nmap <shift-:>=input
+nmap o=inputopen
+nmap t=inputtabopen
+nmap O=inputopencurrent
+nmap T=inputtabopencurrent
+nmap d=quit
+nmap <ctrl-o>=back
+nmap <ctrl-i>=forward
+nmap r=reload
+nmap R=reload!
+nmap <ctrl-c>=stop
+nmap <ctrl-f>=pagedown
+nmap <ctrl-b>=pageup
+nmap <ctrl-d>=halfpagedown
+nmap <ctrl-u>=halfpageup
+nmap gg=jumptop
+nmap G=jumpbottom
+nmap 0=jumpleft
+nmap $=jumpright
+nmap h=scrollleft
+nmap l=scrollright
+nmap k=scrollup
+nmap j=scrolldown
+nmap f=hint-link
+nmap F=hint-link-new
+nmap ;o=hint-input-open
+nmap ;t=hint-input-tabopen
+nmap ;y=hint-yank
+nmap y=yank-uri
+nmap Y=yank-selection
+cmap <tab>=complete
+cmap <shift-tab>=complete-back
+hmap <tab>=hint-focus-next
+hmap <shift-tab>=hint-focus-prev
index d746c5c..e8e1d02 100644 (file)
 const struct {
     char* command;
 } default_config[] = {
-    {"nmap o inputopen"},
-    {"nmap O inputopencurrent"},
-    {"nmap : input"},
-    {"nmap d quit"},
+    {"nmap o=inputopen"},
+    {"nmap O=inputopencurrent"},
+    {"nmap :=input"},
+    {"nmap d=quit"},
     {NULL}
 };
 
index 9306068..668a17b 100644 (file)
@@ -58,7 +58,7 @@ gboolean keybind_add_from_string(const gchar* str, const Mode mode)
     g_strstrip(line);
 
     /* split into keybinding and command */
-    char **string = g_strsplit(line, " ", 2);
+    char **string = g_strsplit(line, "=", 2);
 
     guint len = g_strv_length(string);
     if (len == 2 && command_exists(string[1])) {