Reputation: 51124
I've just tried to record a macro to help me switch word-wrap in editors on and off quickly, but all the macro records is DTE.ExecuteCommand("Tools.Options")
, which leaves me with a big, dumb open dialogue when I try and execute the macro.
How can I record or write macros to help me quickly set options, without the rudeness of the modal options dialogue? Are there any extensions I could use for this?
For a bonus point, is there a way I can automate Options changes without using macros, and without having to write a big VS extension?
Upvotes: 1
Views: 414
Reputation: 6984
switch word-wrap in editors on and off quickly
Maybe I'm confused, but word wrap is toggled by Ctrl-E, Ctrl-W
.
is there a way I can automate Options changes without using macros
You can use the Visual Studio command window here:
View > Other Windows > Command Window
In addition to the Visual Studio Commands list, you can enter any Menu command in the command window. I found Edit.ToggleWordWrap
, which toggles word wrap in the currently-focused text editor.
To bind a command (or several commands) to a shortcut key, create an Add-In (not a big VS extension ;). In your case, the relevant line would look like this:
cmd = cmds.Item("Edit.ToggleWordWrap", 1);
Upvotes: 2
Reputation: 755587
There's really no way to record a macro to set anything in the Options dialog. The macro recording infrastructure in general can't handle modal dialogs and essentially ignores them. The options dialog is no exception here.
The best hope here is to
The vssettings file is the more viable, and far simpler, option
Upvotes: 0