方法1:
在.vimrc 最下面加入
autocmd filetype crontab setlocal nobackup nowritebackup
方法2 :如果上面的方法不管用 用nano先编辑下把
export EDITOR=nano
方法三:
扫描二维码关注公众号,回复:
2231945 查看本文章
1) .bash_profile添加
alias crontab="VIM_CRONTAB=true crontab"
2) .vimrc添加
if $VIM_CRONTAB == "true"
set nobackup
set nowritebackup
endif
记得让环境变量生效 source ~/.bash_profile