Jump to content

Tips&Tricks Text mode editing in linux (You really ne


aru
 Share

Recommended Posts

 

Technonoid

Moderator

Joined: 16 Apr 2002

Posts: 292

Location: GA. (US)

 

Post Posted: Wed May 15, 2002 2:57 pm Post subject: Text mode editing in linux (You really need to know this)

_________________________________________________________________

 

 

I should be ashamed for not learning this in the beginning, and don't see how I managed this long. But anybody not knowing how to use a text editor in linux text mode should really learn one or two of the programs. They are a number of them, vi, pico, ed, ..... But I have been so enthused with linux, I never took the time to even look at them. Well, the time came when I needed to. I tried to use vi. I did mange to figure out how to use it a little. However I didn't have time to learn something at this point. So, I thought for a second and hit mc at the prompt. (Thats midnight commander). It has a lot of neat things you can do in a non-gui environment. It even has a simple to use text file editor. It saved my @$$.

 

Anyway, I didn't mean to make a story out of this. I just want you to know in advance that you never know when you will need to edit files without the GUI or X running. So I'm suggesting that you learn some of the command line editors.

 

mc is a good choice. However, its not an editor. Its a command line shell that can do lots of things, including text file editing.

 

Please, feel free to add your thoughts on command line text editing...

Last edited by Technonoid on Wed May 15, 2002 5:29 pm, edited 2 times in total

 

 

thayne

Senior user

Joined: 29 Apr 2002

Posts: 401

Location: Your dreams

Post Posted: Wed May 15, 2002 3:48 pm Post subject:

_________________________________________________________________

 

 

I hate VI, Pico is cool for a simple text editor. I think it's easier to use. I think these are a must! On my Linux server I do everything with either webmin or I ssh into it in a terminal shell. I'm getting to where I can do most stuff in the terminal Cool

 

 

DragonMage

Senior user

Joined: 01 May 2002

Posts: 391

Location: Hayward, CA

Post Posted: Wed May 15, 2002 5:38 pm Post subject:

_________________________________________________________________

 

 

I cannot stand vi, even back during my old unix days in college. I think it's even worse than edlin (remember that command from the old dos?) The only thing vi got in its side I think is that it is available in every unixoids present.

For simple text editting, I prefer pico (you need to install pine to get this) or its clone nano. It is as simple as dos edit command, just need to be careful when you need the line to unwrap because it likes to wrap lines automatically.

Of course, there are command line text editors you can install in linux. That's the beauty (and the headache) of linux. There is vi, emacs, pico, nano, joe, jed, and bunch more.

 

 

arusabal

Moderator

Joined: 17 Apr 2002

Posts: 836

Location: Spain

Post Posted: Wed May 15, 2002 6:29 pm Post subject:

_________________________________________________________________

 

 

I love vi, almost every day I learn a new trick or a new feature that I didn't knew... It's powerful, fast and 'easy' to use (don't confuse use with learning)

 

About command line editing you shouldn't forget the powerful stream text editors such tr, sed or awk, which combined with tools like grep, cut or awk (<-is not an error I've put awk twice) makes the linux life easy and fun Wink

 

About mc, did you know that was wrote by Miguel de Icaza, the same guy who is the head of the Gnome Project

Last edited by arusabal on Wed May 15, 2002 6:37 pm, edited 1 time in total

 

 

Technonoid

Moderator

Joined: 16 Apr 2002

Posts: 292

Location: GA. (US)

Post Posted: Wed May 15, 2002 6:30 pm Post subject:

_________________________________________________________________

 

 

ahh yes yes, the days of edlin.

 

 

Technonoid

Moderator

Joined: 16 Apr 2002

Posts: 292

Location: GA. (US)

Post Posted: Wed May 15, 2002 7:14 pm Post subject:

_________________________________________________________________

 

 

arusabal wrote:

About mc, did you know that was wrote by Miguel de Icaza, the same guy who is the head of the Gnome Project

 

So, that must be why there is a gmc as well, hmmm.

 

 

tross04401

Moderator

Joined: 16 Apr 2002

Posts: 175

Location: Maine (US)

Post Posted: Wed May 15, 2002 7:26 pm Post subject:

_________________________________________________________________

 

 

Another vote for loving vi here.

 

 

illogic-al

Senior user

Joined: 01 May 2002

Posts: 358

Location: Smack dab in the middle of it all.

Post Posted: Wed May 15, 2002 8:21 pm Post subject:

_________________________________________________________________

 

 

vi Rox. I like vim better because of the pretty colors. I tried nano when I had to emerge a certain linux distrbution, but didn't like it.

 

 

bjc

Frequent user

Joined: 08 May 2002

Posts: 33

Location: Canada

Post Posted: Mon May 20, 2002 1:16 am Post subject: text editors

_________________________________________________________________

 

 

I've been using vi and Pico in the rxvt terminal. Can someone help on some questions. In vi, is there a justify command like the ^J in Pico?

It's very useful after some detailed editing to just justify the paragraph in one command. Second question: is there a copy/paste equivalent in vi for use inside and also out/in with other softwares?

Thanks in advance.

 

 

mr_krinkle

Newbie

Joined: 13 May 2002

Posts: 8

Location: New Mexico, USA

Post Posted: Mon May 20, 2002 11:14 pm Post subject:

_________________________________________________________________

 

 

I've only used vi, that's the first one I started to learn on, so that's the one I use. I've found that it's fairly easy to use, and make editing a breeze. I want to study emacs next.

 

 

DiscoStoo

Frequent user

Joined: 03 May 2002

Posts: 123

Post Posted: Wed May 22, 2002 6:24 pm Post subject:

_________________________________________________________________

 

 

I've played with Vim and Emacs a whole lot (read: more time than would be considered healthy) , but after a while I noticed that I felt much more comfortable in Vim. Emacs is cool too, but I dunno...I just hate memorizing strings of keypresses like that. I'd much rather type :x to save/exit than

ctrl+whothe****knowwhatelse+evenmorebs+alt+niner-3^(1/6) - but then, that's just me.

 

 

Omar Serenity

Moderator

Joined: 16 Apr 2002

Posts: 358

Location: Michigan

Post Posted: Wed May 22, 2002 10:52 pm Post subject:

_________________________________________________________________

 

 

Don't want to interrupt the flow here. I'd like to learn more about those, but am I safe for now using mc to edit files? Or will there come a time when my display won't allow it to work?

 

 

DiscoStoo

Frequent user

Joined: 03 May 2002

Posts: 123

Post Posted: Thu May 23, 2002 2:06 am Post subject:

_________________________________________________________________

 

 

No way. At least I don't think so. I've used it in xterms, regular consoles, framebuffer consoles, etc. As far as EYE know you'll always be able to use it (as long as you have a monitor, anyway).

 

 

midtoad

Newbie

Joined: 23 May 2002

Posts: 1

Location: Calgary, Alberta

Post Posted: Thu May 23, 2002 3:24 pm Post subject: Simple, small, editor: aee

_________________________________________________________________

 

 

Newbies: forget vi: it's vile! No on-screen help, and too difficult for your needs (sorry if if I've offended you power users, but this thread is for newbies). Pico is fine, but why load several MB of Pine just to get it? Instead, try aee, which is on your Mandrake CDs. It's small, fast, and the top third of your screen actually shows you the common commands you will need. You can also get it off rpmfind.net, here.

 

