Sunday, December 29, 2013

Re: Where is my system-wide init file?

On 29/12/13 21:15, Elena Garrulo wrote:
> Tony, thank you for your detailed answer. By following your advice, I
> have tracked down where Vim looks for its system-wide init file. It
> is either in /etc/vim/ or in /usr/share/vim/, but I still don't
> understand why Vim looks there, considering that no Vim-related
> environment variable points there.
>
> Also, could it be that I'm experiencing frequent GVim crashes because
> my installation is not configured properly? There are no environment
> variable that are related to Vim. Should I create any?
>
> I'm answering your probing questions in case there are other things
> that I'm missing.
>
> On Sunday, December 29, 2013 12:43:43 PM UTC+1,
> Tony Mechelynck wrote: > 1. Try "ls -l" on some of these files (in
> subfolders of /etc and of > > /usr/share) to see if any of them is a
> soft link. (Seeing if it's a hard > > link is less obvious). Or maybe
> /home/egarrulo or > > /home/egarrulo/bin/vim/vim-7.4.280/share are
> soft links?
>
> Yes, the init files in /usr/share link to the same files in /etc.
>
> /home/egarrulo/bin/vim/vim-7.4.280 is the folder where I have
> installed Vim, after building it with:
>
> ./configure --prefix=/home/egarrulo/bin/vim/vim-7.4.280
>
> I did so to avoid clashing with the Vim version that comes with my
> distro.

Well, without any --prefix=, vim would have been built so as to install
into subdirectories of /usr/local/ (as is does on my system: the
executable as /usr/local/bin/vim, the runtime files in
/usr/local/share/vim/vim74/, and looking for your $VIM at
/usr/local/share/vim/) and that wouldn't have overwritten your distro's
Vim either. It would also, with no further ado, have put the newly
compiled version before your distro's in the $PATH (since /usr/local/bin
comes before /usr/bin) so invoking "vim" with no path at the shell
prompt would have got your Vim and not the distro's.

That location is "visible" to everyone but you may need to run "make
install" from a root login (after login to root or su root). "make
config" and "make" can still be run from any desired login.

>
>> 2. Maybe there is another Vim (later in the $PATH) on your system?
>
> Yes, there is: /usr/bin/vim. It is the build that comes with my distro.
>
> Thank you for making me learn the "type" command. Cool! :-)

There is also "which" which is a separate program (and thus works for
all shells) but it doesn't know about shell aliases.

>
>> The system-wide vimrc for that copy of Vim, sourced before the user's
>>
>> vimrc, is $VIM/vimrc — with whatever $VIM may be when that user runs
>>
>> Vim.
>
> $VIM is empty.
>
>
>> You seem to find that $VIM is $HOME/vim/vim-7.4.280/share/vim, for
>>
>> another user it would probably not be a subfolder of _your_ $HOME.
>>
>>
>>
>
>> Also, I wonder why you have a "vim-7.4.280" link in that path. Do you
>>
>> change that at every patchlevel? Also, where did you get that "280"
>>
>> from? The current patchlevel is only 7.4.131.
>
> Indeed, at startup, Vim says it is version 7.4.131.
>
> I didn't know about the patchlevel when I compiled Vim. I got the
> version from the "version.h" file:
>
> #define VIM_VERSION_MAJOR 7
> #define VIM_VERSION_MINOR 4
> #define VIM_VERSION_BUILD 280

I wonder what that VIM_VERSION_BUILD means.

>
>>
>>
>>
>> For the Vim that I compile for my home computer, I use Vim's defaults,
>>
>> namely:
>>
>>
>>
>> $VIM = /usr/local/share/vim
>>
>> $VIMRUNTIME = $VIM/vim74 (at version 7.4)
>
> I did the same. I only used the "--prefix" option with "./configure".
>

Well, that is where you overrode Vim's defaults. As I said above, it was
not necessary.


Best regards,
Tony.
--
You will be the victim of a bizarre joke.

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: