Commit Graph

34 Commits

Author SHA1 Message Date
Daniel Hahler
8d77e89d65 Improve/simplify filetype handling for buffers (#745)
* 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.
2016-09-07 19:51:16 +07:00
solawing
b7fcce30e0 fix visual placeholder multi call 2016-08-13 11:32:10 +08:00
Tommy Allen
104e571c4a Allow file type to be passed into UltiSnips#FileTypeChanged() 2016-08-04 12:36:03 -04:00
chemzqm
4e2e897de8 change g:current_ulti_dict_all to g:current_ulti_dict_info 2016-01-11 23:58:42 +08:00
chemzqm
6a69a44154 add all param to UltiSnips#SnippetsInCurrentScope 2015-12-28 20:01:26 +08:00
Stanislav Seletskiy
76ebfec3cf autotrigger: make snippets expand without <tab> 2015-10-09 16:00:24 +06:00
Holger Rapp
e48d8a28e5 Rollback "Merge support for auto expand."
Due to performance degradation reported in #552.

This reverts commit 490430f91d, reversing
changes made to cf2c473a8e.
2015-08-21 07:38:34 +02:00
Holger Rapp
490430f91d Merge support for auto expand. 2015-08-17 08:30:59 +02:00
Holger Rapp
cf2c473a8e Define UltiSnips#FileTypeChanged always
This is called via ftdetect/UltiSnips.vim, and needs to be defined
also if UltiSnips fails to initialize, e.g. because of missing Python
support.
2015-08-12 06:59:04 +02:00
Daniel Hahler
5e2f58c35f Define UltiSnips#FileTypeChanged always
This is called via ftdetect/UltiSnips.vim, and needs to be defined
also if UltiSnips fails to initialize, e.g. because of missing Python
support.
2015-08-10 22:46:05 +02:00
Stanislav Seletskiy
f80414fac5 prototype of autotrigger 2015-08-03 14:41:25 +06:00
Holger Rapp
6b12b11411 Only set autocommands when there are snippets.
This speeds up cursor movement when there is no snippet activated.

Fixes #518.
2015-07-11 17:11:04 +02:00
Holger Rapp
2ed217a059 Remove deprecated functions like a boss. 2015-07-11 16:36:09 +02:00
Holger Rapp
becab789a8 Remove bootstrap.vim. Simplify startup.
The python module is now pulled in autoload/UltiSnips.vim. This means
that parsing of the .vimrc will only map the keys and set some options -
very cheap.

Unfortunately, the autocommands set up in plugin/UltiSnips.vim pulls in
the python code basically immediately still.
2015-07-11 16:17:50 +02:00
Holger Rapp
c3a0924b77 Require Vim 7.4 in preparation of removal of compatibility features. 2015-06-11 07:53:47 +02:00
petobens
0775156de1 Don't escape backslashes in :UltiSnipsEdit 2014-09-13 20:15:59 -03:00
Holger Rapp
c681560b42 Add 'context' value to g:UltiSnipsEditSplit. 2014-08-29 07:30:26 +02:00
David Fisher
1129ca67d2 Fix UltiSnipsEdit for g:UltiSnipsSnippetsDir paths that include spaces 2014-08-28 16:43:36 -07:00
petobens
2c3c4a7776 Add 'context' value to g:UltiSnipsEditSplit 2014-08-28 09:34:33 -03:00
Daniel Hahler
210304884a Define all/other dummy functions used in autocommands 2014-04-09 19:32:26 +02:00
Daniel Hahler
7da9dbe2af Add UltiSnipsFileType augroup and unset it if UltiSnips is disabled 2014-04-09 19:31:00 +02:00
Daniel Hahler
c57c717e33 Delete autocommands when Bootstrap failed
When bootstrapping fails to setup `g:_uspy` (e.g. without Python),
the functions used in the autocommands are not being defined.

Since it makes no sense to have autocommands defined for UltiSnips in this
case, this patch deletes them (via a new augroup 'UltiSnips').
2014-04-09 19:04:30 +02:00
Holger Rapp
f40c3ac5e0 Made UltiSnipsEdit! more consistent with multiple filetypes. 2014-03-15 15:55:03 +01:00
Holger Rapp
6398a598b5 Made UltiSnipsEdit more useful and consistent.
It now by default only edits private files, add a ! if you want to edit
non private files.
2014-03-06 09:10:48 +01:00
Holger Rapp
2d18d53656 Change initialization to make session work.
Fixes #216.
2014-02-20 11:06:45 +01:00
Holger Rapp
cecc7aad88 Fixed a typo that might make problems when there is no python available. 2014-02-19 22:54:37 +01:00
Holger Rapp
c1b41d0fbf Adds 'priority' keyword and removes '!' option. 2014-02-19 21:04:52 +01:00
Holger Rapp
a949fc606e Remove no longer needed loading of vim script from python. 2014-02-17 08:52:10 +01:00
Holger Rapp
ba772b0d14 after script maps Keys again. Needed some refactorings. This fixes supertab integration and closes #212. 2014-02-17 08:15:04 +01:00
Holger Rapp
e7868dd4fb Removed undocumented and untested g:UltiSnipsClearJumpTrigger. 2014-02-16 14:02:06 +01:00
Holger Rapp
2eb82d127b Moving towards Snippet providers.
Removed parsing responsibilities from SnippetManager and instead put
them into the new module providers. Renamed private methods on
SnippetManager that are not meant to be called by external libraries to
start with _. Refactored tests so that expected failures can be tested
and therefore removed the testing flag from SnippetManager.
2014-02-15 00:54:04 +01:00
Holger Rapp
a9d946135f Removed an unused Vim function. 2014-02-14 23:58:44 +01:00
Holger Rapp
c137922918 Create UltiSnips.UltiSnips_Manager in all cases.
If a python module tried to load UltiSnips without the autoload file
being run first, UltiSnips_Manager was not defined. This broke YCM and
maybe others too. This fixes
https://github.com/Valloric/YouCompleteMe/issues/820.
2014-02-13 21:24:58 +01:00
Holger Rapp
82ca377aaf Moved the core of the plugin into autoload. This will not really impact loading times because UltiSnips is loaded on the first CursorMovedI command anyways, but it might fix some issues with --noplugin. 2014-02-11 07:56:56 +01:00