LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What is the best text-editor in Linux (https://www.linuxquestions.org/questions/programming-9/what-is-the-best-text-editor-in-linux-4175433425/)

Sergei Steshenko 10-25-2012 02:55 PM

Quote:

Originally Posted by theNbomr (Post 4812359)
'Best' has different meanings to different people and for different purposes. If there was only one 'best', then everyone would use it, and all of the others would just die off and go away. At best, you can get some impressions of others' preferences, but without knowing how you intend to use an editor, it is difficult ot give a qualified reply.
I have at least a couple of favorites, depending on what I'm using them for. I like vi for system admin tasks, because it is ubiquitous and doesn't require X. It can be built into busybox, and takes up little memory. It is great for quick edits of config files and scripts; get in, get out, no one gets hurt. On the other hand, if I'm doing software development tasks, I probably want an editor that is more full featured, uses GUI methods, and has some direct knowledge of programming languages I commonly use. I would tend to use it on a somewhat persistent basis, and maybe even use some kinds of hooks into compilers, debuggers, etc. The one I mostly use is nedit.

--- rod.

And I'm using NEdit too - since 1998.

CTech 10-25-2012 07:59 PM

Quote:

Originally Posted by theNbomr (Post 4814612)
Again, it depends on your definition of 'better'. If goodness is measured by productivity, a better text editor can help make a programmer better. It can help prevent certain classes of mistakes, and can make it easier and faster to maintain source code. As in any occupation that uses tools, a poor tool may limit the capability of the user, although simply having a good tool doesn't necessarily make a better user.

--- rod.

That's what I am saying. It was more of a question of what text-editor you use because I wanted to learn all the possible choices. I didn't mean it like which text-editor should everyone use. I just wanted to see if there was a concensus. Also, there is apparently no such concensus. I would note that a great amount could give into the fact that generally it is Vim or Emacs.

foodown 11-16-2012 03:37 PM

You should always know how to use vi.

"vim people" will talk about how great vim is, and that's fine; I'm sure that they have innumerable reasons which they think are valid. The truth, as I see it, is that, in this day and age, unless you plan to edit text files on some old Solaris 8 machines or something, learning any variant of vi will be fine and the ability will spill over to most any other variant that you will encounter. If you want to use "advanced features" of one specific variant, then by all means learn and use them, but just plain vanilla vi has plenty of nice features in and of itself.

Once you know vi, there is really no reason to learn any other command-line text editor unless you really, really want to use some of the crazy advanced features of emacs. You will find some kind of vi clone wherever you go.

If you're like most people, then after that you can pick up and use most any X11-based editor. They are almost all the same in most respects. Try them out; you'll find that you like one of them for whatever reason and stick with it. Whichever one it is, you won't be missing much by not using any other specific one.

Personally, I find that I like 'kwrite', which comes with KDE, specifically in "Power User Mode (KDE3 Mode)". I like it because it does syntax highlighting for you, which most all of the others do as well, and also because it has a very handy "Block Selection Mode".

At the end of the day, once you're not in the command line any longer, we're just talking about GUI text editors after all ... There isn't much room for variation.

EDIT: The suggestion of using an NT-based text editor under WINE doesn't make much sense to me, but even that isn't much better or worse than anything else in X, except that maybe you'd wind up calling 'dos2unix' a lot.

Thad E Ginataom 11-17-2012 01:43 AM

Quote:

At the end of the day, once you're not in the command line any longer, we're just talking about GUI text editors after all ... There isn't much room for variation.
Yes, I agree. If I am just copying/pasting stuff I just use the gui editor that goes with my release/desktop. I guess it is gedit, but I don't really care! As long as it does what notepad did/does, that's fine by me.

I don't think it is even a difference between "command-line" and "gui." I have an icon that starts gedit; I could just as easily have an icon to start, not an interactive shell, but a shell running vi. The only difference would be the absence of dopdown menu, so eg I have to use :w instead of mousing File->Save. Some methodology is different, that's all. vi is not really a "command-line editor," hence its name: ed, for instance, is a command-line editor --- but I think I know what you mean, which is what matters.

Those who need "portability" will indeed do well to know omnipresent vi basics. In fact, anyone who has anything at all to do with *nix probably knows the basics of vi, and if they don't they should. I often wonder at blogs and tutorials that, when giving instructions for editing config files use a command line, which might consist of a simple cat, or a complex sed. This gives no clue about the alterations in the context of the file, and worse, it leaves the inexperienced in a pickle when something goes wrong. Even with cut&paste, things can go wrong: many a time I've dropped a character, or included a unwanted punctuation --- or even found that my clipboard contained something entirely different!

konsolebox 11-17-2012 05:35 AM

Quote:

Originally Posted by foodown (Post 4831016)
EDIT: The suggestion of using an NT-based text editor under WINE doesn't make much sense to me,

Not unless you see the big difference of it among the other editors.
Quote:

but even that isn't much better or worse than anything else in X, except that maybe you'd wind up calling 'dos2unix' a lot.
Notepad++ works with Win, Mac and Nix file formats. You could set the default format for new files in the settings->preferences dialog box. Also, it's easy to convert one format to another via Edit->EOL Conversion.

foodown 11-17-2012 10:38 AM

Quote:

Originally Posted by konsolebox (Post 4831293)
Not unless you see the big difference of it among the other editors.

For anyone else reading and wanting to try what he's talking about without using WINE (like a 64-bit Slackware user), Notepad+++ is an NT program that is a very close code relative of SciTE.

No real programmer ever had reason to want anything more than edlin.

konsolebox 11-17-2012 10:25 PM

Quote:

Originally Posted by foodown (Post 4831411)
For anyone else reading and wanting to try what he's talking about without using WINE (like a 64-bit Slackware user),

I had explained enough for such kinds of answers. Not going to repeat myself again.
Quote:

Notepad+++ is an NT program
Of course it is.
Quote:

that is a very close code relative of SciTE.
And yes Scite is close since NP++ is based from Scintilla but not close enough based on capability and features.
Quote:

No real programmer ever had reason to want anything more than edlin.
Could you elaborate? Perhaps that concludes the difference.
Or at least tell us why those are real programmers.

For anything please carefully consider my previous replies in this thread, and posts of some other people too.

Snark1994 11-18-2012 10:49 AM

Quote:

Originally Posted by konsolebox (Post 4831750)
Could you elaborate? Perhaps that concludes the difference.
Or at least tell us why those are real programmers.

For anything please carefully consider my previous replies in this thread, and posts of some other people too.

Ey was joking. Look at the comic, it's making fun of the whole "real programmers do X" line of argument, each trying to outdo each other with the "spartan-ness" of their code editing method.

foodown 11-19-2012 12:24 PM

Quote:

Originally Posted by konsolebox (Post 4831750)
For anything please carefully consider my previous replies in this thread, and posts of some other people too.

Yeah that last line was a joke. Hence the link to a comic strip and the suggestion that, somehow, anyone would actually be using edlin for any reason other than for nostalgia. (Edlin is what we used on DOS before edit.com was introduced.)

I never intended any disparagement of you, Notepad++, or really anything else. I'm not sure how it could have been taken otherwise, but in case it was, there you go.

markush 11-19-2012 01:38 PM

Quote:

Originally Posted by foodown (Post 4832724)
...(Edlin is what we used on DOS before edit.com was introduced.)
...

Here's some backgroundinformation amongst others about edlin ;)
Quote:

...
Vince also collaborated with Edwin Lingerie of Great Britain in the writing of the MS-Dos editor edlin. (Edwin's great-grandfather designed a new line of women's clothing in 1903). Once again, the origin of the acronym edlin is lost forever. Some have suggested that since a lin is a precipice or ravine (which is where you will probably end up if you use edlin); lin forms edlin along with ed (editor).
the link is here ;)

