Jump to content

editors and line breaks?


Peep
 Share

Recommended Posts

this seems like something that there is probably a good FAQ about somewhere, but i didn't find one:

 

when i first installed mandrake, i was baffled by vi and emacs. i stumbled upon nano, and have used it ever since because there's nothing you have to remember... all the shortcuts i need are at the bottom, although i think the only thing i ever use is ctrl-x.

 

but i notice when i edit files in nano, it seems to wrap the text and put in line breaks sometimes. i thought maybe i needed a more "serious" editor, but when i pulled out emacs and putzed around, it looked like it did the same thing. should i generally be concerned about line breaks? and is there a reason for me to learn emacs or vi? i don't need an all-powerful editor, i just do light editing of files.

Link to comment
Share on other sites

If you mean by that question that you want to make a line that is longer than the screen (or the 80 char limit or whatever) there is a way to get around it. All you need is go to the second line that nano/pico create automatically, then go to the leftmost side, then press the backspace /delete key. It will then attach the second line into the first line and it will show a $ sign showing that there are more things on the right side. You just need to press "right" to see the rest of the line.

Link to comment
Share on other sites

is there a reason for me to learn emacs or vi? 

Yes there is, say X crashes, to fix it you need to edit a file, how you going to do it? most of the text editors like kedit etc, won't work if X isn't running.

vi is the answer, comes pre-installed, and you don't need X

Link to comment
Share on other sites

>vi is the answer, comes pre-installed, and you don't need X

 

Flamebait!!!! :wink:

 

Emacs comes pre-installed and doesn't need X!! I prefer it, but I think it's really a case of which one you try to learn first is the text editor you'll prefer.

 

I like emacs' ability to cut and paste rectangles and couldn't find this in vi...

Link to comment
Share on other sites

You both are wrong :P Neither emacs nor vim are available(1) for you when something goes really wrong in your system (I mean REALLY wrong)! but "vim minimal" (the closest vi clone from the vim guys) and ed are both right there when they are needed, both are very powerful, and more important they have similar commands to what you are used to use if you edit your files with vim.

 

The knowledge of the basic vim commands would mean the difference of a trivial fix of a missconfiguration, and a full reinstall.

 

Another important tools you should know how they work (as they will save you many times) are: awk, sed, grep, ..., and ofcourse you'll need to feel confident with bash.

 

I like emacs' ability to cut and paste rectangles and couldn't find this in vi...
have you ever played with vim in VISUAL MODE? ;)

 

 

(1) The "available-ness" of the binaries depends on how you have partitioned your hd (ie, /usr/bin/ files aren't usually available if the system only can mount the / partition; commonly the /usr tree is mounted in a separated partition)

Link to comment
Share on other sites

from nano's man page:

 

    -w (--nowrap)

              Disable wrapping of long lines.

 

:oops: thanks. i must've missed that one. i'm more comfortable doing simple editing in console than in an X app (kedit, gedit, etc). not sure why.

 

i can use vi enough to edit a line or two if i have to boot from the rescue disk... but i wouldn't want to ever have to use it for much of anything else.

 

i also just realized why nano probably seems easier. i hadn't remembered that pico was the editor used in pine, which i used many years ago. so between that, the fact that i had a cat named nano (not the cat in my avatar), and my laptop is named pico... i like nano & pico. (yes, i'm weird).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...