LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-23-2008, 12:01 PM   #1
barbar
LQ Newbie
 
Registered: Mar 2007
Posts: 15

Rep: Reputation: 0
nano as default editor systemwide


Hi,

I added
Code:
export EDITOR="nano" to /etc/profile
.But when using
Code:
crontab -e or 
visudo
vi is still used.

How can I use nano as default editor for all users?
 
Old 03-23-2008, 12:39 PM   #2
Speek
Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Slackware
Posts: 124

Rep: Reputation: 41
Try also adding:
export VISUAL="nano"
to /etc/profile
 
1 members found this post helpful.
Old 03-23-2008, 01:08 PM   #3
barbar
LQ Newbie
 
Registered: Mar 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Thanks,

VISUAL = nano worked for crontab -e.
To use nano with sudo I added
Code:
Defaults  editor=/usr/bin/nano 

to /etc/sudoers.
 
Old 03-23-2008, 05:36 PM   #4
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,443

Rep: Reputation: 73
This is somewhat off topic, but related. I recommend creating an alias for nano called snano that will allow you to easily see syntax highlighting for shell scripts that don't have the .sh extension (such as all the rc scripts, etc).

I add this to my .profile or /etc/profile
Code:
alias snano='nano -Y sh'
So for shell scripts without a .sh extension I run snano instead of nano.

Be sure to create or edit /etc/nanorc so that syntax highlighting is activated. If you don't have that file you can use /usr/doc/nano-VERSION/nanorc.sample to start you off (if I remember correctly uncommenting some lines on the bottom will be enough to activate syntax highlighting).
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy/paste a line in nano editor smp0219 Linux - Newbie 10 08-06-2019 03:24 PM
pico or nano editor SlackWare package petcherd Slackware 9 03-28-2007 09:09 AM
Nano Editor Question swamprat SUSE / openSUSE 7 01-17-2007 04:24 PM
Nano editor just stop working FlashAsh99 Linux - Newbie 4 06-27-2005 05:54 PM
nano editor not working FlashAsh99 Linux - General 2 06-27-2005 02:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration