Compartilhar via


Did you know... How to convert spaces to tabs and tabs to spaces? - #019

There are four commands that involve converting spaces to tabs and tabs to spaces.

Edit – Advanced – Tabify Selected Lines – Replaces the leading whitespace on a line that contains the selection with tabs. 

Edit – Advanced – Untabify Selected Lines  – replaces the leading whitespace on a line that contains the selection with spaces. 

Tabify and Untabify Selected Lines menu items

Note: The Edit – Advanced – (Un)Tabify Selected Lines isn’t supported for VB. 

Edit.ConvertTabsToSpaces – converts selected whitespace to spaces. 

Edit.ConvertSpacesToTabs – converts selected whitespace to tabs. 

Convert Spaces To Tabs shown in Tools Options Keyboard page

Note:

  • Theses commands are not available by default on the Edit menu, so you’ll either have to bind it to a keyboard shortcut, put it on the menu yourself (tip coming soon), or run it from the Ctrl+D Window (tip coming soon).
  • You may have to uncheck Tools – Options – Text Editor – Basic – VB Specific – Pretty Listing (reformatting) of code to use Edit.ConvertTabsToSpaces and Edit.ConvertSpacesToTabs – provided you’re using tabs as the default and want to convert something to spaces.  But the other way will work fine (if default is tabs and you’re converting spaces to tabs)

Technorati tags: VS2005Tip, VS2008Tip

Comments

  • Anonymous
    August 20, 2007
    Wow, this was new to me. P.S It would be more easy for people to usnderstand if you also write somewhere that you are talking about visual studio

  • Anonymous
    August 20, 2007
    PingBack from http://msdnrss.thecoderblogs.com/2007/08/21/did-you-know-how-to-convert-spaces-to-tabs-and-tabs-to-spaces/

  • Anonymous
    December 06, 2007
    The comment has been removed

  • Anonymous
    December 08, 2007
    The comment has been removed

  • Anonymous
    July 13, 2008
    スペースとタブを相互に変換するには、次の 4 つのコマンドがあります。 [編集] メニューの [詳細] の [選択行にタブを設定] : 選択した行の先頭の空白をタブに変換します。 [編集] メニューの

  • Anonymous
    August 03, 2008
    Есть четыре команды, предназначенные для замены знаков пробела в знаки табуляции и наоборот: Edit –

  • Anonymous
    December 08, 2008
    #011、全屏模式 原文地址:http://blogs.msdn.com/saraford/archive/2007/08/09/did-you-know-visual-studio-has-a-...