Comprehensive CodeIgniter completions for Sublime Text 2 |
[eluser]martin_redola[/eluser]
I got a little sick of typing functions like Code: $this->load->view('header', $data) Code: $this->db->insert('mytable', $data) You can grab it from the Github repo here: https://github.com/martinredola/sublimet...ompletions. Then just pop it in your /Packages/PHP folder. Remember that Sublime Text is smart, so just typing thdbins will be enough to bring up Code: $this->db->insert('mytable', $data) It has saved me so much trouble that I thought I'd share.
[eluser]kreamik[/eluser]
hi how to use this completion? i have add it to my : C:\Users\Kreamik\AppData\Roaming\Sublime Text 2\Packages\PHP and nothing happen .. what i miss?
[eluser]martin_redola[/eluser]
In Sublime Text 2 go to Preferences > Browse Packages and then double click the PHP folder. Put the sublime-completions file in there and restart the program. Auto complete must be set to true for the completions to appear as you type, otherwise press Ctrl+Space.
[eluser]CroNiX[/eluser]
I don't use sublime2, but doesn't sublime do code completion on its own? Many apps have a hard time reading CI's singleton, so it's a common problem. If it does, perhaps this might be easier to do. I know it works for Zend Studio and a few others... You basically create a library in the library folder that looks like: Code: class CI_Controller {
[eluser]martin_redola[/eluser]
That looks like a good way of doing things if I were using a heavier IDE, but Sublime Text 2 is a text editor so it doesn't scan your projects in that way (or if it does, I've missed something big style). There are plug-ins which can do that, but I've found they don't work properly, and I use Sublime Text because it is lightweight and I don't need that extra functionality - I first and foremost need speed. So for me it was easier to write a script to scrape the CI User guide and then pile the functions into a single file and slot it into the PHP folder.
[eluser]kreamik[/eluser]
if i want to write $this->input->post nothing happen after i typed $this->input i have to press ctrl+space then scroll and take more time to find out the syntax
[eluser]SPeed_FANat1c[/eluser]
I put that file in PHP directory, restarted the program but nothing changed. Have you ideas what could be the problem?
[eluser]Unknown[/eluser]
Thanks, Martin, this is great. For anyone having trouble: By default Sublime Text only triggers on characters, so if you're trying to auto-complete by typing "$this" it isn't going to work. Instead, try typing "this" and you should see the list pop up. You can add Code: $ Code: "auto_complete_triggers": [ {"selector": "text.html", "characters": "<$"} ], The Code: < Code: $ While you're in there, might as well change it to tab completion rather than enter! |
Welcome Guest, Not a member yet? Register Sign In |