Difference between revisions of "How to set up tab spaces"

From CDOT Wiki
Jump to: navigation, search
(How To Set-Up Tab Spaces)
(Added clarification to Visual studio section)
Line 1: Line 1:
This page will describe how to set up certain IDEs and Text Editors to not use the default tab character (\t) when the Tab key is pressed and instead use a predefined number of regular space characters instead.  This is useful because when importing/exporting to different editors and or platforms these tab characters can be read differently causing code to not be displayed in it's original intended form
+
This page will describe how to set up certain IDEs and Text Editors to not use the default tab character (\t) when the Tab key is pressed and instead use a predefined number of regular space characters instead.  This is useful because when importing/exporting to different editors and/or platforms these tab characters can be read differently causing code to not be displayed in it's original intended form
  
  
 
==Notepad++ v5.6.6==
 
==Notepad++ v5.6.6==
 
<i>This part uses Notepad++ v5.6.6 to set up tab spaces.  Other versions should still be similar.</i>
 
<i>This part uses Notepad++ v5.6.6 to set up tab spaces.  Other versions should still be similar.</i>
 
+
<br />To change the default action of the tab key:
To change the default action of the tab key:
 
  
 
<ol>
 
<ol>
Line 23: Line 22:
  
 
==Visual Studio==
 
==Visual Studio==
To change the default action of the tab key:
+
<i>Comfirmed to work for Visual Studio 2008/2010.  Should be the same for 2005 aswell</i>
 +
<br />To change the default action of the tab key:
  
 
<ol>
 
<ol>

Revision as of 09:24, 25 May 2010

This page will describe how to set up certain IDEs and Text Editors to not use the default tab character (\t) when the Tab key is pressed and instead use a predefined number of regular space characters instead. This is useful because when importing/exporting to different editors and/or platforms these tab characters can be read differently causing code to not be displayed in it's original intended form


Notepad++ v5.6.6

This part uses Notepad++ v5.6.6 to set up tab spaces. Other versions should still be similar.
To change the default action of the tab key:

  1. Click on the Settings menu
  2. Select Preferences
  3. Go to the Language Menu/Tab Settings tab
  4. Make sure [Default] is selected in the rightmost list
  5. At The bottom right, click the blue underlined number beside the Tab size:
  6. Press 3, and press enter
  7. Check Replace by space
  8. Click Close

This should set up all newly opened documents to insert 3 spaces when the Tab key is pressed instead of the default \t.


Visual Studio

Comfirmed to work for Visual Studio 2008/2010. Should be the same for 2005 aswell
To change the default action of the tab key:

  1. Click on the Tools menu
  2. Select Options...
  3. Click the + beside Text Editor
  4. Click the + beside All Languages (or whatever language you want)
  5. Select Tabs
  6. Type 3 for both Tab size: and Indent size:
  7. Select the Insert spaces radio button
  8. Press Ok

This should set up all newly opened documents to insert 3 spaces when the Tab key is pressed instead of the default \t.