Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use vim as my normal edito and so have my vimrc set up in a particular way.

I quite often find myself editing crons with the command

crontab -e 

When I do, I edit in vim, but without my normal vimrc - I could load it with a command but I'd like to have it load up automatically - what am I missing?

Extra information - I'm a user on the system, I don't have admin rights....

share|improve this question
    
Can you please clarify, the issue is that the vimrc is not loading, not that the default editor is incorrect - right? It appears to me as though it's the vimrc issue, not the editor issue as people are suggesting. –  nerdwaller Apr 8 '13 at 19:13
    
It works on my system. Add some details such as OS, shell, contents of $EDITOR and vim version. –  Ярослав Рахматуллин Apr 8 '13 at 21:01

2 Answers 2

up vote 3 down vote accepted

Looks to me like everyone is missing the issue, the issue appears to be that your vimrc file is not working when you use crontab -e, for example. Assuming that is correct:

You probably have ~\.vimrc configured for the user, but not the system. You could copy/create a global one (that should work for vim wherever).

Typically, the global vimrc is:

/etc/vim/vimrc

-or-

/usr/local/share/vim/vimrc

Depending on your *Nix based system.

Hopefully that is a bit more on what you're looking for.

share|improve this answer

Your vim settings should be enabled system-wide for this to work, as crontab(1) calls EDITOR without enviroment.

share|improve this answer
    
This is accurate, but it may be helpful to give a fix as well. It is more fitting of the SU format. Just a thought. –  nerdwaller Apr 8 '13 at 19:22
    
@nerdwaller Duly noted. Thanks. Is it good practice to remove an unproper answer? –  dawud Apr 8 '13 at 19:33
    
I'm not a moderator, so I can't really say the best practice. I tend to add to/edit mine, or if I was way off delete it to remove clutter. But the best place to ask/search for answers to questions about SU is Meta. Like I said before, you're accurate - it just helps to have a solution as well. That's basically my personal criteria before up-voting. –  nerdwaller Apr 8 '13 at 19:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.