Sublime Forum

ST4 - Snippets won't get inserted at first


I have this snippet, to get inserted when write ‘pr’:


In some files get inserted at first tab, but when there some variables or words with ‘pr’ at beginning, like ‘product’ or ‘principle’, sublime insert that word, so I have to ctrl-z and then tab again to get the snippet inserted.

Is there a way to change this behavior and get the snippet inserted at first tab?

(this error also happened in last version of ST3 )



ST4 issues I found, but have no time to write proper bug reports (yet)

Since you’re using PHP, perhaps you’re getting dinged by the issue currently being discussed here?



Tried some things of that discussions, like add ‘auto_complete_include_snippets’ to settings, but still nothing.
(Typescript package isn’t installed)

The workaround of hit ctrl+space before Tab works fine,
but it changes the workflow by adding more steps.



I’m just “shooting from the hip” here. I had changed the behaviour of alt+enter, which meant it clashed with alt+enter in find in file
I’d reassigned it to return to column 0 (via a macro ReturnHome) :

 { "keys": ["alt+enter"], "command": "run_macro_file",
        "args": {"file": "res://Packages/User/ReturnHome.sublime-macro"},
          {"key": "eol_selector", "operator": "not_equal", "operand":"text.plain"}

I got round this by changing the context, having found the “scope” of find in file with ctrl+shift+alt+p (it turned out to be text.plain). I could then exclude it in the keybinding…

Could you do something similar with your issue ?

Or course, I could be completely wrong !



I have a different scope, so I don’t think your workaround will apply here.




Could you edit your keybindings (I know a hassle) to get the keys to do what you want ? I’m not an ST4 user, so don’t know the issue you face. I’m suggesting ideas rather than anything concretely useful…:thinking:



In the code of the snippet (first post) I put the letters that will trigger the snippet:


Thats means when a user type “pr”, and then press the Tab key, the snippet must be inserted.

This behaviour works ok until the last versions of ST3.
In ST3 I use SublimeIntel for php coding, but in ST4 I remove that and now I use php-intelephense,
so there’s not a problem of php coding plugins.