On Wed, 14 Mar 2012, Timothy Madden wrote:
On 14.03.2012 19:28, Christian Brabandt wrote:
On Wed, March 14, 2012 18:09, Timothy Madden wrote:
And by the way, :lcd or :cd do not return the right case in path
names either.
I am really wondering, what the right case is on Windows and what do
you need it for?
[...]
I need this to compare for identity directory names that I received
from different sources (one is from the user who has edited
&runtimepath, and the other is from expanding ~/.vim/ with vim script
commands).
Why do you need to compare these directory names for identity?
And before you say I could make a case-insensitive string compare, I
also want my script to work under Unix/Linux or with a filesystem
different than NTFS, that is case-sensitive. And for such a file
system, a case-insensitive string compare would be wrong.
So what do I do to correctly compare file names that may reside on
either case-sensitive or case-insensitive file systems ?
(Mostly tongue-in-cheek: you don't use Vim to do it.)
This still sounds like an XY problem. You claim you need to compare
directory names for identity (the Y). You think you can use
directory-name-identity-comparison to solve some problem X. What is X?
If X is "to put ~/.vim" in front of $VIMRUNTIME in &rtp, why not just
put ~/.vim in front of $VIMRUNTIME? Why do you need to detect that it
is or isn't duplicated? Most things runtime files do are guarded to
prevent repeated execution:
Use :au! to clear out :autocmd groups so they're not duplicated.
Use "if exists('g:some_plugin_loaded')" to prevent loading a plugin
twice ever.
Use "if exists('b:some_plugin_loaded')" to prevent loading a plugin
twice in some buffer.
--
Best,
Ben
--
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