sublime text, how to delete a line nicely ? - sublimetext2

How to delete a line in sublime text the same way it is deleted in intellij ?
Which is : line is deleted, and cursor is back to previous position on the newly displayed line.

Ctrl+Shift+K is the default shortcut to delete a line in Sublime Text. However, I'm not sure it will replicate the behavior you are looking for.

No, Ctrl+Shift+K sent the cursor back to the beginning of the line, which is most of the time not the required behaviour. I want the cursor not to move back but to stay as close as possible to where it was before (horizontally speaking).
The solution was to record a macro, where you toggle a bookmark, delete line above, go back to bookmark, and delete bookmark. Then bind the macro to a shortcut.

Related

VS Code: Auto-indent on tab press to match indentation of previous line

For comparison:
In Sublime (and also Atom), if I press tab under a line of code that already has 4 tab spaces, Sublime will automatically jump to the same tab spacing of the previous line (4 tab spaces).
In VS Code – when trying to accomplish the same thing – tabs will fail to 'jump' to the previous line's spacing, and force me to manually press tab multiple times, instead of once.
Is there a work-around, or am I missing something?
Sublime, Atom - 1x tab press
VS Code - 4x tab press
If you add this to your settings, you'll be able to just type out the line without watching indentation and whenever you hit enter, vscode will indent that previously written line automatically:
"editor.formatOnType": true
I know this isn't exactly what you're looking for, but I thought I might as well share and hope this is a satisfying answer.

Hide one line in Sublime Text 3

I have one line in a html file containing a base64 representation of an image. This line spans thousands of lines in the editor, which is a huge hassle when always scrolling past it.
Is there a good way in ST3 of hiding this line?
Select the text you want to hide, then from the Edit menu -> Code Folding -> Fold.
Note that folding is not stored in the session, and reopening the file or ST will display the text unfolded again.
You could also take a look at plugins designed to help you with this: https://packagecontrol.io/packages/Base64%20Fold
you can simply press ctrl+shift+{ and to revert back just press ctrl+shift+}

How to move caret to end of file without End key

I'm using a Mac, and I want to move the cursor to the last line of file without using Home, End, or Page Down keys.
Any idea?
I've tried "scroll to bottom" keymap but that only moves the scroll, not the caret.
There's a reserved Editor Action for this and it's named Move Caret to Text End. You can find this in the Preferences window (Preferences -> Keymap -> Editor Actions). The counterpart of this action is Move Caret to Text Bottom, in case anyone is interested.
In Mac, native text editors come with shortcuts cmd+up and cmd+down out of the box to easily jump to the top or the bottom of the page (along with the caret). You'd mostly want to adopt the same shortcuts on your PHPStorm IDE to make page navigation more seamless.
Try ⌘A, →.
But it's better to assign shortcut as #LazyOne suggested.

don't restart from beginning when searching text

I looked in the settings but apparently Sublime Text doesn't have an option to disable the restarting from beginning when doing a search.
I want that SB stops at the end of file when he finished searching
When you open the Find bar with CtrlF (⌘F on OS X) there is a button to "wrap" the search:
If the button is not selected (as shown above), then Find will stop at the end of the file, and not "wrap" back to the beginning. This option is also available in the Replace dialog as well.

PhpStorm 6: simple single line for cursor

I don't like using PhpStorm with the giant block as a mouse or keyboard cursor. I would like to switch it to a simple single line. My copy of PhpStorm on another computer does not look like this.
Any ideas how to disable it so it's a simple single line?
Disable the Use block caret option in settings:
Press Insert on your keyboard (again) ;)