Commit Graph

16 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
Holger Rapp
ffb9b79480 Do not run autocommands when using --noplugin.
Fixes #214.
2015-08-04 07:57:38 +02: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
Ye Ding
2fb8820ff4 A backward compatible solution 2015-05-27 18:33:58 +09:00
Ye Ding
00d50c3ae3 Remove augroup block
`augroup END` in filetype detection scripts can enclose 'filetypedetect'
group unexpectedly, makes following ftdetect auto commands be defined in
default autogroup.
2015-05-27 14:21:53 +09:00
tafryn
cae25e5330 Change indent level to 3(?!) spaces. 2014-09-03 07:58:13 -07:00
tafryn
9c632378a5 Add missing newline to ftdetect. 2014-09-02 07:32:06 -07:00
tafryn
f6e33387a2 Clean-up vimpager check. 2014-09-01 00:45:20 -07:00
tafryn
a8c9caae81 Add check to prevent errors when using vimpager. 2014-08-08 16:27:38 -07:00
Holger Rapp
7b8641e1fd Back out fix for #323. Fixes #324. 2014-06-21 15:31:26 +02:00
opennota
93be385d38 Don't complain about undefined function
When lazy loading UltiSnips on specific filetypes ([vim-plug](https://github.com/junegunn/vim-plug) and [NeoBundle](https://github.com/Shougo/neobundle.vim) can do that), UltiSnips#FileTypeChanged() function can be undefined while ftdetect/UltiSnips.vim is loading.
2014-06-21 12:35:25 +07:00
Daniel Hahler
7da9dbe2af Add UltiSnipsFileType augroup and unset it if UltiSnips is disabled 2014-04-09 19:31:00 +02: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
Holger Rapp
bfce5af642 Implemented UltiSnipsAddFiletypes
It makes it possible to add filetypes in ftplugin/ft.vim or manually while editing.
2012-04-01 16:42:34 +02:00
Holger Rapp
3f7bfeec1b ft should be snippets not snippet 2011-02-17 14:00:45 +01:00
rupa
49f4d35d80 recognize .snippets files 2010-11-12 17:29:26 -05:00