Live templates in PhpStorm not useful - phpstorm

I installed "Live Templates for Angular" plugin in PhpStorm. I think something is wrong with suggestion (triggered with Ctrl + Space). I have to write whole snippet a-component to get to right suggestion.
Can I improve it somehow in settings?
Here is a gif:

It's because the template name (abbreviation) has a dash - in it ... and when completing IDE treats a and component as separate parts until whole match is found (in case you were doing some subtraction operation with two variables). At very least that's my understanding of this behaviour based on my own usage experience.
You may just change the abbreviation and remove - from there and it will be much better recognized as valid completion item. But that may not be ideal in long run (potentially may have issues when plugin will be updated with new templates etc.)
To bypass it ... just use Live Template specific completion where only Live Templates will be listed. For that invoke shortcut assigned to Code | Insert Live Template... action (Ctrl + J on Windows using Default keymap) at any time when you're typing your Live Template abbreviation.

Please make sure the applicable context yet.
Apply to the specified type of file, or check everywhere.
Like below:

Related

How can I create PHP templates for PhpStorm with existing code inside?

I want to create a php Template in PhpStorm with has a comment block at the top with the usual info (author, creation date, class etc.) but also with a bunch of premade functions.
The purpose of this is that I want to make PHP Unit Class Template with the setup/teardown functions already coded, because these template are used for one project I don't expect they will change as the setups just set global which really should always be set up to make building the test easier (i.e. getting global scoped helpers).
I've tried creating the file templates however when I've copied the code into the template, any variable comes up as in input box when I go to create the file, which might be fine for me using but for someone who's using it for the first time they can screw up by filling in values for this-.
So I am wondering, how can I create a template in PhpStorm which has code in it?
You need to escape $ character which is used by Velocity template engine internally (has special meaning).
You can use ${DS} or \$ for that; so $this will become ${DS}this or \$this .
P.S. ${DS} is a safer choice overall as in some cases \$ may not work.
The official help page has it all explained: https://www.jetbrains.com/help/phpstorm/file-template-variables.html

vim: project wide auto suggestion

When using eclipse upon pressing control space, it show a list of all possible matching function calls irrespective of the file locations.
Is there a similar plugin for VIM ?
I am using vim7.4 and shougo's neocomplete (https://github.com/Shougo/neocomplete.vim). I actually switched from shougo's neocomplcache to this plugin. I am so far satisfied with the auto-complete feature provided by the nice plugin.
I don't write php code though, I made two screenshots of one of my python project.
screenshot 1,
left side is a module tmux_cmd.py, right side I have imported the module, when I type the module name, the plugin suggested me all functions/variables in that module.
screenshot 2,
in same module, when I type keywords (load) in this case, the plugin shows me all possible functions. I opened tagbar on right side to show functions in the current module. I can press <TAB> to choose the one I want, or keep typing something else if I just want to have something else, like loadnothing.... In the screenshot I pressed <tab>
You only need to index your project with ctags (see :help tags and :help ctags) and vim's built-in omni completion will do what you want for PHP when you press <c-x><c-o>.
Vim doesn't do auto-completion, though, you'll need a plugin for that like the one cited by kent but there are others.

Add a new command to notepad++

Notepad++ is my go to editor for most things. I would like to develop a new command(keyboard shortcut) for doing something unique. Anybody has any pointers regarding how I can do this?
I would like to create a command which arranges selected text in certain order based on the characters found. I would also like create a keyboard shortcut for running the same command.
You have several options:
develop a macro - examine Macros dropdown menu in Notepad++
use AutoHotKey which can send keystrokes/mouseclicks, run apps/DLL's, work with clipboard, read any system settings, take values from input boxes and many more. Please see here for its sample usage with Notepad++
use JN plugin for Notepad++ and script your functionality in JavaScript - example. Similarly, there is a Python scripting plugin, too.
write your own N++ plugin. You get the best control, but without experience this is the most difficult option.

