Tuesday, September 20, 2011

RE: setttings where all users home directories are set to HOME

> Of ZyX
> Sent: Wednesday, 21 September 2011 14:11
> To: vim_use@googlegroups.com
> Subject: Re: setttings where all users home directories are set to
HOME
>
> In reply to ``setttings where all users home directories are set to
HOME''
> sent 21 September 2011, Wednesday by Lacis, Alf
>
> You can try to use `$USER' in this case (assuming you are on *nix):
from
> normal vimrc do
>
> source ~/.$USER-vimrc
> and put user-specific settings into `$HOME/.$USER-vimrc' file. You
can, of
> course, create an alias: `alias vim="vim -u ~/.$USER-vimrc"'.

Here's what I added. It needed to be a bit smarter than just a
'source', because not every user will have a _vimrc_XXXX file. Also,
what is annoying, is that the same string cannot be shared between
'let', 'filereadable()' and 'source' - crazy! filereadable() expects a
variable and objects to a string, and let and source have incompatible
formats!

let vimrcu = 'c:\mosaic\_vimrc_'.$USERNAME
if filereadable(vimrcu)
source c:\mosaic\_vimrc_$USERNAME
endif

Think green - keep it on the screen.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


--
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:

Post a Comment