3 ms·
This works really well for php on phpstorm as well (when working with bootstrap and knockout.js it's very handy). What I would love (and if it can do it I've n
by noir_lord 13y ago
This works really well for php on phpstorm as well (when working with bootstrap and knockout.js it's very handy).
What I would love (and if it can do it I've not found it) is to be able to do something like
koo(fooBar)<TAB> and get something like
self.fooBar == ko.observable("");
would be amazing!.
- makepanic 13y agoYou can create live templates yourself in intellij: Settings -> Editor -> Live Templates -> JavaScript And add the live template for abbreviation 'koo' and template text like: self.$VAR$ == ko.observable("") See http://www.jetbrains.com/idea/webhelp/live-templates.html http://www.jetbrains.com/idea/webhelp/live-templates.html for more information.
- noir_lord 13y agoI already do that. That though inserts the template and lets you tab through it. What I'm suggesting is to pass fooBar before you expand the template so that you don't need to tab through it (similar to how zen-coding does id's and classes on html) i.e. func(returnFoo,$foo,$bar,$fizz,$buzz)<TAB> becomes without having to tab through. public function returnFoo($foo, $bar, $fizz, $buzz) { }
- IanCal 13y agoIf you use vim you can use https://github.com/SirVer/ultisnips https://github.com/SirVer/ultisnips and write python code to generate the output.
- noir_lord 13y agoThat looks awesome. Embarrassingly for someone who has been a Linux user for more than 15 years I'm terrible with Vim (I can just about use it systems administration (though I often just use nano)) and use IDE's for most things.
- akx 13y agoIf ko<TAB>fooBar is acceptable, setting the Live Template abbreviation to `ko` and the content to `self.$FOO$ = ko.observable("")` will do that.
- noir_lord 13y agoThat is what I already do but it still requires tabbing through each $FOO$ rather than been able to pass that to to the live template.