How to reduce the length of a column selection in Pycharm/Intellij - intellij-idea

As can be seen in the screenshot the blue area represents a column-mode selection that is one line too long.
While the shift-up/down-arrow key increases the length of the selection, I can not discover any key combination to reduce its length. Instead I just start over each time. Is such a capability available?

I failed to reproduce the described behavior with the default keymap:
It may help to reset the keymap bindings to the defaults or to reset all the IDE settings: File | Manage IDE Settings | Restore Default Settings.

Related

PhpStorm IDE: Keyboard Home/Pos1 should move caret to real beginning of the line (character position 0) instead of the beginning of the first word

I'm in the process of switching (with some specific PHP production context) from Sublime Text(4x) to PhpStorm (2022.2).
I am of course trying to migrate as many features/habits as possible, as identical as possible to my new environment. Many things I have managed to do but I have a showstopper when it comes to using/keymapping the Home-/Pos1-Button as I was used to.
What I want:
Being somewhere in a line of (PHP) code I want to press the Home-/Pos1-Button to immediately get to the (really) first character(0) of the line which is the widespread default behaviour of that key.
What I get (problem):
When I hit that button once PhpStorm IDE moves the caret to the beginning of the first word/non-whitespace character of the current line and I need to hit the key again to really get to the beginning of the line. I have tried a couple of things but I get the feeling this is "intended" non-configurable behaviour...
Any help would be greatly appreciated.
I tried googling and configuring Settings > Editor > Keymap in many ways but did not succeed...
Go to Settings (Preferences on macOS) | Editor | General | Smart Keys | Home moves caret to first non-whitespace character -> disable.

Virtual space before string parameters

My IntelliJ Idea editor leaves a sort of virtual space before string arguments when functions are called (see the string "street" below):
I call it virtual because there's no character to be deleted there, but it can be seen clearly and bothers me. I'm not sure if it's a feature or a bug. I'm using the Community Edition 2016.3 on Ubuntu 16.04.
This is new feature of IDEA 2016.3 called Parameter hints. And it usually looks like:
The idea of it is that editor shows parameter hints for literals and nulls used as method arguments. These hints make code much more readable.
If you find hints redundant for a certain method, you can tell the IDEA not to show hints for this method. To disable hints completely:
uncheck Settings → Editor → General → Appearance → Show parameter name hints.
or just press Ctrl+Shift+A to open Find Action menu and type there parameter hint. Then either click Toggle parameter name hints or Appearance: Show parameter name hints menu item:
The reason why you don't see parameter names may be your UI options. Set the appearance and colors to default values.
You may have changed the code style for Java source code under File | Settings | Editor | Code Style | Java (for Windows and Linux) or IntelliJ IDEA | Preferences | Editor | Code Style | Java(for OS X).
If this is the case you have likely changed either the spacing settings for method opening braces or the spacing settings for method parameters. Just from the image I can't tell which setting is specifically causing this to happen, so could you perhaps edit in a screenshot of the your editor's current code style settings?

Intellij Idea - how to get rid of thick caret/cursor

I pressed something in Intellij and my caret shape changed to this. How to revert to the normal thickness? Using Intellij 2016.1.
Compare to this, normal thickness should be that of a bold vertical line:
Update: On Android Studio 2.1 beta, same machine, same font settings, cursor is visibly thinner.
You can .. but it's not pixel perfect. I mean -- for me the value does not seem to control thickness in pixels but rather some index (which gets applied to some predefined values) -- at least this is my impression on what I see my computer.
In any case:
Help | Find Action...
Search for registry action
Once in Registry window -- look for editor.caret.width entry
Set the new value (for me the default was 2) -- make sure that field went bold (move to another entry) to ensure that new value was accepted.
Restart IDE (this option requires it)
UPDATE (2017/04/06):
You may also try ThinCaret plugin:
Makes your editor caret 1 pixel thin (for retina users)
You can change it under Settings -> Editor -> General -> Appearance -> Use Block caret
Other caret settings are under Settings -> Editor -> Colors & Fonts -> General. Then if you scroll down to the editor section on the right, there is a caret item in the list with font/color settings.
Please check the Picture for solution.
If you got here because of the thick cursor (block cursor) that behaves differently than the normal thin one. Just press the insert (Ins) button once and you are good to go.
Go to the Keymaps section of the Preferences and add your own Keyboard shortcut if you are using a Mac. Windows users can just enable/disable Insert mode on their keyboard.

Intellij undo history size, not much?

I like to be able to undo basically several hours of work in a file. I am unsure how to configure this.
In IntelliJ settings, the clipboard settings I have tried with are 999 and 9999 and 99999 but it still too short on undos.
How can I increase this?
In Intellij settings the clipboard settings I have tried with are 999 and 9999 and 99999 but it still too short on undos.
I've failed to see what "clipboard settings" have to do with the "undo limit" (or with "undo" at all). Care to explain?
Local History is definitely the way to go here as it works across sessions, files, and whole folders -- you can undo very complex operations in one click (e.g. replace/refactor in multiple files).
In any case: if Local History is to complex or you are a hardcore person who prefers to hit Ctrl + Z quite a few times in a row instead of few clicks with Local History, you can increase undo limit (which is 100 steps by default). For that:
Open Registry (Help | Find Action... and type registry)
Find undo.documentUndoLimit entry and set your limit to a higher number (e.g. 1000).
P.S.
IDE restart may be required.
Actually, based on JetBrains Docs, for changing undo limit you should act just like below steps:
click Help on the top menu:
Click on Find Action:
Type Registry and open first result:
On the opened window file undo.documentUndoLimit and undo.globalUndoLimit and change it to number what you want.
HINT: After change you should close your JetBrains IDE and open it again.
The "Maximum number of contents to keep in clipboard" setting has nothing to do with undos.
In fact, there is no configurable "undo history size" setting in IntelliJ. See this support issue:
For rolling back complex code changes gone awry, a far better option is to use the local history.
Local History is available under the menu "VCS" -> "Local History" -> "Show History". The feature is explained as:
IntelliJ IDEA tracks any changes you make to your source files or any other file, as well as the changes that affect a directory’s content and structure. This feature will protect you from any accidental losses or modifications, even if made by other applications outside IntelliJ IDEA. Setting version labels is also available. Any time you can inspect the history of either a particular file or directory and rollback to any of its previous versions.

Get key used to change Spaces

Is there any way to programatically determine what key is set in System Preferences to change to a specific Space.
This setting is configured in the Expose & Spaces preference, under the Spaces tab. The last drop down box is titled "To switch directly to a space" and you can choose from the control key, the command key, the option key or no key.
This is the value I'd like to programatically determine.
Possible?
You could try using AppleScript's GUI scripting to programatically open the preferences pane and see what is in the drop down box. An example is here. To invoke it from Objective-C, check out Scripting Bridge if you're using OS 10.5 or later, otherwise there's an older API but I can't seem to find it at the moment.
If you want a solution that doesn't require popping up the System Preferences window and showing all its animations to the user, the actual value is stored somewhere in ~/Library/Preferences/com.apple.symbolichotkeys.plist, but the format is not human-readable. You could change the key binding from System Preferences and compare that file before and after. Keep in mind that this may be different between versions of OS X.
Hope this helps, and welcome to Stack Overflow!