2

I thought perhaps vim was in some compatibility mode of some sort. To make sure it was using vim instead of vi, I set the VISUAL environment variable but was still unable to get into visual mode (hitting the v key).

Any suggestions?

  • See the Caveat Section of the Sudoers man page to understand why jofel's answer is correct. – eyoung100 Sep 26 '14 at 15:58
  • Thanks. I am, however, unsure how the caveat section was relevant. Are you emphasizing the security concerns? – Belmin Fernandez Sep 26 '14 at 16:02
  • "The sudoers file should always be edited by the visudo command which locks the file and does grammatical checking. It is imperative that sudoers be free of syntax errors since sudo will not run with a syntactically incorrect sudoers file." My Two Cents: visudo uses a base text editor w/ no visual mode in order to keep those permission checks etc as clean as possible, therefore it ignores the environment variables. – eyoung100 Sep 26 '14 at 16:09

1 Answers1

2

Normally, visudo ignores the VISUAL and EDITOR variable for security reasons and calls vi, so the compatibility mode of vim is enabled.

Read How to set visudo to use a different editor than the default on Fedora? to change the default editor.

jofel
  • 26,758