On 14/09/09 08:22, Raúl Núñez de Arenas Coronado wrote:
>
> Saluton Patrick :)
>
> Patrick Gen-Paul<[email protected]>  skribis:
>> Currently, I append them to my ~/.vimrc but I guess it would be
>> preferable to place them in a separate file (or files) and source it
>> via commands in my vimrc?
>>
>> Or, should I create a plugin for each function (or functionally
>> related functions) and place the code in my ~/.vim/plugin directory?
>
> 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 ;)
>
> I don't see any problem adding functions to ~/.vimrc directly, unless
> you have a great number of them. In such case, I would use something
> like ~/.vim/functions.vim and source it from ~/.vimrc, not for speed but
> for having them in just one place.
>

In addition, functions which you don't always use can be put in an 
autoload script (see ":help autoload-functions") to speed up the Vim 
startup by sourcing the function definitions only when needed. This is 
particularly useful for bulky functions, or if you have many related 
functions which are used together, but not in every Vim session. OTOH it 
offers little gain for a function which you always use, e.g. a 'tabline' 
function if you always display the tab line.


Best regards,
Tony.
-- 
An elephant is a mouse with an operating system.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to