Indent Selected Text Left/Right

I can't believe I'm not seeing a <-- or --> button in the toolbar to shift selected text left or right.

I must be missing it but it's clearly not obvious if it is indeed there.

Also, is there a shortcut for this?  highlight text and a keyboard shortcut to move left/right?

move.jpg

14 comments
I can't believe I'm not seeing a <-- or --> button in the toolbar to shift selected text left or right.

Toolbar is fully customisable ("Right click | Customise" ... or "Settings | Menus and Toolbars") -- you can add such buttons there manually if required.

Also, is there a shortcut for this?  highlight text and a keyboard shortcut to move left/right?

Shortcut to highlight text:

  • Shift+nav buttons (up/down/left/right/home/end/pgup/pgdown)
  • or just mouse only


Shortcut to move highlighted lines left/right:

  • Edit | Indent Selection (Tab)
  • Edit | Unindent Selection (Shift+Tab)



Other useful (frequently used, at least by me) shortcuts:

  • Ctrl+D -- Edit | Duplicate Line  (current line, when no selection i smade) or "Duplicate Block" (when selection is there)
  • Ctrl+Y -- Delete current line or selected lines
  • Ctrl+W -- Edit | Select Word at Caret (especially useful when invoking multiple times in a row)
  • Code | Move Line Up/Down
  • Code | Move Statement Up/Down
  • Edit | Paste from History
0

Hello-
Default keyboard shortcut on windows...

tab = -->
shift+tab = <--

7

funny never used shift + tab, duh.  Thanks.

2

thanks Andriy

what do you mean by these:

  • Code | Move Line Up/Down
  • Code | Move Statement Up/Down
  • Edit | Paste from History


what are you hitting on your keyboard, what is Code and Edit, is that file menu or keyboard?

0

Main Menu | Code | ...
Main Menu | Edit | ...

You will see what shortcuts are assigned to them there as well. In case if shortcut is too long / inconvenient (some shortcuts require to press 4 keys) you can assign your own as "Settings | Keymap"

P.S.
Use "Help | Find Action" -- very useful for anybody who uses this IDE, but especially for new users

-1

I have a question, why am I not allowed to use tab wherever I want to? This is driving my crazy using jetbrains products...

0

@Ludwe631

Please clarify your question.

Right now I'm not so sure what you are trying to say here.

0

Well, basically, my goal: to simply press the "tab" and make the text on that row move to the right, and to use "shift tab" to move it one step to the left. I mean it does this in jetbrains IDE however, it only allows me to indent out to the "designated" location, then i cannot tab it out longer. This seems like an impossible task, whereas in Eclipse its default. Do you have any solution for this? 

So lets say i do something like this, and for some reason I want to tab out the first element one step further. Eclipse, no problem. Jetbrains, cant do it, why?

ARRAY = [

    1,

    2,

    3

]

ARRAY = [

            1, 

    2,

    3

]

-1

I'm terribly sorry but I still do not see the issue here. I mean -- I press tab while having caret on first array element ... and it indents it just fine for me (I'm on Windows 10, using PhpStorm 2016.2.4 and Default keymap).

1) Where is caret located when you press Tab and it does not work? is it before "1" or after?

2) OS, IDE version and Keymap used?

3) Can you record and share some simple screencast please. It may bring some possible nuances into the focus.

 

For me it just works.

The only things that I can think of right now:

1) You have some plugin that interfere somehow

2) When it does not work the caret is located somewhere at the end of the string ... then IDE inserts Tab symbol instead (default behaviour: if pressed while having selection or caret is before any meaningful characters in that line -- pressing Tab indents the line(s); if caret is "inside" the text (has any non-whitespace symbols before it) -- inserts actual Tab symbol).

0

So basically, after you said this, I tried chaning KeyMapping from Emacs to Eclipse (Mac OS X) and it works now. I cannot really understand why because this screen looks EXACTLY the same for both mappins. This screenshot is when searching keybindings for the "tab" character.

 

 

 

So now I can easily do this:

But when using Keymap Emacs, it does not work. Do you have any idea why this is?

0

The only difference I see is that "Emacs" keymap has Tab assigned to "Emacs Tab" action while other keymaps has "Tab" action (yes -- those seem to be 2 different actions -- I have no clue what the difference is).

P.S. Keep in mind that when more than one action in the same context has the same shortcut ... then there is no guarantee what's exactly will be called first (and if 2nd action will be called at all).

You may just remove any shortcuts from "Emacs Tab" and "Tab" actions -- in this case I expect "Edit | Indent Selection" to take over.

0

He is saying:

In Pycharm

Menu > Code > Move Element Left

Menu > Code > Move Element Right

is unable. Why?

if you click ctrl+shift+alt+left or right == will turn the window of your screen in Window 10.

 

0

Rdsilvalopes You have a program running in your system that intercepts the shortcut. Check your VGA driver settings.
https://superuser.com/questions/303789/how-can-i-disable-ctrlshiftarrow-from-causing-my-screen-to-flip

0

Please sign in to leave a comment.