Closed iamFIREcracker closed 12 years ago
thanks. on its way.
Ok, I though a LOT about this particular one and I'm afraid I'm against it and here is the reason:
I know that < C-H > is the same as < BS > on old terminals or through SSH and I can actually make this "problem" happen as described, but there is a fundamental problem here that we should think about.
Inside Vim < C-H > is not the same as < BS > and we shouldn't treat it as such. < C-H > is a perfectly valid shortcut and other user might already have it mapped to something else. For instance, in my vim configuration when I type < C-H > on insert mode it inserts a { } block on the next line and position the cursor in the middle of it.
So, I'm not sure if this is just me or more people might be affected by this change so I would like to hear from you what you think.
What about making it user configurable (opt-in)? That should be a nice trade-off.
we could expose Backspace() function (along with some others) so a user could bind whatever they want.
+1.
Probably you should change the name of the exposed function into something like AutoCloseBackspace
, but in general I love the idea!
Guys, I can use all these arguments in the other way. For instance, if you're having issues with < C-H >, why not put this into your .vimrc:
imap < C-H > < BS >
duh :) sounds like solution
Artm, if you're OK with this I'll close this issue and let users configure their maps on vimrc instead of adding more and more configuration to the plugin.
sure.
I was wondering if someone could help me out here. I'm trying to get used to using ^H
instead of <BS>
, but it's hard to break the habit. Generally, I break these habits by remapping the key I don't want to press with <nop>
.
So in this case, I have the following in my .vimrc
inoremap <buffer> <BS> <nop>
However, I want to be able to use ^H
the way <BS>
works with autoclose. If I do imap ^H <BS>
, it will map to <nop>
, but if i do inoremap
, I can't use the autoclose backspace.
I can't seem to think of any way to get around this. Any ideas? Or is there any chance that you could reconsider making some of the function accessible from .vimrc? I understand that this isn't a common use case, but if it's possible that would be great.
In general, it would be great if users could access some of the functions from vimrc so it's possible to remap the default keys to something else, and then some other keys to do what the default keys did. Currently (as far as I know), there isn't a way to do this.
simplest I can think of is if we expose the Backspace as AutoCloseBackspace or something. Then you can map it to ^H
yourself
What about making
^H
behave likebackspace
while in insert mode (i.e. erasing empty pairs)? The following patch should be enough to enable such a feature.