Tuesday, October 25, 2011

Re: Please fix: make Windows Vim use same files as unix. No reason not to and it's confusing in mixed envirionments.

On Oct 25, 12:45 pm, Gary Johnson <garyj...@spocom.com> wrote:
>
> If you think Vim should automatically determine whether to use
> $HOME/vimfiles or $HOME/.vim, then you need to decide whether Vim
> should make this determination once at startup or every time it
> accesses 'runtimepath'.  The latter will affect performance which
> could be a problem.  The former is easy to implement in your
> .vimrc/_vimrc, as Ben said.  For example (untested--the let rhs
> probably needs to be expanded):
>
>     if has("win32") && isdirectory(expand("$HOME")."/.vim")
>         let &rtp = "$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after,$HOME/.vim/after"
>     endif
>

This is pretty much what I was proposing. I would extend it further.
Something like this could be placed in vimrc_example.vim, which AFAIK
is sourced by default in a brand-new Windows installation:

" check for $HOME/.vim existing INSTEAD of $HOME/vimfiles, in case Vim
users from Unix aren't paying attention
if has("win32") && isdirectory(expand("$HOME")."/.vim") && !
isdirectory(expand("$HOME")."/vimfiles")
let &rtp = "$HOME/.vim,$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/
after,$HOME/.vim/after"
endif

(still untested...potentially as Gary says the RHS needs to be
expanded)

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: