* Improve/simplify filetype handling for buffers
There is no need to have a FileType autocmd anymore, which for some odd
reason even had to be in "ftdetect"?!
Now it will just use the `&filetype` property from buffers, instead of
updating it on FileType events.
This allows for easier lazy-loading of UltiSnips; without this patch it
would not have updated the list of filetypes for the buffer after just
being triggered (e.g. through NeoBundle's lazy-loading).
I am using the following currently:
NeoBundleLazy 'SirVer/ultisnips', {
\ 'on_funcs': ['UltiSnips#ExpandSnippetOrJump']}
inoremap <silent> <c-j> <C-R>=UltiSnips#ExpandSnippetOrJump()<cr>
By manually defining the mapping for the trigger, I can invoke it and
NeoBundle will trigger the loading of the plugin.
Postfix snippets are an incredibly useful feature in IntelliJ IDE's.
Only recently I came to realize this [could be implemented with UltiSnippets](https://github.com/sniphpets/sniphpets-postfix-codes/blob/master/UltiSnips/php.snippets).
I think it would be a nice addition to the UltiSnippets documentation, in the hopes it could help others spend less time than I did trying to figure out how to put it together.
Grants access to:
* context match condition for context snippets (via snip.visual_text and
snip.visual_mode);
* pre/post actions (via same variable);
* context match condition to (!) lastly selected placeholder, so it is
possible now to use autotrigger snippets, that are activated by
simply typing letter while tabstop is selected;
* python interpolations to lastly selected placeholder;
It adds new type of flexibility, where just entered text can be
dynamically modified if some conditions are satisfied (e.g. dynamically
add line wraps).
I encountered an issue with Deoplete where Ultisnips suggestiosn wouldn't appear if there was a match in the current buffer with the same name as a Ultisnip snippet. This change allows the snippet and buffer match to appear side-by-side, which is less confusing.
More information can be found on the issue on the Deoplete repo here:
https://github.com/Shougo/deoplete.nvim/issues/138#issuecomment-174050309