How to configure FlashDevelop for unit test builds?

I'm using AsUnit for unit-testing my current AS3 project. My Main() is basically:
if ( UnitTest )
runUnitTests();
else
runMainProgram();
where I change UnitTest before building depending on whether I want to run the program or run the unit tests. Is there a way that makes it easier to switch between the two modes?
Optimally, I'd use F5 for building with UnitTest=false and another hotkey for building with UnitTest=false. What is the closest I can get with FlashDevelop?
You can do the following in FlashDevelop
if(CONFIG::debug) {
trace("Debug");
} else if(CONFIG::release) {
trace("Release");
}
These correspond to the drop down in the toolbar next to the play button.
See this link: http://www.flashdevelop.org/wikidocs/index.php?title=AS3_Conditional_Compilation
In terms of the shortcut, just create a macro that switches the release mode then hits play. From there you can add any shortcut you would like to your macro. So one shortcut will launch the course into debug/release mode as required.
Also note, you can have other CONFIG::bla's - so you might want to have CONFIG:unit1, CONFIG:unit2, etc, etc. See above link.
Easy solution:
duplicate the FlashDevelop project file (.as3proj) and name it "MyProject_tests.as3proj",
open this project, create a new ProjectTests class and set it as the main class,
change the output SWF in project settings.
Add another project file. To run the test using it as the primary. "Document class" the context menu on the file.
Like Chris mentioned, you can use FlashDevelop's Compiler Constants to do what you need, though it is a bit cumbersome turning these constants on and off.
However, there is a FlashDevelop plugin called Config::Toggle that makes that significantly quicker by providing an additional panel where you can enable/disable boolean constants with 1 click. The linked website describes the value of the plugin far better than I ever could. Hope that helps.

How can I disable "HTML Checking" in NetBeans?

I'm using NetBean's Compile on Save setting, and it's really handy when I'm editing a single file. But when I'm dealing with a pair of (or more) class files and am switching between the files, I have a problem:
The Task tab is nearly worthless since it is littered by HTML "error" messages(+) from many dozens of HTML files in the project that are generated by some external tool. The number of HTML errors swamps out any actual Java errors.
What I want is one of:
A way to tell NB to ignore the directory with the HTML files ("help").
A way to turn off HTML "errors" or even to specify HTML2.
A way to filter "Task" errors by file type, parent folder: all Java is under "com".
I've perused the settings and properties, but found nothing that helps.
<rant> Yet another reason I hate an IDE that use the "Take Everything in the Folder" approach.... </rant>
+ = The files are valid HTML but probably not XHTML. Plus, half the messages end abruptly, with something like: "Unexpected tag <TD> found, expecting one of
I found the answer, or at least one that works for me (NB 6.8, YMMV):
In the Tasks tab, click the filter button in the left,
Choose Edit...
In the Task List Filter dialog:
Click New
Enter a value for Name (such as "No Script Messages"),
Uncheck the Scripting Language Tasks option
Click OK.
If the filter doesn't work immediately, you may wish to close/open the Task window or Netbeans.
Hope that helps someone else.
You can go to Tools->options->Editor->Hint .
You can easily select the right options from there .
I want to use task list to only track my To Do list and It can be a real pain when Netbeans starts showing me #todos from included libraries and all sort of compile errors that I am not interested in. If your use case is like me (not interested in compile errors etc. in task window) then you can do following:- (Netbeans 7.1.2)
1) Tasks window | Right click filter | Edit
To edit the default filter.
Click default filter in left hand panel.
Right hand panel, under Type tab - un-check compile errors and issues
2) You can go to Tools | Options | Miscellaneous
Go to Tasks tab now.
Here you can add/remove the To Do strings that you want.
You can create your own custom todo string or make sure that only one of them is listed (what you use)
Now apply default filter and you will only see your #todo tasks. sane and sweet :D