In Karbiner, how do I map the Home and End keys to Command left and Right? - keyboard-shortcuts

As a force of habit with windows, I'm used to navigating around text with the home and end keys.
In karbiner, I want to remap
the home key to command + left
the end key to Command + right
How would we do so through the simple modifications page?

Related

Is it possible to do block-comments in Google Colab?

In Jupyter Notebook, you can toggle/comment a block of selected code with Ctrl + /, but this doesn't work in Google Colaboratory notebooks. Is there a way to comment out several lines of Python code easily in a Colaboratory notebook?
I've looked in the documentation, but I came up short.
In the default Colab keyboard shortcuts, you can block comment text using Ctrl+/.
If this does not work for you, check Tools->Keyboard Shortcuts and search for "Comment Current Line" to see what the shortcut is within your current settings.
You can select the lines of code and press (Ctrl + /) to comment or uncomment your selected lines of code.
You can also use triple single quotes (''') at the start and end of the code block you are interested to comment out.
''' ...Your commented code... '''
If you are a Mac user, you can use Command + / for commenting out, and if you want to uncomment again, select the lines and then Command + /.
For Mac users who don't have an American keyboard like me: it seems like Colab thinks you are using an American keyboard for shortcuts, and so to make the '/' character you have to press the second button to the right of the 'm'. I'll leave an image to explain.
My keyboard looks like this:
As I said, I have to press the . key to make '/' as if I were using an American keyboard.
For Mac users:
first select the lines that you want to comment
second push these buttons: Command + Ctrl + Shift + /
Especially in the Italian keyboard it would be: Command + Ctrl + Shift + 7 (because the "/" character is combined with button "7")
For some reason, I need to do Ctrl + Shift + :.
Which technically is Ctrl + /.
(I use an AZERTYUIOP keyboard.)
if you come here with an Italian keyboard you should press:
command + control + .
When using Mac the keyboard shortcut is ⌘+/.
Note that depending on your layout, / cannot be directly addressed and its combination is different when combined with ⌘. For example, on a German keyboard / is [Shift]+7 but the combination ⌘+/ is ⌘+[Shift]+ß.
When you are unsure about which combination is correct, use the inbuilt keyboard viewer which provides a live view of the meaning of keys while selecting modifiers.
Keyboard Viewer: default keyboard mapping
Keyboard Viewer: modifier keys keyboard mapping

Is there a shortcut to go to the beginning/end of a file in IntelliJ?

I often need to get quickly to the very beginning or very end of a file in the IntelliJ editor. Is there a shortcut key or button that allows me to do this quickly?
I am running on Windows, if that matters.
Beginning of File: Fn + ⌘ + ←
End of File: Fn + ⌘ + →
Note: This answer was posted prior to windows specificity. Leaving it here to include MacOS alternative.
On Windows, you can use Ctrl+Home and Ctrl+End to go to the beginning and end of a file respectively.
The action is called Move caret to Page Top/Bottom, default shortcuts would depend on the OS/Keymap and can be checked here:
On Windows these are Ctrl+Page Up and Ctrl+Page Down.
To find what keyboard strokes are already defined for this, go to Preferences->Keymap and search for text start for jumping to the beginning of the file and text end for jumping to the end of the file. You'll get something that looks like this:
The right column tells you what keystrokes have been mapped to these functions. Feel free to change them to something that you find more intuitive by double clicking on the right column and following the instructions on the pop-ups.
Under preferences -> Keymap, a shortcut for Scroll to Bottomand Scroll to Top can be set.
By default, they are not assigned.
By default in windows the shortcut is
ctrl+end
You can customize the shortcut. To use only end button as shortcut go to Settings -> Keymap -> Editor action -> move caret to text end
Right click on move caret to text end and update shortcut to end
On a Mac, these following keys:
to start of the file:
option + command + [
to end of the file:
option + command + ]
After spending minutes to search on the web, i don't find the answer for just using cmd + up or down. If you are the same, as a quick workaround, you can cmd + a to select all text and press up or down to move it.

Quickfix for creating field variable - how to get back

Is it possible to get back to my previous caret position after i do a quick fix for create Field on a variable?
test = new String();
My caret is on "test" and i press ALT+ENTER -> create field 'test'
caret goes up to the top of the class and i can edit the Type then i press TAB to get to the name of the variable but after that i only can press ENTER and i don't go back to my line in the code.
I tried ENTER, TAB, ESCAPE.
Refactoring to Field works fine.
Use Intellij shortcut for navigating to last cursor location.
Mac: Alt + Command + Left Arrow
Win: Alt + Control + Left Arrow
Similarly, you can also cycle forward to the last cursor location using
Mac: Alt + Command + Right Arrow
Win: Alt + Control + Right Arrow

Move text cursor to previous string when I am at the left corner of current string

Is it possible in IntelliJ IDEA to move cursor to previous string when it is at the left corner of current string and I am pushing on left arrow keyboard key.
Let me explain:
1) Text cursor at the left corner of line 4
2) I am pushing on left arrow keyboard key
3) All I want to get - move text cursor to end of previous (3) line
But IDEA not moving text cursor from previous line, it just stays there.
Help me please.
This is because by default IntelliJ allows placing the caret after the end of line. When you press your ← key, it does not move as it would have to go to the infinite right side of your file, which is not very convenient (at least that's how I understand it :p).
Go to Settings > Editor and uncheck Allow placement of caret after end of line, this will solve your problem.

How do you deselect the text in a rename dialog without moving the cursor, with the keyboard, in IntelliJ IDEA

I'm using IntelliJ IDEA 10.5.2
Example:
Say I want to rename this class to SomeAwesomeClass.
If we do the Rename refactoring we get a dialog like this:
It has the cursor in the right place however the text is selected. So if we started writing "Awesome" the original name would disappear. So what I want to do is keep the cursor position but deselect the text.
I have not been able to find any way to do this. All things I've tried ether moves the cursor or removes the text or does nothing.
Left or Right keys goes to the left or right.
Up or down does nothing.
Esc closes the dialog.
PageUp or PageDown does nothing.
Home or End goes to left or right.
The fact that the cursor is in the right place to start with makes me believe this is a existing feature...
In 11-eap (110.365) when you rename a class (Shift+F6):
at first full class name is selected and you have a dropdown with suggested names, press Esc
full class name is still selected (dropdown gone), press Esc again
you have class name unselected, and can write at cursor
Note a third Esc will exit rename.
In earlier versions (10.5.2) you can do a trick:
Before rename select one character (shift+arrow forward) where you want to end up (in SomeClass select C) then Shift+F6 and arrow back. I know it is a lot of keys to presses but in a long class name this helps.