[SOLVED] Crontab will not Edit with Vim

Post Reply
User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

[SOLVED] Crontab will not Edit with Vim

Post by Atip » 17. Sep 2017, 08:05

I am not able to edit crontab jobs with vim.
Neither as user "crontab -e" or as "sudo crontab -e"

After Shift i I can make an input, however, cannot delete the input.
Same after Shift i no delete is possible, for example deleting #
at beginning of a line.

With sudo crontab -e opened in a terminal and all killed by clicking
X in terminal bar vim will keep running in the background using
100 % of CPU.

I double checked in my Salix box and crontab jobs can be edited with vim.
Last edited by Atip on 18. Sep 2017, 04:22, edited 1 time in total.

User avatar
gapan
Salix Wizard
Posts: 5490
Joined: 6. Jun 2009, 17:40

Re: Crontab will not Edit with Vim

Post by gapan » 17. Sep 2017, 08:16

Just a guess: you're using elvis, not vim.
Image
Image

DidierSpaier
Posts: 309
Joined: 20. Jun 2016, 20:15

Re: Crontab will not Edit with Vim

Post by DidierSpaier » 17. Sep 2017, 08:31

gapan wrote:Just a guess: you're using elvis, not vim.
@Atip: this is the case if you type "vi" in a terminal as in Slint (as in Slackware) /usr/bin/vi is a symlink to /usr/bin/elvis. Then, to start vim just type "vim" instead.

User avatar
gapan
Salix Wizard
Posts: 5490
Joined: 6. Jun 2009, 17:40

Re: Crontab will not Edit with Vim

Post by gapan » 17. Sep 2017, 21:52

My point is that crontab -e uses the default EDITOR, which happens to be vi, not vim, therefore it is elvis in slint. Either remove elvis and point the symlink to vim, or set the EDITOR variable to whichever editor you want.
Image
Image

User avatar
Atip
Posts: 539
Joined: 5. Jun 2011, 04:27

Re: [SOLVED] Crontab will not Edit with Vim

Post by Atip » 18. Sep 2017, 04:31

It seems my memory is as well becoming impaired. ;)

I should have remembered that it is evil elvis. :evil:

Solution as before change symlink @vi to vim. :D

Thanks for the tip!

Post Reply