On 04/11/08 18:57, 703designs wrote:
> Here's what I've distilled this to: It works well!
>
> " Set config directory: Usually ~/.vim or ~/vimfiles"
> let ConfigBase = split(&runtimepath, ',')[0]
> exec "source " substitute(glob(ConfigBase . "/scripts/*"), "\n",
> "\nsource ", "g")
>
> I've always split up my vim settings, and I keep everything in a
> "scripts" folder.
>
> Thanks for all the help!
>
> Thomas

Well, there already is a $VIMRUNTIME/scripts/, which is used for 
something else, but:

a) If you put your scripts in $HOME/.vim/plugin/*.vim or 
$HOME/vimfiles/plugin/*.vim (as the case may be), Vim will automagically 
source them at startup, after your vimrc but (in GUI mode) before your 
gvimrc if any (except, of course, that no plugins are sourced when you 
invoke Vim with -u NONE or with --noplugin);

b) if you rename $HOME/.vim/scripts/ or $HOME/vimfiles/scripts/ to (in 
the same path) .../myscripts/, you can source them all at any time by 
just doing

        runtime! myscripts/*.vim

or, if you want to source any scripts in that directory or in any 
subdirectory of it at any depth,

        runtime! myscripts/**/*.vim


Best regards,
Tony.
-- 
"By necessity, by proclivity, and by delight, we all quote.  In fact,
it is as difficult to appropriate the thoughts of others as it is to
invent. (R. Emerson)"
        -- Quoted from a fortune cookie program
           (whose author claims, "Actually, stealing IS easier.")
           [to which I reply, "You think it's easy for me to
           misconstrue all these misquotations?!?"]

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

Reply via email to