I have made an Autohotkey script that presses left when pressed RightAlt + j and the other arrow keys in a similar way, similar to how you can move with HJKL in vim, except that everything is shifted one key to the right and you have to press RightAlt (I'm using the US qwerty keyboard scheme, hence I have no AltGr) because I got annoyed of reaching out to the bottom right of the keyboard for the arrow keys.
So, this works, I can press RightAlt + j to move right and k, l and ; for the other arrow keys. However, I want to support Shift + RightAlt + j, so that I can easily select text with those keybindings. That's why I made this:
>!+j::Send {+Left}
However, when I try to do this, it simply does nothing. It does't send j, it doesn't send left, it just does nothing.
What's wrong with this and how can I fix it?
You just put the shift modifier (+) inside the brackets, when it should be outside. This code should work.
>!+j::Send +{Left}
Related
In IntelliJ IDEA or Android Studio, Is there any keyboard or navigational shortcut to jump between a Kotlin class's companion object and the last cursor position?
Ctrl + F12 commands will show the functions in the current class including inner classes. I don't think there would be anything in particular ur looking for.
OTOH you could create anonymous bookmarks and navigate b/w them - https://www.jetbrains.com/help/idea/navigating-through-the-source-code.html#use_bookmarks
To add a bookmark on a line Ctrl + Shift + {Digit}
Then use Ctrl + {Bookmark digit} for navigating.
You can jump to a definition using CTRL + B and navigate between the previous/next cursor position using CTRL + ALT + LEFT/RIGHT (I am not familiar with the Mac keymap, they might look similar)
Is it possible to some how setup IntelliJ IDEA so that I can column select with the cursor keys similarly to how I might in Notepad++, Visual Studio, or FlashDevelop.
For instance when I'm typing code I almost always do my navigation solely through use of the keyboard. In the IDEs mentioned previously I can quickly select blocks of code by holding Shift + Alt then tapping ↑ to extend my cursor across the lines above. I can then hold Shift + Alt + Ctrl and tap ← or → to quickly jump across words and select the chunk of text I want.
In IntelliJ IDEA I have to constantly enable and disable Column Selection Mode using the Shift + Alt + Insert and even then it doesn't quite function as it does in the other IDEs or Text Editors.
Any ideas?
You can do column editing using the Edit | Column Selection Mode.
The shortcut to turn it on/off is Alt+Shift+Insert. You navigate with arrow keys to select blocks of text.
Multiline Caret (without mouse)
Windows/Linux: CTRL + CTRL(Hold) + ↑ / ↓
Mac: ⌘ + ⌘(Hold) + ↑ / ↓
ESC will end multiline mode.
Change Multi-caret Hotkey
To add a custom Keymap, CTRL+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
It is also possible to select holding middle mouse key.
Go to the Settings | Keymap and set a shortcut for Clone Caret Above and for Clone Caret Below
Most convenient way is to:
MAC: Hold Option+Shift and click with mouse.
Windows: Hold Alt and click with mouse.
On a mac, to toggle block select on/off:
shift command 8
⇧⌘8
For me on Mac:
Press once 'option' key, release it, and press and hold it again.
Now navigate with cursor to select desired code.
Press 'Esc' to exit column mode! :)
I think #Meo's answer is the most correct, but if your hand happens to be on the mouse, you can also accomplish this with Ctrl+Alt+Shift+Left Mouse Button Click. Or look for the Add Rectangular Selection on Mouse Drag in the keymap settings.
In Windows or Linux I press two times Ctrl
For Mac cmd+shift+* didn't work for me. I changed the keymap to something else and now it works seamlessly.
I am trying to X key to Alt + Right but I can't seem to get it right. This is what I have so far:
z::Send {Alt Right}
If I use it in VLC it doesn't have the same effect as if I press Alt+Right manually. I suspect it has to do with not being able to have alt pressed and then press right slow enough for VLC to get it.
Any ideas? Thanks.
Put the alt modifier outside of brackets.
z::Send !{Right}
Sometimes I have to write Java class where I need to define multiple fields of the same type. For example, I know that I will need to duplicate private final String on the next 4 lines.
Is it possible to spawn multiple carets in IntelliJ editor, so I can type on mutliple lines at the sime time?
IntelliJ IDEA 14.1 & 15
You can press Alt + Shift and using the mouse left click you can put many carets.
E.g.:
will become
typing "added" only once.
If you want to have a continuous vertical line, it's enough to press Alt + drag your mouse vertically. If there are lines with a length lower than the current position, the vertical line will be broken (carets will be placed at the end of every line) if "Allow placement of caret after end of line" is disabled (in File > Settings... > Editor > General > Virtual Space).
Another way to add a continuous vertical line is to hit Ctrl twice and then press up or down arrow key (supported in JetBrains 2016.X products, and possibly earlier).
If you cannot get the shortcuts working, check what they're currently assigned to under Settings > Keymap Add or Remove Caret, Clone Caret Above and Clone Caret Below. If they look right and you're on Linux, your window manager may be capturing the combination, e.g., for Alt + window drag operations.
See:
http://blog.jetbrains.com/idea/2015/02/multiple-selections-in-editor-using-mouse/
https://www.jetbrains.com/help/idea/2016.3/multicursor.html
I think "Column Selection Mode" could help you. You can enable it in the context menu in the editor. Then you can select multiple lines and type same text at once.
Column Select
For Windows, you can use CTRL+CTRL(Hold)+↑ / ↓. For Mac, replace the CTRL with ⌘.
Change Multi-caret Hotkey
To add a custom Keymap, CTRL+SHIFT+A, type keymap and click on the one with Settings as subtext. Search for Clone Caret Above and Clone Caret Below.
I mapped mine to ALT+SHIFT+↑ / ↓.
Bonus
Try holding combinations of CTRL, SHIFT, and arrows for improved selection power.
On Windows:
You can enable the Column Selection Mode (Alt + Shift + Insert)
And then Shift + ↑ / ↓ can select multiple columns
Hit Esc to go back to single cursor
Add/remove a caret: Alt + Shift + Mouse Click
Remove all carets: Esc
As for now(2018.9), you just:
Press middle mouse key to create a four-rows-high caret
Type what you want
Or,
Create the first line,
Press the "Duplicate entire line" key combination to create a new, identical line.
By the way, I think "multiple caret" should be like carets enabling me to edit different locations which are not necessarily vertically aligned. In Sublime Text you can press Ctrl and click. And in IntelliJ you can only "Clone caret up/down", that is to say, they are vertically aligned, which is not flexible.
In Vim, the usual way to jump to the definition of the keyword under the cursor is to type CTRL-] (as claimed by :he CTRL-\]).
But when you have a QWERTZ keyboard (see below, Strg is Ctrl), you're in some trouble: there is no separate ] key on the keyboard; you'll have to press ALT GR-9 to type the ]. So, to jump to a tag, it`s neccessary to hit CTRL-ALT GR-9 which doesn't work (and is also not feasible because you'll break your fingers if you happen to use that often).
So, how could I jump to a tag using my QWERTZ keyboard?
In addition, I'd also be glad if someone could explain why pressing CTRL-ALT GR-9 does not work.
Edit:
I'm not interested in the obvious answers "remap to something else" or "press the mouse button".
Duplicate on Vi/Vim: https://vi.stackexchange.com/questions/5732/tag-navigation-using-ctrl-does-not-work-with-non-english-keyboard-on-windows
As weird as it reads, on AZERTY keyboards (french layout specifically) $ is at the same spot as ] on QWERTY keyboards so I must hit <C-$> to jump to definition.
See if <C-+> does the trick.
On an AZERTY keyboard press:
ctrl shift 8 to go to List item
ctrl shift 7 to go from
The same in excel as
ctrl [
ctrl ]
On a QWERTZ mac keyboard Ctrl+option+6 worked for me. And jumping back worked as expected with Ctrl+T or Ctrl+O.