How to use mvim to edit my crontab on Mac OS X (10.6.6)

mvim installed in /usr/local/bin/ , but cannot be used as EDITOR or VISUAL :

 $ mvim -f # works as expected $ EDITOR="/usr/local/bin/mvim -f" crontab -e crontab: /usr/local/bin/mvim -f: No such file or directory crontab: "/usr/local/bin/mvim -f" exited with status 1 

I tried single quotes and used VISUAL instead of EDITOR . The same result. I also tried googling, but apparently the -f flag is great for everyone else.

I am using Mac OS 10.6.6 and zsh, but the problem is the same in bash.

+4
source share
2 answers

The problem is that crontab expects to run a program called "/ usr / local / bin / mvim -f" if you specified it in the EDITOR environment variable.

To get around this, you can write a short shell script. For example, call this mvimf:

 #!/bin/bash /usr/local/bin/mvim -f " $@ " 

Then you can run: EDITOR = / usr / local / bin / mvimf crontab -e

+4
source

I'm not sure if this is directly related to the problem you are facing, but when I tried to edit my crontab, I saw a similar error code. I realized that I had a little conflict in the vimrc file associated with the pathogens plugin. If you call:

 filetype off 

when it is already turned off, you can cause problems that will cause your Vim to exit with errors. It looks like your problem has already been fixed, but since it shows up in the search results associated with this error code, I thought I posted it here.

Credit is sent to commentators on this post - http://tooky.github.com/2010/04/08/there-was-a-problem-with-the-editor-vi-git-on-mac-os-x.html

0
source

Source: https://habr.com/ru/post/1339346/


All Articles