From: Daniel Carl Date: Sat, 29 Dec 2012 14:50:23 +0000 (+0100) Subject: Use a '=' to seperate the kebind and the command for *map command. X-Git-Url: https://git.owens.tech///git?a=commitdiff_plain;h=85a5b76aeedff2376200011b7e449bfbbe4fd378;p=vimb.git Use a '=' to seperate the kebind and the command for *map command. 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. --- diff --git a/doc/config b/doc/config index dda7453..3a9e587 100644 --- a/doc/config +++ b/doc/config @@ -1,36 +1,36 @@ # default config -nmap gf source -nmap input -nmap o inputopen -nmap t inputtabopen -nmap O inputopencurrent -nmap T inputtabopencurrent -nmap d quit -nmap back -nmap forward -nmap r reload -nmap R reload! -nmap stop -nmap pagedown -nmap pageup -nmap halfpagedown -nmap 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 complete -cmap complete-back -hmap hint-focus-next -hmap hint-focus-prev +nmap gf=source +nmap =input +nmap o=inputopen +nmap t=inputtabopen +nmap O=inputopencurrent +nmap T=inputtabopencurrent +nmap d=quit +nmap =back +nmap =forward +nmap r=reload +nmap R=reload! +nmap =stop +nmap =pagedown +nmap =pageup +nmap =halfpagedown +nmap =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 =complete +cmap =complete-back +hmap =hint-focus-next +hmap =hint-focus-prev diff --git a/src/config.h b/src/config.h index d746c5c..e8e1d02 100644 --- a/src/config.h +++ b/src/config.h @@ -32,10 +32,10 @@ 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} }; diff --git a/src/keybind.c b/src/keybind.c index 9306068..668a17b 100644 --- a/src/keybind.c +++ b/src/keybind.c @@ -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])) {