2013-01-15 20:44:39 +0000 2013-01-15 20:44:39 +0000
26
26
Advertisement

Sublime Text 2 でテキストブロックを右/左にシフトする方法

Advertisement

Sublime Text 2でテキストのブロックを左右にずらすにはどうすればいいですか?

Advertisement
Advertisement

回答 (6)

45
45
45
2013-01-16 02:08:28 +0000

行(またはハイライトされたブロック)をインデントするには ctrl+ ] を、インデントを解除するには ctrl + [ を使用できます。

OSXではcmd + ]/[です。

tab/shift+tabも使えますが、これらはカーソルが現在ある場所から始まりますが、ctrl+[/]は行やブロック全体を移動します。

17
17
17
2013-01-17 22:04:44 +0000

colintaさんのSublimeMoveText ](https://github.com/colinta/SublimeMoveText)をチェックしてみてください。普通のプラグインとしてインストールする(パッケージマネージャでは「MoveText」と呼ばれている)のですが、キーバインドは手動で設定する必要があります。私がやったのは以下の通りです。

// MoveText
// move_text_left: Moves the selected text one character to the left
// move_text_right: Moves the selected text one character to the right
// move_text_up: Moves the selected text one line up
// move_text_down: Moves the selected text one line down
{ "keys": ["ctrl+shift+n"], "command": "move_text_left" },
{ "keys": ["ctrl+shift+m"], "command": "move_text_right" },

移動したいものをハイライトする。複数行の場合は、@Jivingsが提案したように列選択を使用します(Win/Linuxではshift+右クリック、OSXではoption+マウス)。そして、キーバインドを使ってテキストを左右に移動させます。また、キーバインドを設定して、選択したテキストを上下に移動させることもできます。

3
Advertisement
3
3
2013-01-15 20:52:21 +0000
Advertisement

列選択](https://www.sublimetext.com/docs/2/column_selection.html) を使用して、スペースやタブを挿入したり削除したりします。

または、選択したテキストをハイライトしてタブを押して右に移動したり、シフト+タブを押して左に移動したりします。

1
1
1
2017-03-07 10:56:31 +0000
  1. コードの行を選択して「タブ」キーを押すが、右にインデントするだけで動作する
  2. 2. コードの一部を前後(左右)に移動するには、キーの組み合わせを使用します。
0
Advertisement
0
0
2018-05-03 11:23:39 +0000
Advertisement
  1. find replace (Ctrl + H)
  2. 正規表現」と「選択範囲内」のオプションを選択します。
  3. スペースを挿入したいブロックを選択。
  4. すべての"^“を” “に置き換えます。
0
0
0
2019-07-17 15:40:53 +0000

行を左右に移動するには :

⌘ + ] または ⌘ + [

行を上下に移動するには :

⌘ + ctrl + upArrow または downArrow を使用します。

Advertisement
Advertisement