Jump to content


Photo

How Do You Change The Default Editor From Vi (Centos)?


  • Please log in to reply
11 replies to this topic

#1 tibberous

tibberous

    Advanced Member

  • Members
  • PipPipPip
  • 1,187 posts

Posted 25 November 2012 - 09:38 PM

I hate vi. I hate the idiots that even put a 30 year old text editor in CentOS. But mostly I hate the fact that the damn crontab never saves, and that /etc/crontab isn't used, and that crontab -e opens a file in god-damn vi.

Is there anyway to make it so that crontab -e brings up nano? Or a way to make it so that crontab isn't wiped when the server is reset?

#2 requinix

requinix

    Transforming Moderator

  • Moderators
  • 6,238 posts
  • LocationWA

Posted 25 November 2012 - 10:35 PM

man crontab

-e
This option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables.  After you exit from the editor, the modified crontab will be installed automatically.

My Ubuntu says that it'll use /usr/bin/editor as a fallback; some Googling suggests that's true for CentOS too.

[edit] IIRC you can manually modify the crontab file so long as you restart/SIGHUP the cron daemon.

Edited by requinix, 25 November 2012 - 10:40 PM.


#3 Pikachu2000

Pikachu2000

    I hate everything.

  • Staff Alumni
  • 11,378 posts
  • LocationFuture Independent Republic of Texas
  • Age:106

Posted 25 November 2012 - 10:46 PM

export EDITOR=nano

"Java" is to "Javascript" about the same as "fun" is to "funeral".

Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *

Random Quote: "

#4 tibberous

tibberous

    Advanced Member

  • Members
  • PipPipPip
  • 1,187 posts

Posted 26 November 2012 - 12:05 PM

Thanks for the help - I did the export command but I won't know if it worked till next time, because I don't want to mess the crontab up while it's working.

#5 Adam

Adam

    Advanced Member

  • Gurus
  • 5,695 posts
  • LocationSheffield / UK

Posted 26 November 2012 - 12:21 PM

You need to add the export command to your bashrc file, to ensure it's exported on every start-up. You may already be exporting an EDITOR var in there you would need to replace.

#6 tibberous

tibberous

    Advanced Member

  • Members
  • PipPipPip
  • 1,187 posts

Posted 26 November 2012 - 08:01 PM

I hate Linux! Why does stuff reset on reboot?

Every year I hope Google will come out with some super-advanced server OS but they never do.

I'm gonna go find my stupid bashrc file, which would be /etc/startup if Linux made any sense. Thanks for the help.

#7 Adam

Adam

    Advanced Member

  • Gurus
  • 5,695 posts
  • LocationSheffield / UK

Posted 26 November 2012 - 08:35 PM

Your .bashrc file is found in your home dir, as it's for your user only. I would drop the hate towards Linux and try and embrace it a little, if you're going to get anywhere with it. Even vim is a nice editor if you put in the effort to learn it and customise it.

#8 Pikachu2000

Pikachu2000

    I hate everything.

  • Staff Alumni
  • 11,378 posts
  • LocationFuture Independent Republic of Texas
  • Age:106

Posted 26 November 2012 - 08:48 PM

Yeah, I'm the only one around here allowed to hate everything. :P
"Java" is to "Javascript" about the same as "fun" is to "funeral".

Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *

Random Quote: "

#9 trq

trq

    Advanced Member

  • Administrators
  • 31,032 posts
  • LocationSydney, Australia.

Posted 26 November 2012 - 08:53 PM

I hate Linux! Why does stuff reset on reboot?



Set a variable in Window's (cmd) shell and see how long it lasts too. The issue seems to be between the keyboard and the chair.

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#10 tibberous

tibberous

    Advanced Member

  • Members
  • PipPipPip
  • 1,187 posts

Posted 28 November 2012 - 01:25 AM

[/font][/color]

Set a variable in Window's (cmd) shell and see how long it lasts too. The issue seems to be between the keyboard and the chair.


If somethings truely advanced, shouldn't it be easy to use? :P



And if you make changes with msconfig, they don't revert. Crontab is a file, doesn't make sense it just disapears.

I guess between Windows and Android I'm just use to OS'es not being a hodgepodge of esoterical crap. I *could* learn it, but I'd much rather see it replaced with something well designed and user friendly. Logmein shows just how well remote desktoping can work - what I'd really love to see if a server OS that you could manage though a client app.

Guess as everything gets easier it just makes linux look worse. Open source sounds good in concept, but corperate software is really polished and user friendly lately... hell, anymore it's even becoming free.

#11 Pikachu2000

Pikachu2000

    I hate everything.

  • Staff Alumni
  • 11,378 posts
  • LocationFuture Independent Republic of Texas
  • Age:106

Posted 28 November 2012 - 01:46 AM

I don't think it's as much a matter of ease, as a matter of what you're used to. Everyone I know thinks Mac OS is "hard" to use. Being a Linux and Mac user for the last 6 years, I think WinD'ohs is hard to use.

EDIT: and really, the more granular the control you need over something becomes, the more complex it becomes to control.

Edited by Pikachu2000, 28 November 2012 - 01:48 AM.

"Java" is to "Javascript" about the same as "fun" is to "funeral".

Why $_SERVER['PHP_SELF'] is bad. || Why ORDER BY RAND() is bad || Every problem can be solved with rm -rf *

Random Quote: "

#12 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 28 November 2012 - 01:50 AM

Crontab file disappearing? Where did you get that from? No-one here has said anything about the crontab file disappearing. What they have said is that the environment variable "editor" will be reset, if you don't add it to your .bashrc file (which is in your home folder, since it's yours, btw).

Same with Windows: If you use "set" in a CMD prompt to set an environment variable, it'll be lost when you close that prompt. msconfig doesn't enter the equation, as you're comparing apples to glass figurines.

What you have is a case of missing knowledge, which is not a fault of the OS. So I'd advice you, as trq did, to drop the hate and stop blaming the OS for your lack of knowledge.

PS: ssh is a client application, so is vi, nano, crontab and msconfig. Logmein, however, is a server and client application.
Keeping it simple.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com