Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The most convenient solution I know is to create a set of Visual Studio macros to switch to the settings you want.</p> <p>Go to <code>Tools &gt; Macros &gt; Macros IDE</code>. There, in the tree on the left, right-click <code>MyMacros</code> and choose <code>Add &gt; Add Module</code>. Give the module a name such as <code>TabSize</code>. Within this module, create subs to change the settings you want. For instance:</p> <pre><code>Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports System.Diagnostics Public Module TabSize Sub Tab3() SetTabAndIndentation(3) End Sub Sub Tab4() SetTabAndIndentation(4) End Sub Function SetTabAndIndentation(ByVal value As Integer) DTE.Properties("TextEditor", "AllLanguages").Item("TabSize").Value = value DTE.Properties("TextEditor", "AllLanguages").Item("IndentSize").Value = value End Function End Module </code></pre> <p>There is no useful documentation I know of for the string parameters. If you need to set other options, such as "Keep Tabs", the easiest approach is to make these changes manually (unter <code>Tools &gt; Options</code>). Then, using <code>Tools &gt; Import and Export Settings</code>, save these settings as a vssettings file. This creates an XML file whose structure is the same as that needed for the method calls.</p> <p>Finally, you can link these macros to command buttons or keyboard shortcuts via <code>Tools &gt; Customize</code>. Giving each macro a keyboard shortcut allows you to quickly toggle between settings.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload