Sublime Forum

Tab completion without coma

#1

Right now when I am using tab completion inside a function and I hit “Tab” I get this selected.

Most of the times this is not useful, because you need to write the comma and maybe the quotes again. Not good.

Is there a shortcut or a way to create a shortcut to select this instead?

That would be awesome!

0 Likes

#2

You, or whoever this Package is from, will need to amend this function definition in the completion or snippet file.

0 Likes

#3

Uhm… interesting. I think it’s some package from Wordpress.

I’m quite new to ST, how can I know which package is coming this from? Where can I see the packages I’ve installed? (and by the way, remove some).

0 Likes

#4

Oh fine, I found them in “Application Support” but is there a GUI for managing packages inside ST?

0 Likes

#5

Ok… really found the place:

{"trigger": "wp_mail", "contents": "wp_mail( ${1:\\$to}${2:, \\$subject}${3:, \\$message}${4:, \\$headers = ''}${5:, \\$attachments = array} )" },

I could change that but… OMG would I have to change them all? I mean… this package has hundreds of things like this. I could try with a regexp but… is there another way to select the variable instead of the comma and the variable? Sometimes it’s useful for deleting parameters you don’t want or need. Maybe with another key, like ^+cmd+Tab?

0 Likes

#6

Ok… fine again. It wasn’t difficult at all, sorry :smiley:

But my last question is still valid: Is another way to do completions with another shortcut different than Tab? That would be killer, so you select the comma if you are going to delete it and you select the parameter if you are going to change it.

0 Likes

#7

Looking at a snippet I’ve figured out a way which could work and with some reg exp’s I’ve managed to get what I want:

They look like this now:

{"trigger": "wp_mail", "contents": "wp_mail( ${1:\\$to}${2:, ${3:\\$subject}}${4:, ${5:\\$message}}${6:, ${7:\\$headers = ''}}${8:, ${9:\\$attachments = array}} )" }

And you can use single-tabs and double-tabs to navigate through parameters.

I will test them for some days and if they work fine I will do a Pull Request.

0 Likes