Simple linux console text editor wanted [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this questionI'm a linux newbie coming from a Windows background and I am trying to find a simple full-screen console-based plain-text editor. Something that emulates the look and feel of the Windows edit.com would be perfect.
Specifically, I'm looking for;
- A plain text editor.
- Console-based not GUI-based.
- Full-screen not command line.
- Menus to tell me what my options are. I don't want to have to find out and remember a complex set of keystrokes specific to that one application.
- An application that is in the default apt-get / yum repositories, or failing that is easy for a newbie to install.
I'm using small-footprint versions of Ubuntu 904 and Centos 5.5.
edit:
I suppose what I'm looking for is a console editor that conforms to the normal keystrokes used by GUI editors, ie. cursor keys to move up/down/left/right, pg-up / pg-down keys to move up and down a page, home / end keys to move to the start or end of a line etc etc. In other words, the keys we all use without thinking, in any GUI environment, be it Windows or Linux.
mcedit
@mpapis I got mcedit going and learned a lot in the process. For the benefit of other linux newbies I would like to share what I learned.
This is how I installed mcedit on my system which is a Centos 5.5 minimum build running in a VPS.
Starting mcedit
To start mcedit from a console, do;
mcedit
If mcedit is installed it will start and your screen will look like the screenshot above. But if you get an error message like;
No such file or directory
then you need to install mcedit.
Installing mcedit
mcedit is part of a package called mc. To install mcedit you must install mc. To install mc do;
apt-get install mc
If apt-get knows about mc, then you will be asked a question like;
After this operation, 17.4MB of additional disk space will be used.
Do you want to continue [Y/n]?
Go ahead and install it by pressing the 'y' key then then the 'enter' key.
But if you get an error message like;
Package mc has no installation candidate
then apt-get doesn't know about mc, so you have to tell apt-get about mc. mc is stored in the universe repository. To tell apt-get about mc, you need to tell apt-get where the universe repository is. The universe repository is a popular and safe ubuntu repository.
Tell apt-get about the universe repository
The /etc/apt/sources.list file tells apt-get what repositories are where. You can view sources.list by doing;
more /etc/apt/sources.list
For apt-get to know about the universe repository, the sources.list file must contain the line;
deb http://archive.ubuntu.com/ubuntu/ jaunty universe
Add the above line to the sources.list file by doing;
echo deb http://archive.ubuntu.com/ubuntu/ jaunty universe >> /etc/apt/sources.list
The ">>" means append the preceding text to the specified file.
To check whether the above has worked, show sources.list by doing;
more /etc/apt/sources.list
If it worked, the last line of the file will be;
deb http://us.archive.ubuntu.com/ubuntu/ jaunty universe
Now tell apt-get about the change you just made to the sources.list file by doing;
apt-get update
You should see;
Reading package lists... Done
So you can now do;
apt-get install mc
Then run mcedit by doing;
mcedit
And you should see the screenshot above.
pico
or nano
should do fine - joe
is also pretty straight forward. vi/vim
and emacs
have somewhat of a learning curve, but both are worth the invested time.
For the "GUI-shortcuts", try Diakonos editor (it is in the repositories). One of the author's goals is actually to provide similar keyboard-shortcuts interface, so that ^O, ^S, ^W, F1 etc do exactly what you would expect from a GUI editor.
Another good choice is jed (also in the repositories). It has emacs-like shortcuts, but it also has a menu row, allowing to visually navigate through commands (and the menu also does show the shortcuts). Jed also has some nice features for programmers. Overall, I like jed more than diakonos - give it a try.
It is also worth mentioning that almost always keyboard shortcuts are configurable. That is still an inconvenience (esp. when working with multiple PCs), but an option.
I'm a big fan of mcedit
it is shipped with Midnight Commander a Total Commander like file manager, additionally in the package you get mcview
for viewing files with multiple options.
精彩评论