Re: d for closing a tab in Visual Studio?
Is there any chance of getting d to be the 'Close a tab' for Visual Studio while in -- NORMAL -- mode? Vimperator does this for closing tabs in Firefox and I find it very intuitive.
You are not logged in. Please login or register.
Is there any chance of getting d to be the 'Close a tab' for Visual Studio while in -- NORMAL -- mode? Vimperator does this for closing tabs in Firefox and I find it very intuitive.
Shane, "d" is usually the delete operator (dw deletes to the next word, d$ to the end of line, dG to the end of the file, dd to delete the line...), so it's unlikely most people would welcome it.
Still, it's doable. First thing, you need to find the VS command that closes a Tab. I usually do this with Ctrl-F4, so I go to Tools|Options|Keyboard, press Ctrl-F4, and I see that it maps to "Window.CloseDocumentWindow". To execute this from ViEmu, you could type ":vsc Window.CloseDocumentWindow" and press return (try it, it works).
Now, you only need to map the 'd' key in normal mode to this.
:nmap d :vsc Window.CloseDocumentWindow<return>
You have to spell out "<return>" above, typing it character by character. The :nmap command understands this.
After this, 'd' in normal mode will close the current document window. If you want to make it permanent, you can create a "_viemurc" file either in your user directory or in ViEmu's installation file, and it will be executed every time VS starts.
I would chose something other than 'd', though. <Ctrl-D> is an option (although you'll be losing it's usual half-page-scroll functionality). Anyway, the way to map it would be:
:nmap <ctrl-d> :vsc Window.CloseDocumentWindow<return>
All this is explained in the manual if you need more details, or feel free to ask me here or via any of the other means.
Worked great. Thanks. It's cool to know that it's so easy to remap keys.
Ahhh I see the problem with remapping d. I actually prefer ALT + D so I went that route. Thanks for the Viemu lesson
You're very welcome, no problem!
-- Jon
Currently installed 3 official extensions. Copyright © 2003–2009 PunBB.
[ Generated in 0.025 seconds, 9 queries executed ]