You are not logged in.

#1 2009-02-07 21:42:49

vis
Member
From: Switzerland
Registered: 2007-02-25
Posts: 81

can't read ~/.vimrc (or forgotten)

For the heck of it, I can't get a simple ~/.vimrc read into vim or I have forgotten everything :-(

I do this trivial example:
- the whole ~/.vimrc is

set nobackup

- touch test

- vim test, change it, :wq

It has created a file called test~, which should not be.

What could be the problem. This is a recently upgraded Arch box.

Offline

#2 2009-02-07 22:30:44

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: can't read ~/.vimrc (or forgotten)

From http://www.faqs.org/faqs/editor-faq/vim/

5.2 Why is a backup file written even if I set nobackup?

In order to keep Vim from writing a backup, you must also do
``:set nowritebackup''.

Offline

#3 2009-02-07 22:55:17

vis
Member
From: Switzerland
Registered: 2007-02-25
Posts: 81

Re: can't read ~/.vimrc (or forgotten)

Thanks! Still there is something wrong.

If I do

vim
:set nowritebackup
:e test.tex

edit and save, then no test.tex~ is created.

But having this ~/.vimrc

set nobackup
set nowritebackup

then start vim straight

vim test.tex

creates a backup.

Offline

#4 2009-02-08 12:31:41

jmp
Member
Registered: 2006-05-26
Posts: 10

Re: can't read ~/.vimrc (or forgotten)

It seems to me that for some reason ~/.vimrc doesn't get sourced. (Or Vim is trying to source it from another path.)

Run "vim -V" and see if it says anything about sourcing vimrc. Also try "vim -u ~/.vimrc" and see if it works. (Just to narrow down the problem.)

Offline

#5 2009-02-08 18:42:22

vis
Member
From: Switzerland
Registered: 2007-02-25
Posts: 81

Re: can't read ~/.vimrc (or forgotten)

jmp wrote:

~/.vimrc doesn't get sourced. (Or Vim is trying to source it from another path.)

That was my first guess. But if there is a syntax error, vim complains about it at start up.

Run "vim -V" and see if it says anything about sourcing vimrc.

lese "/etc/vimrc"
Zeile 47: lese "/usr/share/vim/syntax/syntax.vim"
Suche nach "syntax/synload.vim" in "/home/user/.vim,/usr/share/vim,/usr/share/vim,/usr/share/vim/after,/home/user/.vim/after"
Suche nach "/home/user/.vim/syntax/synload.vim"
(100 odd lines)

Interesting. No mention about /home/user/.vimrc

Also try "vim -u ~/.vimrc" and see if it works.

Yes. That behaves exactly according to ~/.vimrc

Offline

#6 2009-04-26 06:04:17

Proofrific
Member
Registered: 2008-01-05
Posts: 215

Re: can't read ~/.vimrc (or forgotten)

I had the same problem (version 7.2.65-1 according to `pacman -Qqi vi`), and indeed ~/.vimrc doesn't get sourced (as the previous posters already mentioned).  However, ~/.virc does get sourced, so renaming my ~/.vimrc to ~/.virc fixed the problem.  Note that /etc/virc exists, but not /etc/vimrc.  I wonder why the package switched from vim to vi...

Offline

#7 2009-04-26 11:23:38

lang2
Member
Registered: 2006-02-10
Posts: 386

Re: can't read ~/.vimrc (or forgotten)

My abs tree shows that the vi package is compiled with --with-vim-name=vi flag turned on. One has to read the code to really tell but it is possible that in such case it would source .virc instead of .vimrc. Besides being Unix compatible, I don't see reason to favour vi over the vim package.

Offline

#8 2009-04-26 13:50:27

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: can't read ~/.vimrc (or forgotten)

The Arch Vim packages are somewhat misguided in their config file usage.

IIRC there is some overhaul underway, however. Until then we will have to distinguish between, Vi, Vim, and GVim specific .rc files.

Edit:
About the differences, look here: http://www.archlinux.org/news/336

Last edited by bernarcher (2009-04-26 13:55:50)


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB