DreamHost Web Hosting
Discussion Forum


Forums
   >> Programming
Return to the search engineFlat Mode*

Subject Re: Using PICO [re: Jeff @ DreamHost]  
Posted bywill (DH Pooh-Bah)
Posted on04/25/05 03:38 PM


To be fair, I'm pretty sure that nano wraps lines by default just like pico does. I did a quick test, and both pico do this when used as an editor for "crontab -e". Nano is a pico clone, though with some enhancements/ improvements. Either can be called with "-w" to avoid wrapping lines. If you want to be sure not to wrap lines, set $VISUAL to:

"pico -w"
or
"pico -tw"
(to save the changed file without prompting for the filename - this is great for crontabs, but doesn't always work properly for other applications that follow $VISUAL / $EDITOR - I believe this is why DH did not set this by default)

So something like:
export VISUAL="pico -wt"
(bash / ksh / zsh, in your .profile / .bash_profile or whatever; to work for real sh too, declare and export the variable separately)

setenv VISUAL "pico -wt"
(csh / tcsh, in .cshrc or .tcshrc)

While $EDITOR will work too, $VISUAL is the preferred environment variable to use; historically, $EDITOR is your line editor (e.g., ed / ex) and $VISUAL is your full screen editor (e.g., vi / emacs).

Side note - vim also has some funkiness with crontab -e, due to the way it handles backup files[1]. The workaround is to not keep a backup for certain filenames or for files in a certain directory. This results in the maddening "crontab: no changes made to crontab" error, after saving the file in vim.

I think something like this will work (in your .vimrc or in a global Vim config file):

au VimEnter crontab* set nobackup nowritebackup

I always just use nvi instead.

[1] http://lists.apple.com/archives/unix-porting/2003/Mar/msg00038.html




 
Entire thread
Subject  Posted byPosted on
*Using PICO  JenMad04/18/05 02:08 PM
.*Post deleted by Jeff @ DreamHost  ardco04/18/05 08:12 PM
.*Re: Using PICO  JenMad04/19/05 08:44 AM
.*Re: Using PICO  sturm04/20/05 07:10 PM
.*Re: Using PICO  JenMad04/21/05 10:26 PM
.*Post deleted by Jeff @ DreamHost  ardco04/22/05 03:19 AM
.*Re: Using PICO  JenMad04/23/05 08:32 AM
.*Re: Using PICO  guice04/23/05 04:07 PM
.*Post deleted by Jeff @ DreamHost  ardco04/23/05 06:40 PM
.*Re: Using PICO  guice04/23/05 08:42 PM
.*Re: Using PICO  dallasModerator04/24/05 10:17 AM
.*Re: Using PICO  Jeff @ DreamHostAdministrator04/25/05 12:36 PM
.*Re: Using PICO  guice04/26/05 08:44 AM
..Re: Using PICO  will04/25/05 03:38 PM
.*Re: Using PICO  matttail04/18/05 07:40 PM
Jump to