Sublime Text 2 - brackets highltighting - sublimetext2

Anyway to have similar bracket highlighting with Sublime Text 2, as that of Notepad++ (and for that matter the tab highlighting), NB the vertical lines for both.

You will want to install the brackethighlighter plugin. If you haven't enabled Package Control in Sublime yet, you can find instructions on how to enable it here.
When enabled, it should provide similar gutter icons:

You can activate that experimental feature in Bracket Highlighter extension, just adding to the config file this line:
"content_highlight_bar" : true
C&P from the official Guide:
content_highlight_bar
An experimental setting which can enable the display of a vertical bar
that extends from the line containing the opening bracket to the line
with the closing bracket. Takes a boolean true or false. When
align_content_highlight_bar is set to false, the bar will be shown on
the first column regardless of indent level of the brackets. When
align_content_highlight_bar is set to true, the bar will be aligned at
the bracket indent level.
There is a bunch of information about this and other features in the Customization Chapter of the extension User Guide, here.

Related

PhpStorm is not wrapping long lines

I have reinstalled PHPStorm and adjusted the wrapping and right margin but seems it's not working what's it I'm missing?
You need to fix your Soft Wrap settings. From what I see from your first screenshot you have made an error in the list of "wrap by default" extensions: they should be separated by the semicolon ; but I see a comma , there: ... ; *.adoc, *.php.
P.S. If you do not care about specific extensions / or to enable Soft Wraps by default for ALL files, just enter * in that field.
Side note: You can always manually enable soft warping for the current file via Main Menu | View | Active Editor | Soft Wrap (should also be accessible via gutter context menu: the area where line numbers are)

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.

PhpStorm keyboard shortcut for code inspection recommended resolution?

If you run a code inspection, you might get something like this in the results panel:
Problem synopsis:
Traditional syntax array literal detected (at line 193)
Problem resolution:
Convert Array Syntax To Short
i.e. it's telling you to change array() to []
The 'resolution' is clickable and it'll fix it for you. But is a keyboard shortcut, or a way of shading identical problems (often you get a bunch of them) and having them fixed for you all at once?
You can use f2/Shift+f2 to jump to next/previous error, then hit Alt+Enter, Enter to apply suggested fixes.
Note that there is a Code | Code Cleanup... command that runs inspections against your code and applies quickfixes. But it only includes a small subset of available inspections that are considered 'safe', so that applying hotfixes automatically doesn't break anything
Use standard shortcut: same as for invoking intentions menu (Quick Fix menu) manually in Editor: Alt + Enter (for Windows/Linux, not sure what that would be on Mac)
Also you can take a look at this tool: https://github.com/fabpot/PHP-CS-Fixer

Can I save collapsed code in Sublime Text 2?

Have code I can forget about all looking nice:
However, upon closing the file and reopening it:
How can I collapse this code I'm not going to edit for years(hopefully!) and keep it hidden indefinitely?
I think the BufferScroll plugin will do what you want.
Buffer Scroll is a simple Sublime Text plug-in which remembers and
restores the scroll, cursor positions, also the selections, marks,
bookmarks, foldings, selected syntax and optionally the colour scheme,
when you open a file. Will also remember different data depending the
position of the file in the application (example file1 in window1 has
scroll line 30, file1 in window2 has scroll in line 40)
Also, via preferences, allows to enable syncing of scroll, bookmarks,
marks and folds between cloned views, live.
Update:
To install this package on ST2, you have to add the repository to your PackageControl user settings:
"repositories":
[
"https://github.com/titoBouzout/BufferScroll"
]
Now you should be able to do a standard install from ST2.

Sublime Text 2 auto completion popup does not work properly

I got problem with jQuery Snippet that i installed throughout package control. After installation I do not have popup with jQuery code hints and intalisance. Look at this video:
http://code.tutsplus.com/courses/perfect-workflow-in-sublime-text-2/lessons/adding-snippets-through-package-control
On 0:50 after typing . he got popup with code hints - I don't have this one. I have to type . on and then press Tab to display popup with snippet...
And yes, I'm in JavaScript file and I got default settings.
And after . he also got all jQuery functions like add or addClass. I do not have this one even if I press Ctrl+Space.
If you hit CTRL-SPACE you'll get the dropdown of available completions for what you've just typed.
http://www.sublimetext.com/docs/2/tab_completion.html
If you want the autocomplete dropdown to appear as you type then add this line to your User Preferences.sublime-settings file:
{
"auto_complete_selector": "source, text"
}
That should do what you're looking for :-)
Consider changing User Settings to the following:
{
// By default, auto complete will commit the current completion on enter.
// This setting can be used to make it complete on tab instead.
// Completing on tab is generally a superior option, as it removes
// ambiguity between committing the completion and inserting a newline.
"auto_complete_commit_on_tab": true,
// Controls if auto complete is shown when snippet fields are active.
// Only relevant if auto_complete_commit_on_tab is true.
"auto_complete_with_fields": true,
// As Richard Jordan suggested, this item
// controls what scopes auto complete will be triggered in
"auto_complete_selector": "source, text"
}
Open your User Settings by pressing Cmd+, on Mac or Ctrl+, on Windows
And if you want to fully grasp Sublime Text 2, I do recommend this course: Perfect Workflow in Sublime Text. It used to be free by the time I first posted this answer. I still recommend it anyways.
Which OS are you using? I'm guessing Windows.
The problem here seems to be that the jQuery snippets in the available plugins have <tabTrigger> attributes that start either with a $ or a ., which causes trouble.
Try the following: Find the jQuery package that contains those snippets (Under Preferences -> Browse Packages) and open the .sublime-snippet file of a snippet that doesn't work properly. The one you named in your post would be defined in the file event-on.sublime-snippet.
Find the line
<tabTrigger>.on</tabTrigger>
and remove the . as follows
<tabTrigger>on</tabTrigger>
Save and return to your .js file. Now see if the snippet shows up when you type o. This works for me.
I guess this is a bug in Sublime Text 2 for Windows (maybe Linux, too?), since it obviously works fine on OS X as we see in the video course you've linked.
There was an issue created on GitHub on this specific package and I now commented this info. I guess the only way to get this working is to have snippets that do not start with special characters.
I also filed a bug for Sublime Text on Userecho.
The creator of the video is using SublimeCodeIntel. What you see at 00:50 isn't Sublime Text 2's autocompletion popup, it's SublimeCodeIntel's import autocompletion popup:
Imports autocomplete - Shows autocomplete with the available modules/symbols in real time.
See the Github page for more information.