# Disable pico's automatic hard line-wrapping?



## michaelsanford (Apr 27, 2003)

Pico never used to do this (on 10.1), but now it automatically hard-wraps long lines with carriage returns.

Now that it's nicely ruined a few hundred lines of code  I'd like to disable this 'feature'.

Is there a configuration file I can edit to disable this?


----------



## bluehz (Apr 28, 2003)

Looks like if you start pico with the -w switch it will not wrap lines.

pico -w [filename...]

If you use pico a lot I would highly recommend investigating a little bit more advanced text editor like nano or joe. Nano is the most "pico like" and req. little transition pain, joe is less like pico (but still not as obtuse as vi), but is PACKED with great features. You can install either of those with Fink if you have that installed.

If you want pico to ALWAYS start with the -w switch you might create and alias substitution for it in your aliases file. Some people don't recommed aliasing real cmds (like pico - becuase its an actual cmd), but I think in this case its not a problem.

alias pico 'pico -w'  " launches pico with -w switch

for me - old habits die hard and my fingers just naturally type pico when I want to edit text. Faster than I can think... but I prefer nano for quick editing - so what I did was alias "pico" to "nano"

alias pico '/sw/bin/nano'

that way whenever I type pico... I get nano instead...


----------



## michaelsanford (Apr 28, 2003)

Yeah I tried out joe and nano. I like nano but I have one problem. My system is localized in French (and nano realises this and localizes the interface!) but I get a lot of bogus characters where accents should be, even though I am using UTF-8 Unicode.

The bogus characters appear as little diamonds with ? inside them.

Thanks for the switch! I never considered looking in the manpage for that


----------



## kilowatt (Apr 30, 2003)

if you're coding, I wouldn't even consider nano or pico. 

I used to be /the/ most anti-vi person you could imagine, and I really did hate that editor.

Until I got a unix box that only had vi .

As for the interface, vi doesn't realy have much of an interface to get in the way. 

vim is a nice option as well, and in some ways I do prefer it to vi (vim = vi improved).

google for 'vi cheat list' or similar for a good 10 basic commands.

Personaly, I even got a book on vi once I realized it was the way to go, and now I don't use anything else.

Lots of programmers like emacs - but I'm not that far gone yet!

Bottom line though, vi will always do what you tell it. You can have it number lines, you can jump to line, indent, word wrap, etc. It defaults to not word wrapping, which I like.

What I noticed about the whole idea behind vi, is very cool. Take a somewhat normal text editor like simple text, or microsoft word. Using the mouse, you position your cursor within the document. You can select, drag, edit, delete, etc, all with the mouse. For the actual creation of text, you use the keyboard.

vi is the same way, only without the mouse. There is an edit mode, where you are typing the contents of the file, and there is a command mode, where you are commanding the text editor to do things like 'jump to line 453' or 'write file'.

To me, this is much more logical than trying to tie two very different functions into one by using control-x keystrokes. I mean, what if you want to easily insert a control code into a file?

Give vi a shot for a week, or even two days, use it exclusively, and I bet you'll switch.


----------



## bluehz (Apr 30, 2003)

I think the fact that you had to purchase a book for vi(m) says it all. Don't get me wrong - for some people - vi is da bomb..... I just don't think you should have to have a book to use a text editor. If you want more advanced features than nano or pico, step up to Joe before diving into vi(m).


----------



## kilowatt (Apr 30, 2003)

I knew that would sound kinda bad...

Actually, I got the book because it was on clearence for $2.99!!

By no means do you need a book on it to use it though .


----------



## michaelsanford (Apr 30, 2003)

Hehe you two dueled out what I was going to say.

I am usually not the kind of person to sday 'It's so hard so forget it', but vi and all the buffers and control-key commands that aren't even printed anywhere on the screen, that's just a pain.

I do agree though, tha vi is probably superieur in many respects to a little editor like pico, but with superiority usually comes complexity.

How much did your book cost by the way? I am not totally adverse to learning vi, and in fact, I would like to learn vi, I just don't have the time right now...


----------



## Koelling (May 3, 2003)

I highly recomend vim if you're a coder. You spend enough time writting code that it's worth while to know a good (the best) text editor.

I just found a sweet thing for OSX. It's a graphical version of vim for OSX (like gvim for unix)

http://macvim.swdev.org/OSX/

This way you only have to remember the (i) insert command and the rest is handled in the menubar. Preferences (such as syntax highlighting, fonts, etc.) are all easier to get to. cmd-s saves the document and cmd-q quits it. Eventually I'm sure you'll want to start learning commands like deleting lines, finding words without the mouse but to get you started, this program is awesome.

If you're not a coder and using pico is just for editing a unix config file, then yeah it's probably not worth the time learning vi. For me, spending an hour a day for a week researching commands was worth it because it saves time programming.


----------



## michaelsanford (May 3, 2003)

Wow this is cool! I know that vi (vim) is superior to pico, but I just never learned the syntax. But now that I will be doing more remote work (that is, working on files directly on their servers) learning a good, standard editor is esential...


----------



## Koelling (May 3, 2003)

yeah it's a good way to learn syntax. But remember that you wont be able to work on remote files with the graphical version. Since the files are remote you'll have to use whatever text editor the remote machine has. Usually it has more than one but if pico is all it's got then your stuck with pico.


----------



## var1ety (May 25, 2003)

http://vim.sourceforge.net/docs.php

there is a free VIM book you can download in pdf form.  Additionally, there is a "best of" vim tips at:

http://vim.sourceforge.net/tips/tip.php?tip_id=305

I browse through vim.sf.net's tips site when I'm bored, and am always learning something new, even after 2 years with the editor.

A big part of using vi/vim is getting used to the keys; you'll start by knowing say 10 keys, the very basic ones.  In a month you'll know 30 or 40 keys, and you're productivity will have increased many times over.  For me vi/vim is a wonderful productivity/efficiency tool.  A neat thing is finding a faster way to do a particular edit, shortening a repetitive keystroke by several keys.  For example, to delete two lines of text I used to do

Vjd     (visually select lines, move down one, delete selection).

Now, however, I just do

dj

Things like that, and the fact that I don't have to leave the home row, save me a lot of time in the long run, and the ease of such editing tasks makes vim irreplaceable to me.


----------

