36

一般的なタブ対スペースの問題は丘と同じくらい古く、主に個人的な好み/チームのスタイルへのこだわりに帰着することを知っています.Visual Studioでスペースを使用することについて実際的な質問をしたかっただけです. タブにはいくつか気になる点があり、私たちが小さなチームである間はスペースに変更してもかまいません。そもそもコードを書くのと同じですが、以前に1回押したところを4回削除/バックスペースする必要があることを意味します。

タブサイズのスペースを簡単に削除する簡単な方法はありますか (マウスなどでドラッグする以外に)、または自分で切り替えを行った場合、最終的にはまったく気にならないものですか?

4

5 に答える 5

79

In Visual Studio, use Shift-Tab. This will go back one tab-stop, even when using soft tabs.

于 2010-06-21T16:08:25.027 に答える
1

Visual Studio 2015 で

  1. ファイルを開きます。
  2. 変更するすべての行を選択します (または、ファイル全体の場合は CTRL+A)。
  3. [編集] -> [詳細設定] -> [選択した行を非タブ化] を選択します。
于 2016-05-05T00:57:41.343 に答える
0

Yes, there's a very easy way.
You set your Visual Studio options (Tools/Options/Text Editor) to use spaces instead of tabs and then you open a source file and Ctrl-E,D (Edit/Advanced/Format Document) and it will convert them all for you!

Yay for automation!

于 2010-06-21T16:08:24.020 に答える
0

I don't think there is an easy answer to this problem. I use Xcode and Visual Studio, and both have really annoying indentation. Maybe there's an option to disable autoindentation altogether.

于 2010-06-21T16:09:10.247 に答える