Sublime Text 2 auto completion popup does not work properly - sublimetext2

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.

Related

How to not close the editor window when closing the last tab in VS Code

If there's only one tab on an editor in VS Code, the default behavior is to close the editor right then and there.
Personally, and I think many others agree with me, this behavior is very annoying since the programmer would rather preserve the layout he or she created for the project's workspace.
How do I change this behavior?
I've found discussions on this topic, but all of the solutions do not seem to be the ideal one of simply leaving the editor open but empty. Most of them simply delete the related shortcuts, which seems to me like cutting your arm off just because you broke it.
Anyway, here are some useful links:
Superuser StackExchange: How to prevent VScode from closing editor when pressing ctrl+w with no tabs open?
Issue #54492: Remove CtrlCmd+W keybinding to close window when no editors are opened
The behavior of the shortcut ctrl+w is as-designed closing the application
Actually, VSCode 1.57 (May 2021) will change that:
Removed Cmd+W / Ctrl+W as keybinding to close window when no editor is opened
We have gotten feedback that users are frustrated when the window suddenly closes after having closed the last editor via rapid Cmd+W / Ctrl+W usages.
A quick poll in the team also revealed that many had the keybinding for closing a window unassigned, so we went ahead and removed Cmd+W / Ctrl+W as keybinding to close window when no editor is opened.
You can easily bring the keybinding back by configuring it as follows:
{
"key": "cmd+w", // use "ctrl+w" on windows
"command": "workbench.action.closeWindow",
"when": "!editorIsOpen && !multipleEditorGroups"
}
Note: on all platforms there is a dedicated assigned keybinding to close the window:
macOS: Cmd+Shift+W
Linux: Alt+F4
Windows: Alt+F4
If what you are looking for is to preserve empty groups as well as empty editor windows, there is an option in the preferences that gets you almost all of the way:
"workbench.editor.closeEmptyGroups": false
This has the effect that an editor group will stay open even if the last tab within it is closed.
but all of the solutions do not seem to be the ideal one of simply leaving the editor open but empty
Reddit has an answer providing you the ideal solution of leaving the editor open, but empty: close all tabs but leave editors open.
In brief, they suggest to use in rapid succession the "close all editors" and the "three column editor layout".
They suggest to create a macro like:
"macros": {
"closeAllTabs": [
"workbench.action.closeAllEditors",
"workbench.action.editorLayoutThreeColumns"
]
}
then bind it to a key combination. macrosRe is advised.
The behavior of the shortcut ctrl+w is as-designed closing the application, see #49023. It is advisable to remove the shortcut and cut the arm, since it is design to work like that. However, for version 1.43.1 a new comment was posted this year on a thread you linked. You might want to have a look at it as well.

How to disable the annoying NetBeans auto-suggest while typing

When I am typing in NetBeans 8.2, whether it is a HTML paragraph or something like an input field, this annoying auto-suggest feature keeps on popping up. It is really annoying when I try to press enter to start a new line as it will insert a load of code when I press enter, since 'Button' is automatically highlighted.
I've included a screenshot of the problem below...
How can I disable this autocorrect feature. I don't want to disable autoorrect for PHP or when actually setting up a HTML tag (so I want to use it in a situation like this... <input type="autocorrect displays here" />, but not when typing anything else).
Sorry if I haven't explained myself very well, I can't really think of a good way to describe my problem. Please, leave a commend if you need to know more.
Thanks :)
PS: I can't find any other answers on the internet because I don't know what this is called, since I want this specific auto-suggest to disappear, so please direct me to another answer and I'll delete this question if the answer is appropriate.
PPS: I think the palette may have something to do with it but I can't be sure.
I finally found the solution for this annoying problem:
Simply go to Tools/Palette/Code Clips and remove everything from Palette (all folders and items).
Now the problem is gone!
If you go into NetBeans > Tools > Options > Editor > Code Completion, you can check or uncheck "Auto Popup Completion Window" for whatever Languages you want.
If you move over to the Code Templates tab, you can also customize the specific autocomplete rules for each Language. That way, you can leave certain ones in that you find helpful and remove ones that you find bothersome.
Today I finally had enought of these * autocompletes in my * code.
Found my way thru Google to this question and found no comfort from the answers.
But this is how I did it:
Open Code Clips -manager (Tools > Palette > Code Clips)
Select all HTML-related and click "Remove"
Profit
Apache Netbeans 12.1.
Palette > Code Clips > Remove -- does not work.
NetBeans > Tools > Options > Editor > Code Completion > Disable "Auto popup completion window" -- does work.
In NetBeans 12, disabling the Auto Popup Completion Window option for HTML does not solve the problem when editing PHP files, the popup shows up whenever Tab is pressed in HTML portions of code.
The solution is to keep the Auto Popup Completion Window active for All Languages, then switch to the Code Templates tab, select Language: HTML, remove all templates from the list, and voilá. No more HTML popup suggestions, anywhere, ever. Only the good old PHP suggestions will remain active.

Chrome - type=file drag and drop

