Saluton Matt :) Matt Wozniski <[email protected]> skribis: > Raúl Núñez de Arenas Coronado wrote: >>>> My policy, which may be utterly wrong, is to put them in my >>>> ~/.vimrc if the function is generic (that is, not related to any >>>> particular filetype), and in some "after" file if it has to do with >>>> some particular filetype. Using a plugin for defining some >>>> functions is a bit overkill for me and would require much more >>>> effort than I'm willing to put ;) >>> >>> Dunno if it's wrong but it makes excellent sense. >> >> The problem is that it doesn't scale well. If you write a lot of >> *generic* functions, not applicable to any particular filetype, your >> best bet is probably to put them in autoload plugins or something >> along these lines. > > Of course, autoload functions aren't a silver bullet, either. If you > have a function that you use every time vim starts (either because > it's called by a plugin, or your vimrc, or a statusline, etc), then > it's almost certainly slower to put it in an autoload script, even if > that's nicer for organization.
You're 100% right, and I wouldn't use an autoload function in those cases even if that's nicer for organization. Fortunately Vim is flexible enough to use all solutions at once: ~/.vimrc for frequently used, generic functions (unless you don't want to keep functions in your startup file, of course); autoload functions for things that you seldom use and that are big; plugins/filetype functions when applicable. > Personally, I tend to put all the functions for my scripts into > plugins/ and then, I tried that once, but was not good for me since my functions are all generic but pretty heterogeneous: it wasn't an advantage to me to keep them in a plugin rather than in my ~/.vimrc, so I changed my mind. Anyway, if I ever write more functions I would probably use some plugins or whatever. There are plenty of solutions, the problem is to choose one! :) -- Raúl "DervishD" Núñez de Arenas Coronado Linux Registered User 88736 | http://www.dervishd.net It's my PC and I'll cry if I want to... RAmen! --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
