Re: Ctrl-W in insert mode for backward-word-delete?
Is there a setting to make ViEmu perform backward-word-delete when I press Ctrl-W in insert mode? I'm a frequent Ctrl-Wer.
You are not logged in. Please login or register.
Is there a setting to make ViEmu perform backward-word-delete when I press Ctrl-W in insert mode? I'm a frequent Ctrl-Wer.
Hi wthrower,
It's not there yet. I'm taking note of this, and I'll try to add it in one of the next builds of ViEmu. Probably won't work very well in the Word & Outlook version, but it should work fine under VS and SQL Server.
Thanks and best regards,
Jon
Fantastic. I'm evaluating ViEmu in VS, which is what I care about most.
I'd also love to have a ViEmu replacement for the multi-line text entry in Firefox (or multi-line edit controls in general). I would love to be using ViEmu right now to write this post.
I'd love to have it myself too, but I think I'd end up in a mental hospital if I got into that right now - getting into Word & Outlook has been a huge, painful effort, and I need to rest from that type of work!
In the future, who knows?
For the time being, I have a work-around that breaks other (much less important to me) ^W behavior:
In Tools, Options, Environment, Keyboard, I've mapped Ctrl-W to Edit.WordDeleteToStart.
Good. You will lose the normal mode Ctrl-W window-management commands but you get what you want
I'll let you know as soon as I have a better fix!
Now that I'm using ViEmuW/O, I would really like Ctrl-W work there as well. What's the complication?
Ugh, Word is a lemon. The same as :imap insert mode key mapping, t is doable if you uncheck "Implement insert mode passing all input to Word", which is enabled by default, but this disabled autocorrection and autostyling, which are very much missed.
The problem is that Word creates an invisible "work area" wherever you are typing. I guess it's used for undo-grouping, autocorrection and autostyling, but I really have no idea (it's undocumented). It inserts 128 bytes of something at the insertion point, there is no way to retrieve what they contain, and the insertion point is somewhere in the middle of those while typing (usually 1 byte before the end). If you do whatever with that programmatically, it usually doesn't work or just messes up editing - it never works. ViEmu needs to access the current line's contents in order to do anything (Ctrl-W for example), and I just wouldn't be able to access it.
Even with simple input mapping, say, ":imap a b" if ViEmu tries to insert a "b" at the current insertion position when you press "a", this operation fails, due to the dreaded "temporary work area".
If I implement all of insert mode programmatically (by inserting and deleting characters directly, instead of passing the input to Word), it works fine, because the work area is never created, but then autoformatting/autostyling doesn't work.
Of course, no way to get any documentation about this behavior from MS. The existence of the "work-area" is not documented at all, not to talk about ways to interact with it. I tried several methods to try to trigger its removal (as it happens when you press ESC, etc...), but I didn't succeed.
I apologize for the limitations, but Word is really a beast to deal with.
Hmm... you're intercepting the Esc key when in insert mode, right? Can you also intercept Ctrl-W and send Ctrl-Shift-Leftarrow, Backspace to Word? (For that matter, can you intercept 'a' and send a 'b' keystroke event instead?) This isn't direct as manipulating the line, but it seems like it would accomplish the goal.
If I recall correctly, due to the way I process keystrokes, I can't really change the keypress. I can either let it pass through, or null it out and do something through Word's object model (which is quite limited). In any case, I'll try it out in the next few days and let you know - as I implement Ctrl-W for Visual Studio, I'll also try out banging at Word a little bit more
Thanks!
I've added full support for Ctrl-W and Ctrl-U in ViEmu/VS and /SQL 2.1.8 and ViEmu/W&O 1.0.16, both in insert mode and when typing a search or ex command:
http://www.viemu.com/forums/viewtopic.php?id=182
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.
[ Generated in 0.044 seconds, 11 queries executed ]