On 23/10/06, Alessandro Piras laynor@gmail.com wrote:
(define-bindings (*join-lines-command-binding* "J") (*change-single-line-from-active-binding* "cc") .....) This would make changing actual bindings clearer I think. Also I think that surely there's a better way to do something like this than "defining a bunch of variables", but I'm a noob and now i thought of it as a simple method =)
Hmm, I don't understand what you mean exactly here, but just looking at the code I don't really like the way it sits on the page :) I'm not sure why we need the global vars.
The thing I thought is about making it easier for the (end) user to change some bindings. I guess there's a better way to do it than global variables, maybe putting the bindings in a hash table or something like that... Doing so the end user can modify the bindings (or add new ones) just putting (*<name--of-the-command>-bindings* "hk") inside the define bindings form instead of having to deal with define-pattern forms (that are also repeated thru all the code, so making a macro is not a bad thing I think).
Ah, I see what you mean. I think one of the strongest points of Vim is that there is a fairly standard key map that people generally don't deviate from. For example, I type Dvorak and have only changed the home row movement keys jkhl to htjk. h and t for up and down, j and k for left and right. Vial currently supports this kind of remapping (the same as Vim's :map command), so that you can map any single keypress to any other single keypress, or in fact a single keypress to multiple keypresses, ie "D" -> "dd" perhaps. I think this level of remapping is probably sufficient. The DEFINE-PATTERN macro is not really meant to be used by end users, only for adding the default mappings. Does that make sense?
Cheers Brad