I have a weird situation. One of my users is using functionality of Chrome (current version, 49, 50), that he drags and drops a file from his folder on local computer to normal input type=file button in a form on the webpage. Once again, let me stress it even more, its normal html input, no fancy javascript, no drag&drop events and handlers, nothing like this. It just takes the name of the dragged file and puts it into the input field, as like he selected it via "normal" way, opening the file select window, locating file on harddrive, selecting the file and confirming.
In some specific situation, this stops working (while doing some edits in the page via javascript / ajax), and I need to "reenable" it.
But, and that is my question, I haven't found any documentation of this "feature" in Google Chrome (or maybe some other browsers as well, I don't know). Why it works, how it works, how it should work and what to do if it stops working :) Does anyone has any experience with this ? The only way how to "fix" it now is to reload the page. I'd love to solve it ... :)
EDIT 1 : I just did a quick test, it works and bugs the same way in Firefox on Win. It doesn't show any error in dev console or any message, it just doesn't add the file as expected.
I've found it. The previous discussion with deceze pointed me to test the javascripts I have on the page, that do not "interfere" with the input type=file ... they weren't any such scripts, but I've found that after doubleclick on the table (that I'm using for editing) this script is being called
$(document).bind('drop dragover', function (e) {
e.preventDefault();
});
and there wasn't any unbind action when table is saved ... this caused the drag and drop everywhere on the page to stop working after the edit.

PhpStorm single click preview like Sublime Text

At my new job I have to work with PhpStorm. I come from Sublime Text, and what bothers me most about PhpStorm is the lack of a single click preview of the files. In stead, it opens the files for editing and adds them to active tab, leaving me with A LOT of useless tabs.
I searched here on StackOverflow and Google, but I seem to be the only one who is annoyed by this. In Sublime it goes to edit mode only after a double click. Is there a setting or plugin to have it like in Sublime?
It's a native feature these days:
Settings... / Editor / General / Editor Tabs / Opening Policy > check "Enable preview tab"
on version PhpStorm 2022.3.2
Single Click To Open File
By default to open a file in phpstorm you have to double click it. I found this to be very annoying. Luckily you can change this to be a single click.
Steps:
Click the gear icon.
Make sure 'Autoscroll to Source' is checked
Make sure 'Autoscroll from Sourcce' is checked
http://www.ryanwright.me/cookbook/phpstorm/single-click-open-file
There is no such functionality currently available. I may only suggest to use View | Quick Definition to preview files.
Other than that: https://youtrack.jetbrains.com/issue/IDEA-130918 -- watch this ticket (star/vote/comment) to get notified on progress.
Welcome in late 2019 - we got a plugin for this now:
Plugin: https://plugins.jetbrains.com/plugin/12778-quick-file-preview
Plugin Source: https://github.com/SeeSharpSoft/intellij-file-preview
IntelliJ Issue: https://youtrack.jetbrains.com/issue/IDEA-130918
Don't forget to disable the "Autoscroll to Source" Feature, to get the full advantage of the plugin!
The closest you'll get right now is to enable 'Scroll To Source', however this will actually open the file in another tab, it will not be a preview.
Open the Project, Favorites, etc. side bar (cmd + 1 or ctrl + 1)
Click the gear in the top right
Select 'Scroll to Source'
Note 'Scroll to Source' can be enabled at the same as 'Scroll from Source', just make sure if you click on one file you wait until the sidebar catches up to click another, otherwise the sidebar will autoscroll back and forth between the two. You'll have to click one of them to break that loop.
Read more on JetBrains' website
This is now available as a native feature in the latest version: 2020.3!
See this comment on the YouTrack link someone posted above https://youtrack.jetbrains.com/issue/IDEA-130918#focus=Comments-27-4500169.0-0
Also on the 2020.3 feature list under User Experience there's a mention of "preview tab" here https://blog.jetbrains.com/idea/2020/12/intellij-idea-2020-3/

Sublime Text 2 + Emmet - not expanding correctly

I have installed emmet for Sublime Text 2...
And it works - kind a strange way
When I enter d it starts showing possibilities, but as soon as I press: : emmet shows completely different tip:
b (bottom)
So I need to press esc to close fuzzysearch box and press tab to allow Emmet do what it is used to do.
Dow, if I don't press esc before the tab key the resould is: d:bottom:, is I press esc, it desoults in correct: display:block.
Do you have an idea how can i fix that?
This happens because Emmet tries to respect default ST completions and due to lack of API support to properly handle built-in snippets: https://github.com/sergeche/emmet-sublime#tab-key-handler
By default, Emmet will not expand abbreviations by Tab if there’s autocomplete popup visible to allow users to work with default ST completions and snippets. You can override this behavior:
Go to Preferences > Settings — User
Add "disable_tab_abbreviations_on_auto_complete": false option. Make sure this file contains valid JSON.
After that everything should work fine, but you’ll no longer able to complete items from autocomplete popup with Tab key, use Enter key instead.
I had a similar issue but my fix was different to that of the accepted answer.
I had to go to Preferences > Settings — User and remove "emmet" from the ignored packages and everything started working again!