svermeulen / vim-easyclip

Simplified clipboard functionality for Vim
693 stars 21 forks source link

Make use of autoload #24

Closed Taverius closed 10 years ago

Taverius commented 10 years ago

Right now everything is in autoload/, but the plugin directly loads EasyClip#Init(), which itself directly loads EasyClip#*#Init(), so its all loaded at startup anyway.

If the key mappings, commands and the functions used to define them were in plugin/EasyClip.vim, EasyClip would actually make use of the autoloading abilities of VIM, such as they are :)

svermeulen commented 10 years ago

I can see how putting it in autoload seems to defeat the purpose since it is loaded immediately. The reason I'm doing it that way though is because I like using the autoload prefix as a namespace for functions rather than cluttering up the global namespace (and not anything to do with deferring initialization)

Also, deferring initialization seems unnecessary in this case since users of EasyClip will tend to load them very quickly anyway (the first time they use yank/delete/cut)