Markus

foodown 11-19-2012 03:00 PM

I always figured that since it was a line editor by Edwin Lingerie, the derivation of the title was quite clear ... Kindof like Linus Torvald's version of UNIX.

konsolebox 11-19-2012 06:43 PM

Quote:

Originally Posted by foodown (Post 4832724)
Yeah that last line was a joke. Hence the link to a comic strip and the suggestion that, somehow, anyone would actually be using edlin for any reason other than for nostalgia. (Edlin is what we used on DOS before edit.com was introduced.)

I never intended any disparagement of you, Notepad++, or really anything else. I'm not sure how it could have been taken otherwise, but in case it was, there you go.

Sorry. I must admit I didn't read that well.

otoomet 11-20-2012 11:50 AM

I would say it depends on what are your prospective coding tasks.

* If you just do a little occasional programming, pretty much any editor would do.

* If you intend to become a programmer, I would go either for emacs/vim, or a full-blown IDE, like eclipse. Myself, I like emacs but I have to admit that an IDE (have used netbeans for a java project) has a quite useful tools I miss in emacs.

* If you are going to do some sort of coding at customers' computers, go for something ubiquitous like vi (on unix) or wordpad/notepad (on windows -- yes, I am serious).


All times are GMT -5. The time now is 11:31 AM.