for that matter, there is nothing wrong with the text editor in mc, and as a newbie you'll find its navigational abilities useful as well. Hell, the thing can even do ftp and connect you to remote drives like they were on your own workstation!

 

 

Korbinus

Newbie

Joined: 07 May 2002

Posts: 16

Location: Sweden

Post Posted: Mon May 27, 2002 2:53 pm Post subject: Vi is really good

_________________________________________________________________

 

 

Simple, light, fast... What to ask more?

 

for people who want to run it in a console window in one click Cool , just make an icon or a menu item, according to your environment and your taste, and write the command:

 

gnome-terminal --command vi

 

Enjoy! Very Happy

 

Don't forget to read also the manual.

 

 

 

frew

Senior user

Joined: 01 Jun 2002

Posts: 214

Location: Mississippi

 

Post Posted: Sat Jun 01, 2002 10:16 am Post subject: vi...

_________________________________________________________________

 

 

vi maybe be hard. But right when I began using Linux I ordered Learning vi from O'Reilly. I admit vi is probably one of the harder things for n00bs to learn, but it will save you some time. I have been on systems where all I have is the bare necesities. and there is no pico, no joe, no Emacs. There will almost always be a vi. I agree with the guy who said vim is good. vim is basically the updated vi. I tried to use Emacs, it sounds really cool, I mean, check email, compile source, play games, all in an editor. The commands just seemed to obscure. Plus it had to load. Smile

 

 

spiedra

Senior user

Joined: 30 May 2002

Posts: 686

Location: Orlando, FL

Post Posted: Wed Jun 05, 2002 10:27 pm Post subject:

_________________________________________________________________

 

 

I've only tried vi so far and I like it. It was a little hard at first because I didn't know what I was doing, but now I can use it and do most of my editing with it.

 

 

 

Editor's note: This thread was originally posted at the old MUB (Mandrake User Board at club-nihil). This post is the result of a 99% automatic backup, so due to its nature some text may be lost (improbable but possible).

Link to comment
Share on other sites

Guest davebsr

Vi is the best. i don't need another text editor, becuase a) it's universal and B) it does everything i need.

 

vim is better. and :help gets you onscreen help. did i mention, vi rocks?

Link to comment
Share on other sites

Another Vi(vim) user here... i dunno about being "THE BEST OF THE BEST OF THE BEST...) but vi is the only editor that you're guaranteed to have, no matter which *nix box u're sitting in front of. So do make the effort to learn it - you WILL use it sooner or later.

 

For programming and such i use Kate alot.

Link to comment
Share on other sites

I'm adding here, what I had learned about copy/paste in the old board. To copy and paste from say a website into vi or emacs (works the same in both) you:

1. select the text to be copied in the website (left click held down and dragged)

2. go to emacs or vi

3. place cursor where you want to paste (in emacs, by left click; in vi put in insert mode, and move cursor to wanted position)

4. center click to paste (on my mouse, it's a wheel click)

5. selected text will be pasted in.

It's easy, and there is no clicking of copy or of paste under the "Edit" button necessary, as it is in Windows.

I couldn't get it to work in Pico.

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...