[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Conditional code possible in .vilerc?
From: |
Chris Green |
Subject: |
Re: Conditional code possible in .vilerc? |
Date: |
Fri, 4 Nov 2022 16:14:02 +0000 |
On Fri, Nov 04, 2022 at 02:35:18PM +0000, Chris Green wrote:
> I run vile on several systems, up until now they have been 'my'
> systems where vile is installed in /usr with config files in
> /usr/share/vile.
>
> However I have just installed vile on a system (my cPanel hosting
> site) where I just have a user account. I built vile very quickly and
> easily to install it in my home directory.
>
> The (minor) problem is that I have a .vilerc that I share across all
> systems that currently does "source /usr/share/vile/filters.rc", this
> obviously doesn't work on the new system where it should be "source
> ~/share/vile/filters.rc".
>
> I'd rather not have a custom .vilerc if I can avoid it, is there any
> way to code conditionally in the .vilerc to test where the filters.rc
> file is? Something like:-
>
> if exists /usr/share/vile/filters.rc
> source /usr/share/vile/filters.rc
> else
> source ~/share/vile/filters.rc
> fi
>
I think I have come up with an OK solution anyway.
Change the line in .vilerc from:-
source /usr/share/vile/filters.rc
to:-
source filters.rc
This works fine on my existing systems as the filters are in the
default place.
Then, on the new system where filters.rc (and other files) are in
~/share/vile I set VILE_STARTUP_PATH to point at them. I already have
a mechanism for adding custom .bashrc bits and pieces so this fits in
nicely.
The only question that remains is why didn't "./configure --prefix=$HOME"
set the default place for the filters files?
--
Chris Green