質問

Visual Studioでは、 CTRL + k + d を押すと、コードがうまく構造化されやすいことができます。Shlime 2に同じことをするには、
役に立ちましたか?

解決

EditLineReindentで見つけることができますが、デフォルトではショートカットはありません。 MENU PreferencesKeybindingsUserに移動してショートカットを追加できます。

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }  
.

(その機能の f12 キーの使用例)

設定ファイルはJSON-Syntaxを使用するので、これらの中括弧をデフォルトである角括弧ではコンマ区切りを配置する必要があります。他のキーバインディングがすでにない場合は、KeybindingsUserファイル全体がこのようになります。もちろん

[
    { "keys": ["f12"], "command": "reindent", "args": {"single_line": false}}
]
.

他のヒント

Reindentコマンドは、 "single_line"引数がfalseに設定されていない限り、現在選択されている行でのみ機能します。

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }
.

今、 f12 を押すと、文書全体が再インデントされます。

Macの再契約を愛するようだ

[
   { "keys": ["command+shift+i"], "command": "reindent"}
]
.

環境設定>キーバインディング - user

もう1つの先端の1つ: を追加

{ "keys": ["command+0"], "command": "focus_side_bar" }
. キーボードを使用してサイドバーファイルツリービューナビゲーションを持つ

注: 複数の{}オブジェクトのセットがある場合は、各{}の末尾に追加します。

ファイルを再インファイント化するためのデフォルトのショートカットはありません。ただし、次のようにして作成できます。

コマンドパレットを押すことで、

  1. 対照 + sシフト + p (または +シフト+ p MAC)
  2. reindent e.g:rein の最初の数文字を入力します。
  3. ENTER を押してコマンドを実行するには
    (上部の最初のコマンドが Indentation:Reindent Lines を表示する必要があります。

興味があり、NetBeansの恋人とオートフォーマットのためにあなたは f12 から ctrl + へのキーバインディングを変更することができます。最愛のキーバインディングを使用するには、shift + f 。悲しい部分ファイル全体をフォーマットするには、すべて選択する必要があるということです。NetBeansはまだ上の手を持っています。誰かがその制限を克服する方法を知っていれば私はすべての耳です。そうでなければ幸せな再動向(自動式)

Visual Studio CTRL + + d + d のような同じキーでインデントする。この組み合わせ)私は提案します:

[
{ "keys": ["ctrl+k", "ctrl+d"], "command": "reindent", "args": {"single_line": false} }
]
.

Preferences>キーバインディング - user

とても簡単です。Edit=>Line=>Reindent に進みます

ショートカットキーのようなNetBeans

Preferences> Key Bindings> User Add 以下のコード:

[
    { "keys": ["ctrl+shift+f"], "command": "reindent", "args": {"single_line": false} }
]
.

使用量

CTRL + Shift + F

インデントする予定のすべてのコードを選択してから、昇華テキストの ctrl + ] をインデントする。

MacOSユーザーの場合は、コマンド + を使用してインデント、コマンド + [へのインデントに

code formatter.

simple to use.


1.Install


2.press ctrl + alt + f (default)


Thats it.

Beside of the inbuilt 'reindent' function, you can also install other plugins, such as SublimeAStyleFormatter and CodeFormatter. These plugins are better for their specify language.

Just in case this stop working for anyone like me, in OS X, the command key is identified as superso it should be able to do something like this:

[
    {
    "keys": ["super+i"], 
    "command": "reindent", 
    "args": {
        "single_line": 
        false}
    } 
]

in this case using command+i is going to indent your whole code (eclipse like :) )

I used to use Alt + Shift + F in NetBeans, I checked and there isn't any collision in the default keymap array of sublime, so I added it to my sublime and I'm using it without any problem.

For those who like the default key binding for IntelJ IDEA, select Preferences > Settings - User:

enter image description here

And paste in the following to have the command + shift + l shortcut for auto indent:

[
   { "keys": ["command+shift+l"], "command": "reindent"}
]

You can add a shortcut by going to the menu PreferencesKeybindingsUser, then add there:

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} }  

For Auto-Formatting in Sublime Text 2: Install Package: Tag from Command Palette, then go to Edit -> Tag -> Auto-Format Tags on Document

First open the sublime text.
than open preferences.
than open Key Bindings -User.
than put the below code

[{"keys": ["ctrl+shift+c"], "command": "reindent"},]

I use Ctrl+Shift+C and you also use other short cut key.

Select everything, or whatever you want to re-indent and do Alt+ E+L+R. This is really quick and painless.

This is my configuration for sublime-keymap:

[
  {
    "keys": [",+=+="],
    "command": "reindent",
    "args": {
      "single_line": false
    }
  }
]

For vim people, just use ,== to reindent the whole file.

{ "keys": ["f12"], "command": "reindent", "args": {"single_line": false} } 

You can get the reindent option by using the above code

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top