Linux text editor is better. Text editors. The Best Modern Open Source Text Editors for Linux

The code editing programs listed here will help developers moving to Linux develop new, revolutionary applications.

Learning to code can be challenging, but the right tools can make the process a little easier. Once you start writing great code, you can get so carried away that you forget about everything else. But this exhilarating experience can be ruined by the wrong tools. When it comes to cars, the MacBook is probably the the best choice for developers who spend hours weaving together code. Besides Mac OS, which runs on a MacBook, there is another platform suitable for creating applications, and that is Linux.

Over the years, Linux has developed and expanded, gaining market share from Windows. Thanks to the efforts of the community, today there are many Linux distributions for a variety of needs.

There are even distributions created for developers. However, you don't have to switch to them to use the code editors in this article.

These programs will increase your productivity with their thoughtful features.

1. Atom

Atom is an open source editor developed by GitHub. It is suitable for any developer, from noob to expert. The biggest advantage of Atom is its customizability for any needs and at the same time the ability to get started right away without looking into configs.

Atom offers several customization options to change the look and feel to your liking. If you're familiar with HTML and JS, you can even tweak the look and feel by making some changes to the UI. All these properties make Atom the top of our list.

Features of the Atom Code Editor

  • Cross-Platform Editing: Atom is available not only on Linux but also on other platforms such as Windows and Mac.
  • The built-in package manager allows you to easily search for and install new packages.
  • Smart Autocompletion: With this smart, flexible Atom feature, you can write code faster.
  • Browser file system makes it easy to search and open separate files, a whole project or several projects in one window.
  • Multiple panels: you can compare and edit code in different files, breaking the interface into several separate panels.
  • Power and simplicity
  • Richness of settings

Against:

  • Beginners will have to work with this editor for some time to learn how to use its functionality to the fullest.

Installing Atom on Linux

If you are using Ubuntu or its derivatives, you can install Atom using a PPA by running the following commands:

  • sudo add-apt-repository ppa:webupd8team/atom
  • sudo apt-get update
  • sudo apt-get install atom

If you are using Debian or Fedora-based Linux distributions, you can use the .deb and .rpm packages. Currently, Atom is only available for 64-bit systems.

2. Sublime Text 3

Sublime Text is the most widely used code editor for Linux in the developer community. This is a lightweight and uncomplicated code editor. Sublime Text is built from custom components to provide unparalleled responsiveness. With powerful, customizable cross-platform tools user interface With an unrivaled syntax highlighting engine, Sublime Text sets the performance bar high.

This program can be used as a simple text editor with syntax highlighting. By adding additional plugins, you can expand its functionality so much that it is capable of almost everything that an IDE can do. In addition, Sublime Text offers many customization options. Keyboard shortcuts, menus, snippets, macros, extensions and much more - almost everything in Sublime Text is configured using regular JSON files. This system gives you flexibility as the settings can be different for each different types files or different projects.

Features of Sublime Text 3

Here are some of the best features of this editor:

  • Multiple selections: This feature will improve your productivity by allowing you to make multiple changes at once.
  • Command Palette: You can perform various operations with just a few keystrokes, saving time.
  • An abundance of settings will help you customize the appearance and behavior of the editor.
  • “Distraction Free” mode: your files are displayed in full screen, and the sidebar, menu, map are hidden.
  • Supports many programming and scripting languages.
  • Simple interface.
  • Code completion and syntax highlighting.
  • Performance.
  • Extensible Python API.

Against:

  • Complex functionality integration.

Installing Sublime Text on Linux

The stable version of Sublime Text 3 can be installed by entering the commands below in the terminal. This method is suitable for distributions based on Ubuntu and Debian. If you are using other distributions such as Fedora, Arch and Suse, please refer to this page for installation instructions.

  • wget -qO – https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add –
  • echo “deb https://download.sublimetext.com/apt/stable/” | sudo tee /etc/apt/sources.list.d/sublime-text.list
  • sudo apt update
  • sudo apt install sublime-text

3. Vim

Vim is an enhanced version of vi, the editor program that comes with most UNIX systems. Vim is often and deservedly called a “programmer’s” editor. It is highly reconfigurable and very useful in programming, which is why many consider it an entire IDE. Of course, it is not only suitable for programmers. Vim is great for any kind of code editing, from composing emails to editing configuration files.

Vim can be used as a standalone application or run on the command line (it's one of the first programs that comes to mind as an editor command line).

Features of Vim

  • Automatic commands
  • Entering digraphs
  • Split screen
  • Session screen
  • Tab key expansion
  • Color syntax
  • Tag system
  • Powerful and full set functions for programmers.
  • Stable and popular.

Against:

  • The program is challenging for beginners, but if you're willing to spend some time learning, you'll be fine.

Installing VIM on Linux

There are several ways to install Vim on Linux. There are various installation files, but here we will show the installation via PPA repository.

  • sudo add-apt-repository ppa:jonathonf/vim
  • sudo apt update
  • sudo apt install vim

By the way, to make learning the editor easier, you can run vimtutor - a manual and program for practicing work skills.

4. Brackets

Brackets is a modern, popular code editor from Adobe available on Linux. It is free, unlike other Adobe software. If you are a web developer, then Brackets is especially suitable for you as it is built with development needs in mind. This editor has several features that can be extended with additional plugins. Adobe worked on Brackets to create the best modern code editor for Linux.

Brackets, after installation, already has all the functions required for a modern text editor. It is based on JavaScript.

Features of the Brackets text editor

  • Live viewing: you can immediately monitor the results of code changes.
  • Inline editing allows you to edit CSS or other code snippets right away, without having to navigate to the appropriate file.
  • Preprocessor: Editing preprocessors with Brackets is more convenient than with other similar text editors. You can easily edit SASS and LESS files.
  • Lightness.
  • Open source.
  • Powerful visual tools.
  • Availability of useful extensions.

Against:

  • Not the best more advanced scripts and languages.

Downloading and installing Brackets

The latest version of Brackets is v1.11. You can install it on your Linux machine by downloading the .deb package. This method is suitable for Ubuntu and Debian based distributions. For other distributions, you will need to compile the source code available on GitHub. The commands below are for installing Brackets from the corresponding PPA repository.

  • sudo add-apt-repository ppa:webupd8team/brackets
  • sudo apt-get update
  • sudo apt-get install brackets

5. Bluefish Editor

Bluefish is more than a code editor. It seems more like a modern IDE like Eclipse and Netbeans. With its large set of features, it can do almost everything that an IDE can do. One interesting feature of Bluefish is its integration with third party programs. Bluefish is versatile in terms of support for various languages. It supports Ada, ASP.NET, VBS, C/C++, CSS, CFML, Clojure, D, gettextPO, Google Go, HTML, XHTML, HTML5, Java, JSP, JavaScript, jQuery and Lua.

Features of Bluefish

Here are some features that make this code editor stand out from the crowd:

  • Speed: Bluefish launches quickly (even on netbooks) and downloads hundreds of files in seconds.
  • Integration of external filters of your choice, redirecting your document (or selected text) to the input of sort, sed, awk commands or any custom script.
  • Multi-threaded support deleted files using gvfs, support FTP, SFTP, HTTP, HTTPS, WebDAV, CIFS.
  • Built-in spell checker that recognizes programming languages.
  • Supports many programming and scripting languages.
  • Clean and user friendly UI.

Against:

  • Lack of ability to edit many lines at once.

Installing Bluefish

To install Bluefish on Ubuntu or distributions based on this OS, you can run the following commands:

  • sudo add-apt-repository ppa:klaus-vormweg/bluefish
  • sudo apt-get update
  • sudo apt-get install bluefish

Conclusion

Developers often disagree about the best code editor, both in general and specifically for Linux. The editors featured in this article were selected based on their performance, ease of use, and customization capabilities. You can choose the one that suits you best, both from this list and from those not included in it.



Chapter 12. Programs for working with text

12.1. A few words about text file formats

As you know, any file, including files in which text documents of one kind or another are stored, is simply a sequence of bytes. Text characters are encoded with different byte values ​​or sequences of bytes. Information about how exactly these characters should be positioned on the page is also encoded using non-displayable control characters, such as end-of-line or tab characters. In the simplest cases, the number of control codes is limited to the first 32 byte values ​​(or ASCII code), and all remaining byte values ​​are used to encode information characters. It is these files that we call ASCII files. Examples of such files include files created by editors such as the built-in editor in Midnight Commander, files created by notepad on Windows, and vi on UNIX.

Over time, there was a desire to expand the possibilities of text formatting, which meant that it was necessary to increase the number of codes used as control codes, and even sequences of bytes (ASCII characters) began to be used as such codes. But the important thing is that these formatting sequences (almost) do not prevent you from reading the text contained in the file using any simple viewer or simple text editor. Examples of such files are files created by editors such as Lexicon, files in html format.

The third type is files that use their own format to represent text (in which text characters are also represented by special sequences). The most significant difference between the third type of formats and the two previous ones is that it is almost impossible to view and create files in such formats without special programs. For example, HTML files can be edited using Notepad, but the same cannot be done with MS Word 97 format files.

Sometimes it is difficult at first glance to attribute a file to one type or another. For example, Post Script files are technically type 2 because all readable text is in ASCII code, but these files contain so many formatting inserts that the text can only be found with great difficulty, much like in type 3 files.

It follows from the above that even viewing some types of text files (not to mention editing them) requires special software. Often, to view files, the user uses his usual text editor. But there are situations when information is presented in a format unfamiliar to this editor. The biggest problem for Linux fans is the formats used in Microsoft products. While most PC users create texts in MS Word, they have to either find a text editor that understands Word formats, or find translators from the Word format to one of the open standard formats. However, even if the information is presented in “simple” ASCII code, when viewing a file, you may encounter “unreadable” text due to the difference in Russian language encodings used. So first let's look at how to read (or view) files in different formats or encodings.

12.2. Programs for viewing texts in different formats

I read somewhere that the UNIX tradition was to create a separate command for each elementary action. This observation is well illustrated by the presence in Linux of a whole host of separate programs for viewing files. Of course, if you're using a file manager like Midnight Commander or Konqueror, you'll be using their built-in file viewers. But in some cases, it may be useful to know how to view the contents of a particular file, simply working in the terminal.

12.2.1 Traditional UNIX tools for viewing text files

The easiest way to view a file is probably the cat command. After displaying the contents of the current directory using the ls command, you can also display the contents of any existing files with the cat command. However, one inconvenience arises: if the file is large, then as a result only its last lines remain on the screen, everything else “runs up.” You can, of course, scroll through several screens using the ‹Shift›+‹PgUp› keys, but this possibility is also limited (some value set in the environment, by default - a value of 1000 lines).

To organize page-by-page output, there is a filter command more. It can be used in two equivalent versions:

The less command is an improved and modified version of the more command, which is recommended to be used instead of more in all cases. Keep in mind that the less command is used to display interactive man pages.

To view only the last few lines of a text file, there is a special tail command, which can be used to specify the number of lines to be output as a parameter. It can be assumed that having such a command was very useful in those days when text files were created using the cat program, by direct input from the terminal, something like this:

In this case, after any break in work, it was simply necessary to review the last of the entered lines in order to remember where the work was stopped.

However, those days are long gone. To create texts they began to use text editors, and for saving - not simple ASCII files, but special, quite sophisticated formats that allow you to save not only the text itself, but also information about paragraphs, pages, styles, fonts and much more. And to view such files they began to require special programs(in computer geek slang - viewers), which do not display all special formatting characters on the screen, but convert them into appropriate indents, protrusions, spaces, fonts, etc. Let's consider such viewers for two common file formats.

12.2.2 Acrobat Reader (version 4.05)

Acrobat Reader is designed to view files in the Portable Document Format (pdf), which is widely used in the computer world and is used in different operating systems and on different platforms. PostScript documents can be easily converted to this format. PDF files are very common on the Internet. It is not necessary to be able to create such files (programs for creating them are distributed commercially), but you need to be able to read them. The Acrobat Reader program from Adobe Systems Incorporated, distributed free of charge in both versions for Windows and versions for UNIX, and in particular for Linux, serves precisely this purpose. Currently, version 4.05 of this program for Linux can be obtained for free on the company's website http://www.adobe.com (version 5.0 has already been released for Windows).

To install Acrobat Reader 4.05 you will need 12 MB of disk space, and to work with the program - 32 MB of RAM. If you had version 3.0 of this program installed, you must first remove it.

Before you begin installation, choose one of two possible installation options: network or local (on a separate computer).

Local installation guarantees you access to the program on this computer and can provide significantly better performance (especially compared to running over a busy network). For local installation, you, of course, must have write permission to the directory where the program will be installed.

Network installation makes it easier to solve the tasks of administering and supporting the program, especially in cases where the program is used by many users. Obviously, it is easier to update one instance of a program on a server than to update multiple copies on separate computers. Network installation must be performed by the server administrator.

However, network installation also has some disadvantages. The server must be highly reliable and the installed files must be installed in a directory that must be mounted in the same way (to the same mount point) on all workstations on the network.

By default, Acrobat Reader is installed in the /usr/local/Acrobat4 directory (use the df command to verify that there is enough free space on the appropriate disk partition).

If you received the Acrobat Reader file from a Web site, you must first unzip setup files using gunzip and tar programs. After this, you need to go to the directory containing the installation script and run it:

The installation script displays several questions on the screen, in particular about which directory to place the program files in. For each question, an answer option is offered, which can be accepted by simply pressing the ‹Enter› key. If the default answer does not suit you, enter your own answer. Otherwise, you just need to follow the instructions given by the installation program. If you make a mistake somewhere, you can interrupt the installation with the combination ‹Ctrl›+‹C› and start all over again.

In the end, a message appears stating that the installation was completed successfully (in English, of course, something like “installed successfully”).

After installation, several subdirectories are created in the directory where you installed the program (let me remind you that by default this is /usr/local/Acrobat4):

The bin directory contains a script to run the program,

The Reader directory contains help files and some platform-specific files (see note below),

The Fonts directory contains fonts,

The Browsers directory contains a script to launch Acrobat Reader from the Netscape browser.

Note

If you chose the network installation option, then several binary file options will be installed in the Reader directory, and the program launch script will select the binary file option that is needed for the workstation from which the program is called!

Finally, to complete the installation, you can make it so that you do not have to first go to the directory where the launch script is located each time you launch Acrobat Reader. To do this, you need to create a link to this script in one of the directories specified in the $PATH variable. For example, let's create the following link in the /usr/bin directory:

# ln -s /usr/locale/Acrobat4/bin/acroread /usr/bin/acroread

In order to conveniently launch the program in a graphical environment, all that remains is to create an icon (“icon”) on the desktop (if you don’t remember how to do this, see the description of the graphical environment you are using) and the installation process of the program can be considered complete .

Now you can launch Acrobat Reader (of course, this must be in graphical mode) using the acroread command or by clicking on the icon on the desktop.

$ /usr/local/Acrobat4/bin/acroread

In order to view a specific file or even several using Acrobat Reader, you can immediately specify the names of these files on the command line. For example,

$ acroread /user/share/docs/Samba/Collection.pdf

Rice. 12.1. Acrobat Reader window

If you issue the acroread ‹filename› command while Reader is already running, the active copy of Reader will display the specified file.

If you want to get help using the program, enter one of the commands

Using Acrobat Reader you can convert files PDF format to level 1 or level 2 PostScript files, provided you do so from the graphics mode command line. To do this you need to run approximately the following command:

$ cat sample.pdf | acroread -toPostScript › sample.ps

Using similar commands (a more detailed description of which you can find in the program documentation) you can convert a group of files at once.

To convert a PDF file back to a Level 2 PostScript file, type the following command:

$ acroread -toPostScript -level2 pdf_file_1

I will not describe in detail all the menus and capabilities of the Acrobat Reader program, since it is widespread and familiar to many readers. It’s better to take a closer look at specific Linux file viewers.

12.2.3 gv program

The gv (or ghostview) program was developed by Johannes Plass and is designed to view PostScript and PDF files (Fig. 12.2).

After launching it without specifying a file name, the main program window will be empty. To open a file, you need to click on the key Open in the left column. A file selection window will appear (Fig. 12.3), with which you can navigate through the directory structure and select required file. After this, the file name will appear in a special field in the upper frame of the main program window. Several program control buttons are also displayed there, which form a kind of menu. Just to use this menu, you don’t just have to click on the buttons, but hold down the left mouse button.

Using the button File you get access to items Open(same as the button mentioned above Open in the left vertical column), Reopen(Reread) Print document(Print document), Save document(Save document).

Button State(Status) allows you to enable or change some program parameters, in particular, access a separate program settings window, shown in Fig. 12.2.


Rice. 12.2. gv program window

Button Page serves to move to the next or previous page of the document. The same transitions can be made using two small buttons, indicated by the symbols ‹‹ and ›› in the left vertical column. Next to the button Page There is a button that does not have a permanent name, because it serves to set one of 4 possible text output orientations. Text can be displayed on a page oriented in the usual way (Portrait), rotated 90 degrees (Landscape), 180 degrees (Upside-Down, i.e. upside down), 270 degrees (Seascape).


Rice. 12.3. Window for selecting a file to view in gv

Rice. 12.4. gv program settings window

The next button is used to set the image scale, which is indicated on this button. Another button is used to select the paper size. This is necessary for organizing printing, because the gv program is a means for previewing what will appear on paper.

There is another interesting thing in the left column: a gray rectangle above the ›› and ‹‹ buttons. Inside this rectangle there is another rectangle that can be grabbed with the mouse and moved within the outer rectangle. Do this and you will understand the purpose of this element: to display different parts of the page in the viewport.

12.2.4 PS, PDF and DVI file viewers from KDE

The user interface of the gv program is somewhat unusual for a person who has only worked with Windows. Meanwhile, the KDE integrated graphics environment includes two programs with a more traditional appearance. These are the “PS/PDF Viewer” and the “DVI Viewer” (as these programs are called in the headers of their own windows and in the KDE menu). Their interface is very similar and this is explained by the fact that they work through the same shell - KviewShell. However, in the KDE menu they are listed as separate programs, and each of them displays its own name in the window title.

Comment:

Here it can be noted in passing that in UNIX this technique is very often used: a “workhorse” (back-end) is created, for which beautiful shells (front-end) are then written for different cases, for example, for text and graphical modes or for different library options. You will come across examples of this approach more than once, even while reading this book, although I will not highlight these points separately.

In Fig. Figure 12.5 shows the appearance of the window of the PS/PDF Viewer program (developed by Wilco Greven, David Sweet, Mark Donohoe, David Faure, Daniel Duley and Espen Sand.), otherwise called Kghostview, which apparently indicates its origins in program discussed in the previous subsection. The relationship with the previous program is also indicated by the fact that almost all menu items repeat similar gv items, only the menu is organized slightly differently. This can also be seen from the figure. There is no point in talking about the program in more detail; it is enough that you know about its existence. And you can easily learn to use it on your own.


Rice. 12.5. Appearance PS/PDF Viewer window.

I will also not talk about the DVI Viewer program, limiting myself to the already mentioned mention of it and the message that it is intended for viewing DVI format files created by the TEX layout system.

12.2.5 WordViewer package

As mentioned above, one of the biggest problems for Linux users- this is working with files in MS Word formats (and other programs from the MS Office package). After all, so far most texts are created in this format. The most common means of viewing such files is the program (more precisely, a library of programs) wv, which previously bore the more complete name mswordview.

The wv library is intended for accessing files in MS Word 2000, 97, 95 and 6 formats from UNIX operating systems, in particular from Linux. The ALT Linux Junior 1.0 distribution includes version 0.6.5 of this package, authored by Dom Lachowicz and Caolan McNamara (the original developer). If you do not have this package installed, you can find it at http://www.wvware.com.

The idea implemented in this package is very simple: since we do not have the means to view files in MS Word format, then let's convert the text from these files into some open format. As the latter, you can choose one of the following formats: HTML, PS, PDF, LaTex, DVI (TEX publishing system format), ABW (AbiWord text editor format), Wml (format used in personal PDA organizers and devices such as Web phones) , ASCII text. Calls to individual library procedures can be used in other applications. The developers promise that it will soon be possible to inverse conversion: from the listed open formats - into MS Word format.

The package consists of separate programs, each of which is designed to convert a doc file into a specific format. This format is indicated directly in the names of individual programs in the package: wvAbw, wvCleanLatex, wvDVI, wvHtml, wvLatex, wvMime, wvPDF, wvPS, wvRTF, wvSimpleCLX, wvText, wvWml. In addition, the package includes two auxiliary utilities: wvVersion, which is used to obtain information about the version of an MS Word document, and wvSummary - this utility displays general information about the document, which can be entered in MS Word itself through the menu item File | Properties. This is what the output of these commands looks like (for the file I used in this example, the service data was not entered; however, if you enter them in Russian, then there will be not much more joy, since the output will be in the CP-1251 code page, so the text is in the screen will be unreadable).

$ wvVersion book-p1.doc
$ wvSummary book-p1.doc
The keywords are no comments found
The app name was Microsoft Word 8.0

The main utility of the package is the wvWare (or wvConvert) program, which is called as follows

wvWare filename.doc › filename.html

Main options:

Indicates the output filter being used.

Sets the code page for iconv.

Sets the password for encrypted Word documents.

Specifies the directory in which the generated graphics will be saved.

Returns the wvWare package version.

Displays brief help on using the program.

The output filter, specified by the -x or -config= option, specifies the output file format. If this option is not specified, then the output filter is searched in the current directory or (if not found in the current one) in the location where the package is installed. By default, the wvHtml.xml filter is used, i.e. the doc file is converted to HTML format.

After conversion, the resulting file can be viewed using an appropriate viewer, for example, an html file using any Web browser. Of course, some of the formatting capabilities found in Word are lost, and this must be kept in mind when viewing the resulting files.

As far as I can tell, it is the wv package programs that are used to open MS Word files in some text editors for Linux, for example, AbiWord.

12.2.6 Code page transcoder programs

As you know, there are several alternative encodings or code pages for representing characters of the Russian alphabet.

On Unix systems, the most common encoding is KOI8-R; Microsoft uses CP-1251 or CP-866 (DOS). There are also ISO8859-5, UTF, Unicode (you can read more about encodings in Section 9.3).

If you encounter a file whose contents are “unreadable,” then you will need a transcoding program. As they say in RU.LINUX.FAQ: “There are simply a huge number of CP1251 and CP866 -› KOI8-R transcoders. No need to write new ones;-). The most widely used are iconv (included in the glibc distribution) and GNU recode.”

The iconv program is launched as follows:

$ iconv -f866 -tKOI8-R -o ‹outfile› infile

If you do not specify the output file (option -o), the result will be displayed on the screen (using the more or less filters you can conveniently view the file). To get a list of all possible encodings (and it is huge!), issue the command iconv -list, and for help: iconv -? or iconv -usage. By the way, the man page is not displayed. However, there are still very few other options: only -verbose (report additional information), -V, and -version (both options are used to display the program version).

The recode program can be found at http://www.iro.umontreal.ca/~pinard/recode/.

It starts something like this:

$ recode CP1251..KOI8-R winfile.txt

In addition to the mentioned commands, you can use the "Russian Anywhere" program, which exists both in a version for Windows (where I got acquainted with it) and in a version for the command Linux strings(the creators promise to release a graphical shell). This program can be downloaded (both in source code and as an executable module) from the developer’s website http://www.livotov.org/software/.

The executable module of the program is called re. It is better to place it in one of the directories specified in the PATH variable.

The program is called from the command line. In order to recode some file that is “unreadable” into KOI8-R encoding, you need to issue the command:

$ re ‹SourceFile› ‹DestFile›? K

‹SourceFile› - source (unreadable) file;

‹DestFile› - recoded file;

Tells RE that the encoding of the source file is unknown and re must analyze the file and determine its encoding itself;

K - specifies the encoding for the resulting file (in this case KOI-8).

If you know the encoding of the source file, you can specify it instead of the "?" character. For example, if you want to transcode the letter.txt file that was created in Windows, and you know that the file was saved in 1251 encoding, then you would issue the command:

$ re letter.txt letter-koi.txt W K

After that, by looking at the letter-koi.txt file, you will see quite readable Russian text in KOI8-R.

Full format for calling the transcoder:

$ re options filename_from filename_to cp_from cp_to

where options: [-v][-E|-R|-N][-e|-s]

V - provide information about the progress of processing;

N - do not provide information about the processing progress (set by default);

E - convert all characters p, H from Russian to English;

R - convert all characters p, H from English to Russian;

N - leave all p, H (Russian and English) as in the source text (set by default);

E - recode all characters 0x80 - 0xFF;

S - transcode only 64 characters of the Russian alphabet (set by default),

and cp_from and cp_to are any of the following characters indicating possible encodings (default is W,K).

Table 12.1. Designation of encodings in the program re.

Symbol Encoding Symbol Encoding
W Windows _ (underscore) _xxe
D Dos % %hex
K KOI-8 \\ \"hex
L Latin G Graph_win
I ISO binhex
H HEX + +UTF7-
S ShiftKbrd C C_MIC
M Mac Y Y_c16
A AFF Z Z_c32
O Odd(UTF8_1) F F(UTF8_2)
B Base64 P Pict
E Express N N_Estl
T T-Html V V_Vpp855
U User X X_sp
- (dash) uue J J_diff

As already mentioned, if cp-from="?", then the program tries to independently determine the encoding of the source file.

If for some reason you do not have any of the specified transcoding programs, then to view the contents of the file you can use one of the Internet browsers, which are initially designed to work with different encodings. For example, regular lynx will do:

$lynx -assume_local_charset cp866 file.txt

You can also load an “unreadable” file into Netscape Navigator, and then change the encoding through the menu View/Character Set.

12.3. Spell check

Before we look at text editors for Linux, we need to briefly look at the ispell spell checker. The fact is that spell checking is one of the functions that a modern text editor should have, and many of them use ispell (or aspell) to perform this function. There is a Russified version of this program, which was developed by Vladimir Roganov and Konstantin Knizhnik.

Installing ispell consists of two stages: first you need to install the program itself, and then install the Russian language dictionary. To install the ispell program itself, I used the ispell-3.1.20-23.i386.rpm package, and to Russify it, I used the ispell-russian-3.1.20-23.i386.rpm package. Both packages were included in the Black Cat Linux 6.02 distribution. To install the first package, just give the command

# rpm -i ispell-3.1.20-23.i386.rpm

and for the second - the command

# rpm -i ispell-russian-3.1.20-23.i386.rpm.

After this, the Russian dictionary files russian.aff and russian.hash will appear in the /usr/lib/ispell directory (other dictionaries, for example, German) can be deleted if you do not intend to check spelling in these languages.

To check the text, you now just need to issue the following command:

$ ispell -drussian edit.htm

Naturally, the file name edit.htm is taken here as an example; you must substitute the name of the file that you want to check, and the file must be in the current directory, otherwise you must specify the full file name with the path.


Rice. 12.6. Spell checking with ispell

The principle of operation of the ispell program is very simple: every word found in the file must be in the program's dictionary. If a word is not found in the dictionary, it is considered that an error has been found, and a message is displayed on the screen, an example of which can be seen in Figure 12.5. The top line displays the detected erroneous word and the name of the file being checked. Below are several lines (the number can be specified) from this file containing the detected error. If words similar to the incorrect one are found in the dictionary, they are displayed below (with serial numbers). This is followed by a hint line and the command line of the program.

From the Command Prompt at the bottom, you can use the following keyboard commands.

Table 12.2. Replacement commands in the ispell program.

Team Action to be performed
‹R› Replace the erroneous word (the program will prompt you to type the right word on the bottom line of the screen)
Skip this occurrence of a word
‹A› Skip all occurrences of a given word in the current session of working with the program
‹I› Skip this word and include it in the personal dictionary (which is stored in the .ispell_russian file in the user's home directory
‹U› The same thing, only the word is written in lower case (small letters)
‹Q› Immediate exit from the program (confirmation is first requested, and the file being checked remains unchanged; any changes made are not carried out)
‹X› Abort the scan, record the changes made and exit the program
‹!› Temporary exit to shell

If you enter as a command the serial number of one of the replacement options proposed by the program, the program will replace the erroneous word with a word corresponding to the typed serial number of the replacement option. Only the numbers must be entered exactly as they are suggested by the program, i.e. with zeros preceding the significant digits (if any). And you must dial the number without first entering the command ‹R›, otherwise the erroneous word will be simply replaced with the corresponding number.

The ispell program, as already mentioned, is used as a spell checker in many text editors, for example, in Emacs it provides spell check directly during the text preparation process.

If you think about the checking principle inherent in the program, it is easy to understand that with its help you can check only a very limited class of errors, namely spelling errors, which consist of incorrect spelling of words. Obviously, no errors in grammatical structures, word agreement, etc. will be detected.

Another drawback of the program that I encountered occurs in cases where there is little free space on the current disk, less than what is needed to write the corrected file. In this case, the program writes only that part of the file that fits and loses everything else. No warnings are issued in this case.

If there is no lack of disk space, then after making corrections the program writes the corrected version of the file, and saves the original file by adding the .bak extension to its name.

12.4. About the three types of text editors

Editing text files (with texts in natural language or with program texts) is one of the most frequently performed jobs on any computer and in any operating system. Maybe that’s why so many text editors have already been developed for Linux (about 100 titles are listed on www.linuxlinks.com, and that’s probably not all). So there is plenty to choose from. And it’s worth spending some time choosing the optimal editor.

Of course, for such a choice to be justified, ideally you need to try all the editors or most of them. This is obviously impossible, so you have to rely either on chance or on the opinion of someone you know or the authors of computer books. (By the way, a good review of text editors, in my opinion, is contained in A. Fedorchuk’s book “Office, Graphics, Web in Linux” [P1.6]. I will also try to express my impressions of some text editors for Linux.)

Of the many different text editors, the average user usually chooses two or three with which he constantly works. He learns control key combinations to the point of automaticity, gets used to performing standard editing operations in a certain way, through menu items or mouse clicks, and, in general, adapts to the editor environment. Therefore, there must be fairly compelling reasons for changing the editor.

In my opinion, an average user who often uses a computer to edit files needs to master at least 3 editors.

One of them is powerful word processor, working in WYSIWYG mode, providing extensive text formatting options and a lot of additional features, missing in simpler editors. To this type I would include text editors (processors) from the StarOffice, Applixware, KOffice packages, individual word processors Maxwell and WordPerfect 8, AbiWord, as well as the TEX publishing system. I will call all editors of this type word processors. True, some authors, for example, the same A. Fedorchuk, still divide them into simply editors and processors, but I see no reason for this. Strictly speaking, the whole question is in the text formatting capabilities that the editor provides. And it is difficult, if not impossible, to propose any exact criterion for dividing editors of this class into two subclasses.

The second necessary editor is an editor for creating or editing ASCII files, working in graphical mode. Using this editor, a Webmaster can, for example, edit html pages, write a letter in it for subsequent sending by e-mail, etc. This should be a graphical mode editor, because in many cases it is easier to work in graphical mode and more convenient than text. Examples of such editors are KEdit and KWrite from KDE, nedit.

And yet you need to be able to use one of the console text editors, because you, as the only user (and even superuser) personal computer, must be able to edit configuration files, in any situation, even when the graphical mode does not load. The choice of editors of this type is very wide: vi, vim, bvi, Nvi, Elvis, Levee, vile, Wily, joe, aee, Fred, gred, le, lpe, Zed, Emacs, CoolEdit. Long-time UNIX adopters most often use vi or its enhanced version vim, but those switching to Linux from Windows environment It will be easier to master CoolEdit, which is very similar to the built-in editors of Norton Commander and FAR.

Based on these considerations, the following presentation is divided into three large parts, each of which is devoted to one of the identified types of editors. The first version of the section with a description of each editor discussed below was created in the very editor that is described in this section (these first versions were posted by me on the website http://linux-ve.chat.ru). I hope that after reading these sections you will be able to decide on the choice of text editors. Of course, everyone may have their own selection criteria. But I think that for us, Russian-speaking users, an important factor is the ability to enter and edit texts in Russian. It is also desirable that the menu items and program messages are also Russified (however, to some extent you can put up with English terms here, especially if there are good description programs in Russian, because the number of menu items is usually small and their meaning can be simply remembered).

12.5. Console ASCII file editors

Let's start by looking at text mode editors, i.e. those working in the console. Speaking about such editors, it is simply impossible not to mention the editors vi And Emacs, but the built-in Midnight Commander shell editor will be considered more thoroughly - Cooledit.

12.5.1 Editors like vi

The vi editor (or its slightly modified descendants) is included by default in any UNIX-like system, including all Linux distributions. All UNIX fans who have significant experience working with these operating systems know and use this editor. Editor description vi you can find, if not in any, then certainly in most books on UNIX. From the editor vi there are several descendants who improve and improve it in some way. These are editors like Vim, bvi, Nvi, Elvis, Levee, vile, Wily(editor Vim even called in Linux by command vi). A brief overview of editors of this class can be found in the article by A. Fomichev “Text editors for UNIX OS” ( Open systems, No. 4, 1994). However, for those users who migrated to Linux from a Windows environment, all these editors are unlikely to seem convenient. The reason is that these editors do not have the usual menus and prompts (as far as one can judge from Vim version 5.3) and you need to remember a lot of keyboard shortcuts to enter commands. At the same time, work in the editor is organized in the form of two separate modes - text entry and command entry, and a beginner often simply confuses the modes. In general, I would not recommend that you undertake mastering this type of editor without a printed manual. And although those who have mastered vi often resort to its help for editing simple files(especially configuration files and scripts), I believe that there are more convenient tools, and therefore I do not consider editors like vi(although I couldn’t help but mention them).

12.5.2 Emacs editor

The most famous among editors used in Linux is Emacs. It exists in both text mode and graphical shell versions. Some even say that Emacs- this is not an editor, but a way of life, and in another source it is called a religion. If you would like to get to know each other better Emacs, I can recommend to you the recently published Russian translation of R. Stallman's book about him; look for this book, for example, in the Bolero virtual store. You will find an excellent introductory description of this editor in A. Fedorchuk’s book “Office, Graphics, Web in Linux”. However, I believe that for novice users it is advisable to use CoolEdit- built-in editor for the Midnight Commander file manager.

12.5.3 CoolEdit - built-in editor of the Midnight Commander program

CoolEdit is an easy-to-use program with control key combinations familiar to most users (especially those who have worked with Norton Commander under DOS or FAR under WINDOWS). In addition, we must take into account that usually any work with a file begins with the file manager, since first you need, at a minimum, to find the file. Midnight Commander is just such a file manager, and the transition to editing is carried out by simply pressing the ‹F4› key after setting the highlight to the name of the found file. It's a small thing, but convenient. Taking into account the above considerations, I will begin a detailed story about text editors with CoolEdit.

The built-in Midnight Commander editor (Fig. 12.7) is called while working in this program by pressing the ‹F4› key, provided that the “use_internal_edit” option is set to 1 in the Midnight Commander initialization file. It can also be called independently of Midnight Commander simply from the command line, with the command mcedit. However, its true name is still CoolEdit, you can verify this if you press the ‹F9› key in edit mode and open the menu item File | About the authors.


Rice. 12.7. Cooledit editor window appearance

This editor provides most of the editing functions found in full-screen text editors. With it, you can edit files of almost any size, since the upper limit for the size of an edited file is 16 MB. Enables editing of executable (binary) files without data loss.

The following features are supported:

Copy, move, delete, cut and paste blocks of text;

Cancel previous operations (using the key combination ‹Ctrl›+‹U›);

Drop-down menus;

Inserting files;

Macro definitions;

Search and replace using regular expressions (in other words, patterns formed using special characters), as well as its own version of search and replace operations based on the scanf-printf functions;

Selecting text using the key combination ‹Shift›+‹arrows› in MS Windows - MAC style (only for Linux console);

Switching between symbol insertion and replacement modes.

The editor is very simple and requires virtually no training (especially since you can find versions in which the main part of the menu items is Russified; such a version was included, for example, in the Black Cat 5.2 distribution). In order to find out which keys cause certain actions to be performed, just look at the drop-down menus called up by pressing the ‹F9› key in the editor window (Fig. 12.8).


Rice. 12.8. Exit to the Cooledit menu using the ‹F9› key

If you are working in a Linux console, you can use the following keyboard shortcuts to work with blocks of text: ‹

Shift›+‹arrow keys› - selecting a block of text;

‹Ctrl›+‹Ins› - copies the block to the file cooledit.clip;

‹Shift›+‹Ins› - inserts the last block copied into cooledit.clip at the cursor position;

‹Shift›+‹Del› - deletes the selected block of text, storing it in the cooledit.clip file.

If you have the program installed gpm- mouse driver for the console, then you can click on the left mouse button at the beginning of the selected block, move the cursor to the end of the block and release the button (thereby selecting the text), and then move the cursor to where you want to insert the fragment and click on the right button mouse to paste the selected text.

The editor supports macros. To define a macro, press ‹Ctrl›+‹R›, then enter the strings of commands that should be executed. After finishing entering commands, press ‹Ctrl›+‹R› again and associate the macro with a key or key combination by pressing that key (combination). The macro will be called by pressing ‹Ctrl›+‹A› and the key assigned to it. A macro can also be called by pressing any of the ‹Alt›, ‹Ctrl› or ‹Esc› keys and the key assigned to the macro, provided that this combination is not used to call any other function.

Macro commands, once defined, are written to the file cedit/cooledit.macros in your home directory. You can remove a macro by deleting the corresponding line in this file.

When performing replacement operations (by function key‹F4›) you can use scanf's search and replace functions to search and replace according to C language format patterns. First, look at the sscanf and sprintf man pages to learn what format patterns are and how they work.

Here's an example: Let's say you want to replace all occurrences of blocks of text consisting of an open parenthesis, three comma-separated numbers, and a closing parenthesis with a block consisting of the word apples, the third number from the original block, the word oranges, and then the second number from the original block. Then in the dialog box that appears when you call the replacement command (‹F4›), you need to set the following templates:

Enter replace string apples %d oranges %d
Enter replacement argument order

The last of these lines says that the third and second numbers should be substituted in place of the first and second arguments. It is still recommended to use the “Prompt on replace” option when performing a replacement, because the program considers as matches all cases where the number of arguments matches the specified number, although this does not always mean a complete match. Scanf also doesn't pay attention to the number of whitespace characters.

The built-in editor processes characters from the second half of the code table (160+). But when editing binary files, it is better to set the option Character bits(Display bits) from the menu Settings to the "7 bit" position to preserve the file format.

It would take too much space to describe all the functions of the built-in editor here. Yes, there is no need for this, since to use it it is enough to remember that all basic operations can be performed through menu items, which are called up by pressing the “F9” key in the editing window. You can also read the man page using the command man mcedit or info mcedit.

To conclude this brief reference on the built-in editor of the Midnight Commander program, I would like to talk about how text fragments are transferred from one file to another.

If you work in the console, then this task is solved through the menu or using the following operations:

Mark the beginning of the block using the ‹F3› key;

Move the cursor to the end of the block;

Mark the end of the block using the ‹F3› key;

Type the combination ‹Ctrl›+‹Insert›;

Close this file, open another one;

Place the cursor where we want to insert this fragment and press the key combination ‹Shift›+‹Insert›.

That's it, task completed. A fragment of text can be transferred using this method from one virtual console to another.

But all this only works in the console. And when working with the same editor in a graphical shell window, the same task was a problem for me for quite a long time.

I didn’t immediately find a way to solve it (i.e., transfer a piece of text), which works both in the console and in the graphical shell window. This method consists of transferring a piece of text through another file (the default is ~/.cedit/cooledit.clip). Select a piece of text, select a menu item File | Copy to file(File | Copy to file) and press ‹Enter›. Then go to another file, place the cursor where you want to insert the fragment, and select the menu item File | Insert file(File | Insert file).

12.6. ASCII file editors for graphics mode

Obviously, it would be very convenient if editing ASCII files in graphical mode was carried out using the same editors that are used in console mode. Then you wouldn’t have to learn other key combinations or change your familiar environment. The CoolEdit editor, which was described in the previous subsection, can be launched through a terminal emulator and thus used in graphical mode. However, it turns out that some key combinations in the emulator do not work or work differently than in the console. In addition, working with the mouse in editors that are initially oriented towards graphical mode is organized much better than in console editors, which increases the overall ease of use (although this may be purely my subjective feeling). Therefore, I still recommend not limiting yourself to using only a console editor for ASCII files, but mastering one of the many editors aimed at processing such files in graphical mode. Let's look at three similar editors.

12.6.1 KEdit editor

The editors KEdit and KWrite are part of the KDE graphical environment. They are designed to run in graphical mode, but work with ASCII files. The editors are very similar, so I'll talk about KEdit first, and then just point out the differences in the second editor.

The KEdit editor is very easy to use and, if you have ever edited text, you will not have any problems with it. In addition, if you have already Russified KDE, then you will not have any problems with entering and displaying Cyrillic characters. Moreover, the program menus and messages are also Russified.

You can open a file for editing through the menu or using the combination ‹Ctrl›+‹O›. A window appears in which you can select a file to edit. Everything is familiar here, and I think you don’t need any additional explanations. In addition to this method, when working in the KDE environment, you can use the "Drag and Drop" method. This means that from the Konqueror file manager you can grab a file with your mouse and simply “throw” it into the KEdit window.

Basic editing operations are performed using the keyboard. The ‹Insert › key switches between the modes of inserting and replacing characters. Moving through the text is carried out using the arrow keys and the ‹Page Down›, ‹Page Up›, ‹Home› (go to the beginning of the line), ‹End› (go to the end of the line) keys. You can select a block of text (unfortunately, only linear) using the mouse or using the arrow keys while holding down the ‹Shift› key. The ‹Delete› key deletes the character to the right of the cursor or the selected block of text.


Rice. 12.9. KEdit editor window.

In many editors, including KEdit, text moving and deleting operations can also be performed using hotkey combinations (perhaps due to the fact that older terminals did not have arrow keys?):

‹Ctrl›+‹A› - move the cursor to the beginning of the line.

‹Ctrl›+‹B› - move the cursor one character to the right.

‹Ctrl›+‹E› - move the cursor to the end of the line.

‹Ctrl›+‹N› - move the cursor one line down.

‹Ctrl›+‹P› - move the cursor one line up.

‹Ctrl›+‹D› - delete the character to the right of the cursor.

‹Ctrl›+‹H› - delete the character to the left of the cursor.

Basic commands for moving blocks of text from one place to another are carried out using the same combinations that are used in the editor from Midnight Commander and many other editors, so that your fingers find these combinations automatically:

‹Ctrl ›+‹C› - copy the selected text to the clipboard;

‹Ctrl›+‹X› - cut the selected text fragment and place it on the clipboard;

‹Ctrl›+‹V› - paste a piece of text from the clipboard to the cursor position;

‹Ctrl›+‹K› - delete text from the cursor to the end of the line and place it in a special buffer (kill-buffer);

‹Ctrl›+‹Y› - paste a piece of text from a special buffer at the cursor position. Using the combination ‹Ctrl ›+‹ J› you can format the current paragraph of text. Formatting, however, consists only in the fact that very long lines of text are divided into those whose length does not exceed the value specified in the corresponding option in the Settings menu item.

The combination ‹Ctrl›+‹F› calls the substring search function.

To save the editing results in a file, you can use the menu item File | Save or the combination ‹Ctrl›+‹S›. If you want to save the edited text in a file with a different name, then you need to act only through the menu ( Save as).

KEdit supports printing. You can print the entire edited file or a selected piece of text. Printing is done to the default printer. Additionally, you can connect any of the printing utilities, which are widely developed for UNIX.

What particularly impressed me when I first discovered KEdit was its built-in spell checking capability and the ability to view and edit files in both CP-1251 and koi8-r encoding.

To change the encoding you need to play with the selection of fonts in the menu item Settings | Font. Unfortunately, not all fonts support both encodings, but after several attempts you can select the right font. To check spelling, just select the menu item Editing | Spell check. Naturally, the ispell program must be installed on the system, and, in addition, before starting the scan, you should enter the menu item Settings | Spell check and select the Russian dictionary and the desired character encoding (see Fig. 12.10).

By the way, menu item Settings In general, it is advisable to take a closer look before editing any files, select the settings you need, and then save them (subsection Record settings).


Rice. 12.10. Setting up spell checking in KEdit

Another nice, in my opinion, built-in function of the KEdit editor is the ability to call mail program straight from the editor. I was unable to test this function because home computer(isolated) I have nowhere to send letters. But I often use this function at work, in MS Word, and I find it very useful and convenient.

In general, this editor made the most favorable impression on me from the first time I met him, so I recommend that you get to know him better. You might even choose it to edit ASCII files when working in graphical mode.

12.6.2 KWrite Editor

The KWrite editor, as already mentioned, is very similar to KEdit. The first difference that catches your eye after loading a file into the editor is the coloring of function words. Coloring is specified by subparagraphs Set coloring And Coloring… point Settings. Since I often edit HTML files, I found this feature convenient.

One new item has appeared in the main menu - Bookmarks with subparagraphs Set bookmark(‹Alt›+‹S›), Add a bookmark And Clear bookmarks(‹Alt›+‹C›). The rest of the main menu items are the same as those in KEdit.

There is a rollback function ‹Ctrl›+‹Z› and the ability to select a vertical column (this function is activated by pressing the ‹F5› key). Using the key combination ‹Ctrl›+‹I›, an indent is inserted into the current line (a space is added to the beginning of the line). Using the key combination ‹Ctrl ›+‹U›, the indentation is removed (and if there was no indentation, the first character of the line is silently deleted).

Perhaps this is all that is new in KWrite compared to KEdit. But, unfortunately, some useful features gone. In point File The item regarding sending a file via e-mail. In point Edit There is no option to insert a date. The ability to select a font in the Setting | Setting up KWrite, which I consider the biggest drawback of this program.

Otherwise, these editors are almost the same, so you can work with any of them. I think that over time, all the features of KEdit will be included in KWrite, and it will become the "standard" text editor of the KDE shell.

12.6.3 Text editor Nedit version 5.1.1

The Nedit text editor was created by a group of authors led by Mark Edel, is distributed under the GPL license, and can be obtained from the Web site http://nedit.org. Outwardly, it is very similar to the two editors described in the previous section, but it has much more capabilities than KEdit or KWrite.


Rice. 12.11. Appearance of the Nedit editor window

After my first acquaintance with this editor, I decided to stop using KWrite and switch to Nedit. A. Fedorchuk [P1.6] also believes that Nedit is approaching the ideal of a text editor, and even calls it " the best editor of all times and peoples."

Perhaps the only (in my opinion, not very significant) disadvantage of Nedit compared to KEdit or KWrite can only be considered that menus, messages and tips are displayed on English language. True, there is no such item in the menu as sending an email message, but it is possible to execute any shell command or create a macro, which more than makes up for the lack of a direct call to the email program.


Rice. 12.12. Window for setting fonts in Nedit

Switching the editor to enter Russian text was not difficult for me. To do this you need to enter the menu item Preferences/Text Fonts… and set the required fonts in the input lines of the corresponding window (see Fig. 12.12). And, since it is quite difficult to remember these long lines with font names, you can use the Browse... button and select a font from the displayed list (see Fig. 12.13). You need to choose a font that has the KOI8-R encoding. Please note that to select a font, you must check one option in each of the three proposed columns, otherwise you will most likely receive a message stating that the font is not available.


Rice. 12.13. Choosing fonts in Nedit

Considering that due to the rather long period of use of such editors as editors file managers FAR for MS Windows and Midnight Commander, I have developed strong habits of using certain key combinations, I was very pleased to discover that the familiar combinations ‹Ctrl ›+‹X›, ‹Ctrl› are used to cut, copy and paste blocks of text in Nedit +‹C› and ‹Ctrl›+‹V›. Selection of a block of text is carried out either with the mouse or with the arrow keys while holding down the ‹Shift› key. If you hold ‹Shift›+‹Alt›, a rectangular column will be selected. Operations with selected blocks can be done not only using the keyboard, but also through menu items Edit. This is convenient if you do not remember the key combination to perform the intended operation. But old habits do not always help, in particular, to cancel the last operation in Nedit, you use not ‹Ctrl›+‹U›, but ‹Ctrl›+‹Z›.

In the same menu Edit there are two subparagraphs ( Lower-case And Upper-case), with which you can translate the text in the selected block, respectively, into lower and upper case.

Paragraph File The main menu contains sub-items with which you perform the usual operations of opening and saving edited files. Please note that using the subparagraph Open Previous you can easily return to editing the files you worked with in previous sessions. Sub-clause Include file...(‹Alt›+‹I›) allows you to paste the contents of the selected file at the cursor position, sub-item Print... serves to output the edited file to the printer.

Paragraph Search The main menu contains calls to search and replace operations, as well as quickly jumping to the desired line or to a previously made bookmark (and setting such a bookmark).

To customize the program according to your tastes and habits, use the menu item Preferences. I have already told you how to select a font for displaying text in the program window. Here you can use the command Language Mode select a language (for example, html or C), according to the rules of which text elements (function words or tags) will be highlighted, set the tab size ( Tabs…), and also enable or disable the numbering of text lines, display of statistics lines, syntax highlighting, saving mode backup copy file, symbol insertion/replacement mode.

Paragraph Shell used to run shell commands and external programs. Here you will find, in particular, a call to the spell checker ispell, but there is no way to connect a Russian dictionary through the program menu. But this difficulty is easily overcome by using a .nedit resource file in the user's home directory. Enough in the line defining the program call ispell, add the -d russian parameter and checking Russian-language texts will work (in a separate terminal window).

Through the same ~/.nedit file you can configure the background and text colors, the geometry of the program window and some other parameters. The same can be done in a special section of the .Xdefaults file in your home directory. True, there is no such section in this file by default, but it can be created, as recommended in the book by A. Fedorchuk.

But let's get back to the menu items. Paragraph Windows serves to switch between windows (of which several can be opened at the same time). Purpose of the item Help, I think, is clear without further explanation. Unfortunately, the hint is given in English and there is no search for the hint by keywords and phrases.

In this brief description I did not touch on the menu item Macro, as well as those sub-items of the main menu that are focused on actions performed when editing program source codes (for example, inserting ASCII codes, highlighting paired brackets, or compiling program code). But even based on what was said in this subsection, we can conclude that Nedit is a fairly powerful and convenient editor for working with ASCII files in graphical mode. If you want to know more about him, read A. Fedorchuk’s articles on the Internet or his book [P1.6].

12.7. Word processors

Let's agree that the term "word processors" will mean all programs for editing text files that work in graphical mode and use special characters or inserts to indicate formatting elements when saving the results of work in files. The word processor does not display these inserts as any characters during the editing process. In this sense, Nedit is not a word processor, but Netscape Composer is, because it displays formatting elements graphically, rather than as HTML tags.

12.7.1 Word processor capabilities

TO standard means Text formatting includes:

Ability to select different fonts for different parts of text in one document;

Setting the width of the fields, the amount of indentation, intervals;

Organizing text in columns;

Inserting figures and tables into the text;

Possibility of creating inscriptions at an angle to the line or in a curved shape;

Spell check (for user language)

In order for a word processor to be considered powerful and convenient, it must have the ability to process files created in other common word processors (Of course, this primarily refers to MS Word!). At a minimum, you need to be able to view documents in the formats of other editors. You can, of course, have transcoders, but from the point of view of ease of use, this is already a minus.

With this informal definition in mind, let's look at a few Linux software products that claim the lofty title of word processor.

Since, by their main purpose, text editors are closely related to language, and we are considering the case of the Russian language, when choosing a word processor, special attention must be paid to whether it has Russification capabilities. In order not to repeat the same thing when describing each of the products discussed below, I will immediately note that not only standard fonts Type1, supplied with the Black Cat 6.02 distribution, but also True Type fonts from Windows (see Chapter 11).

12.7.2 Word processors for Linux

There are many word processors for Linux. The most famous of them are StarWriter from the StarOffice package from Sun and the Word Perfect 8 processor. An analogue of the latter, developed for the Windows OS, competed on an equal footing with the MS Word package for a long time, which, of course, indicates its high quality. However, there are some problems with the Russification of the Linux version of this processor, so we are not considering it here.

A special place among word processors is occupied by the TEX publishing system and products like Lyx based on it. As for TEX, it is more of a programming language than a text editor. If you program in two or three different languages, you may have no problem mastering TEX. But a simple user who needs an editor to write business letters or a dissertation on the history of steam boilers, in my opinion, is hardly worth studying it.

12.7.3 Ted Text Editor

The Ted editor is conceived by the author (Mark de Does) as a simple text editor that runs under X Window on Unix/Linux systems, and plays approximately the same role as WordPad under MS-Windows, only with more features. The main advantage of Ted compared to the editors discussed in previous sections is the ability not only to enter and edit text, but also to provide basic text formatting options, change fonts, and insert tables and figures into the text. It is precisely because of the presence of these capabilities that I classified this editor as a word processor, although it does not have all the capabilities of developed word processors.

The package distribution can be downloaded from the website ftp://ftp.nluug.nl/pub/editors/ted or from the metalab server: //metalab.unc.edu/pub/packages/editors/ted.

The distribution comes either as a compressed tarball or as an RPM package. A Russified version of the editor can be found on the server ftp://ftp.logic.ru/ (of course, Russification is a little behind the versions).

I also installed the Russian version 2.6 of the Ted editor, but after a period of testing I returned to the English version 2.7, which is dated December 31, 1999, and in which some shortcomings were eliminated previous version.

After launching it, a window appears in which an engraving in the style of Albrecht Durer is shown, the version of the program is indicated, a link to the developers’ website and there are only three menu items: File, Window And Help. Obviously, in order to open an existing file for editing, you need to select the Open sub-item of the File menu and select the desired file in the window that appears. To create a new file, select the sub-item accordingly New menu File or type ‹Ctrl›+‹N›. After opening the file, the program window takes on the form shown in Fig. 12.14.

Ted supports the .rtf (Rich Text Format) file format, which allows for some degree of compatibility with Microsoft products. Namely, any file created in Ted and saved in rtf format will be correctly read by MS Word programs under Windows. Backward compatibility (that is, the ability to open any rtf file in Ted) is not achieved because some formatting options used in rtf files are not understood by Ted. However, the text of the opened file will be displayed in full, and can be saved in another (or the same) file, but without the formatting information that is ignored when opening the file.


Rice. 12.14. Ted editor main window

I'll bring you short list Ted's main features.

Editing files in WYSIWIG mode. In this case, you can use all fonts for which you have .afm files and which are available for X11. Ted comes with .afm files for Adobe fonts, which are available for Motif-based systems and can be used with all postscript printers: Times, Helvetica, Courier and Symbol. Other fonts can be added using the usual procedures used for this in X11. Font properties such as bold, italic, underlining, superscripts and subscripts are supported.

Inserting pictures in bitmap format.

Printing on PostScript printers.

Working with files in the format Acrobat PDF.

Spell checker for 12 languages ​​based on the Latin alphabet.

Send documents by e-mail without leaving Ted.

Cut/Copy/Paste operations, including sharing with other applications.

Search/Replace.

Formatting paragraphs: indent the first line, offset the entire paragraph, use rulers.

Splitting text into pages.

Inserting tables and operations with tables: operations with columns and rows of tables, resizing using rulers.

Inserting characters from different code tables is supported.

Saving a document in text and HTML format.

Ted can be used to read email messages sent from Windows machines. You can also configure Ted as an RTF file viewer for Netscape.


Rice. 12.15. Spell checking in Ted editor

I learned that Ted can be completely Russified from an article by Victor Wagner [P14.19]. The most interesting feature of the Russified version is the presence of a spell check for Russian-language text. This function is called using the menu item Tools | Spelling. At the same time it appears additional window(see Fig. 12.15), in which you need to click on the “Find next” button to search for the next error.

However, judging by the first impression, in the version that I saw (version 2.6), the implementation of this function has many shortcomings. Firstly, all words typed in Latin script are designated as errors (although even ispell ignores them without any problems). Secondly, words starting with a capital letter are perceived as errors (the program suggests typing such a word in all capital letters). And, what is most incomprehensible, a lot of correctly typed words are perceived as erroneous, and the very same word is offered as the first correction option.

However, there are many other errors. That is why I returned to version 2.7 and, following the recommendations of V. Wagner, tried to Russify it.

The first step is to teach Ted how to enter and display Russian letters. In order for Ted to correctly display fonts in koi8-r encoding on the screen, you need to create a file xfonts.dir in the /usr/local/afm directory, where Ted keeps font metrics (*.afm), placing the following text in it

Courier-Bold-*-courier-bold-r-normal--*-*-*-*-*-*-*-*
Courier-BoldOblique-*-courier-bold-o-normal--*-*-*-*-*-*-*-*
Courier-Oblique-*-courier-medium-o-normal--*-*-*-*-*-*-*-*
Courier-*-courier-medium-r-normal--*-*-*-*-*-*-*-*
Helvetica-Bold-*-helvetica-bold-r-normal--*-*-*-*-*-*-*-*
Helvetica-BoldOblique-*-helvetica-bold-o-normal--*-*-*-*-*-*-*-*
Helvetica-Oblique-*-helvetica-medium-o-normal--*-*-*-*-*-*-*-*
Helvetica-*-helvetica-medium-r-normal--*-*-*-*-*-*-*-*
Times-Bold-*-times-bold-r-normal--*-*-*-*-*-*-*-*
Times-BoldItalic-*-times-bold-i-normal--*-*-*-*-*-*-*-*
Times-Italic-*-times-medium-i-normal--*-*-*-*-*-*-*-*
Times-Roman-*-times-medium-r-normal--*-*-*-*-*-*-*-*

After this, Russian letters are entered and displayed normally. However, the problem is not yet completely solved: after working with Format tool or any dialog containing an input line, Ted again stops entering Russian letters. The solution to this problem, proposed by Ivan Pascal, is to create an empty file /usr/X11R6/lib/X11/locale/koi8-r/Compose and add it to the file /usr/X11R6/lib/X11/locale/compose.dir line:

This solution worked quite well for me (except that the Delete key stopped deleting characters and started inserting spaces, so I had to use the BackSpace key to correct errors).

Now let's look at adding new fonts. Only 4 fonts are supplied with the standard Ted distribution: Courier, Helvetica, Symbol and Times. If you want to add more variety to your documents, you'll need to add other fonts. In Ted, you can use any font that is visible in your graphical shell, but there are a few things you need to do to make it work. To find out what fonts you have, run xfontsel and select the font you want to add. Let's say this is Bookman Light.

For Ted to see new font, you need to place the metric of this font (the metric is a file in .afm format) in the /usr/local/afm directory. You can either find a ready-made metric or create it yourself. Ted is quite picky about font metrics. As V. Wagner writes, Ted for a long time refused to download fonts from kapella, since the afm file does not contain references to several characters appearing in Adobe Standard Encoding. At the same time, working with font metrics is a mandatory feature of a more or less advanced formatting program, since the information about the font that the X server provides is not enough for high-quality printing. If you try to work with Ted using metrics that don't match your fonts, the result will be ugly - words will run into each other.

Ready-made font metrics can be found in the Adobe base35 collection, which is located on the FTP server ftp://ftp.adobe.com, and instructions for installing them can be found in the Ted editor help file.

In conclusion, I note that Ted allows you to Russify the interface. It is enough to translate the resource file into Russian, which is located in the /usr/X11R6/lib/X11/app-defaults/ru directory and is called Ted. If there is no such directory, you need to create it and put all Russified resources there. After this, when running in the Russian locale, Ted will display all menus and most dialog messages in Russian.

12.7.4 AbiWord word processor

AbiWord is a small, fast, free and easy to learn and use word processor for X. The package can be downloaded from the Internet at www.abisource.com. After starting the program, you will see the main program window (Fig. 12.16), which strongly resembles the familiar MS Word window.

The AbiWord processor has all the features and functions that are inherent in word processors, including spell checking, which works directly as you enter text.

AbiWord allows you to open files for editing and viewing Microsoft format Word (both MS Word 95 and MS Word 97). However, since to convert formats it uses calls to the procedures of the wv package, which we discussed above, all the disadvantages of the latter are reflected.

In native AbiWord format (.abw);

In text format (.txt);

In RTF format (.rtf);

In HTML format;

In UTF8 format;

In LaTex format.

Thus, in principle, through the RTF format it is possible to organize the exchange of files with MS Word users.


Rice. 12.16. AbiWord editor main window

Unfortunately, this editor is still under development (I looked at versions 0.7.8 and 0.7.14). When accessing some menu items, instead of the specified (or expected) result, a message appears stating that this item does not yet work. In version 0.7.8, this included features such as numbered list creation, styles, pagination, and character insertion. Instead of executing the corresponding function, the message “not implemented yet” appeared. And an invitation-request: if you are a programmer, join the development, and if you are not a programmer, then be patient. In version 0.7.14, some of these shortcomings have already been fixed, but some errors are still not fixed. In particular, if you simply highlight a directory in the file opening dialog box and try to go to it by pressing the Enter key, a new instance of the program is called. True, the current directory for this new instance turns out to be the directory where we wanted to go, but opening new windows in vain is annoying (and resources are wasted). If you go to the directory by double-clicking the mouse, a new window does not open. There are other errors, and some of them simply close the editor, without warnings or saving the results of previous work. So it’s too early to consider this product ready for use.

However, overall it makes a very good impression and version 0.7.14 seems much more workable than 0.7.8. This indicates that work on the program continues. Therefore, let's be patient in the hope that the appearance of a full-fledged product that implements all the capabilities stated in the menu is not far off.

By the way, at http://www.hippo.ru/~hvv/abiword/ you can find a Russified version of AbiWord.

12.7.5 KWord word processor

The KWord word processor is included office suite KOffice. However, unlike StarOffice, it does not require the launch of a common shell or a common office desktop to run it. After starting the program (the easiest way to do this is from the main menu of the KDE shell, selecting Office | Word processor), an unassuming gray window appears (see Fig. 12.17), against the background of which a window for selecting the type of document to open immediately appears (Fig. 12.18).


Fig. 12.17. KWord start window


Rice. 12.18. Window for selecting the type of document to open

This window prompts you to either create a new document based on one of the templates, or open an existing document. Here you can also view the list of documents that you worked with in previous sessions and quickly call up one of them.

As soon as you have called a document for editing, or opened a new one, the appearance of the window changes dramatically (Fig. 12.19). New menu items, toolbars, and page formatting lines also appear.


Rice. 12.19. KWord main window

Working with a new text editor usually begins with creating a new document, so let's create a new document and try to enter text. First you need to choose a font, naturally Russified. In KWord this is done through the menu item Format | Font. After selecting this menu item, a font selection window will appear (Fig. 12.20), in which we make this choice.

In the Russified version of Linux, among these fonts there are also fonts in the KOI8-R and cp1251 encodings. Select one of them and start entering text. By the way, the main characteristics of the font can be selected without looking at the menu, since the toolbar (Fig. 12.20) has drop-down lists for the font name, character size, icons for setting bold, underlined, strikethrough font, as well as for changing the color of characters and turning part of the text into superscripts and subscripts. However, icons on the toolbar can be added or, conversely, removed. But we’ll talk about toolbar settings later, but for now let’s get back to typing.

Rice. 12.20. Choosing a font in KWord

As soon as the first paragraph is entered, there is a desire to give it a nice appearance. What we will do using the menu item Format | Paragraph. A window with five tabs will appear, shown in Fig. 12.21. On the first tab, you can set indents for paragraph lines (separately for the first line and the rest), line spacing and spacing between two consecutive paragraphs. The size of all intervals and indents is specified in millimeters. The second tab sets the position of the lines of a given paragraph on the page: shifting them to the left, right, center, or evenly stretching them across the width of the page.

Tab Frame allows you to enclose a given paragraph in a frame (for example, to somehow highlight this paragraph from the general text). The last two tabs are used to set the format of lists and set tab stops, but we’ll talk about this later (if the opportunity arises).

Next item on the menu Format allows you to set the format of an entire page. After selecting the item Format/Page A window with three tabs appears. The first of them is used to set the page orientation (book or album), page size (for example, A4), and margin width. On the second tab, you can set the placement of text in several columns (columns). And the third tab defines the properties of the top and footer. But we are not yet up to such subtleties, let's finish typing the first page of text and see how the finished page will look on the screen.

Rice. 12.21. Paragraph formatting window

Just first, let’s note that just like selecting a font, you don’t have to use the corresponding menu item to format a paragraph. First, you can use the Format toolbar, where you can select one of standard styles paragraph (though at first the style selection list is not rich, but you can create own style via menu item Format | Style manager), the position of the lines on the page and move the paragraph to the right. In addition to the toolbar, you can use the rulers on the left and top of the text entry window to format a paragraph. These rulers allow you to set page margins and paragraph indents.

So, if you've finished typing a test, or at least typed a full page, you can see how that page will look printed. To do this, use the menu item File | Preview or the corresponding icon on the "File" toolbar. Unlike MS Word, a separate program is called to preview the page - “PS/PDF Viewer” (a few words were said about it above). If you don't like something about the page image, you can go back to formatting the page and paragraphs so that you can go back to the preview after making changes. Just to see the changes, the viewer will have to be opened again, so it is better to close the current instance.

In order not to accidentally lose the results of your work, let's save the file on disk. To save the file, you can use the menu item File | Save or File | Save as. In the latter case, you can specify a new file name and select the directory in which it will appear. new file.

Since we looked at the menu File, let's see what other points it contains. In general, nothing unexpected is found here. There are points New, Open, Open Recent, Save, Save As, Create Template from Document, Statistics(at this point you can get information about the number of characters, words and sentences in the typed text), Print, Print Preview, Document Information(here you can enter some information about yourself as the author of the document), Close(current document) and Exit.

Menu Edit also does not contain anything unexpected: it contains points Cancel(previous action), Repeat(i.e., redo the canceled action), Cut, Copy, Paste, Select All(i.e. select all), Search And Replacement.

But the following menu will be unusual for MS Word users. It's called View. MS Word also has a menu item with the same name, but it contains completely different sub-items. And in KWord the following items are found here:

The new kind- selecting this item opens a new KWord editor window, which displays the same document that you edited in the first window. Unlike launching a new copy of the program (a new window with the same file), when you open a new view, all changes you make to the text will be displayed in both windows.

Close all views- leads to exit from the program.

Split View- the editing window is divided into two or larger number panels, each of which displays the file being edited. Same as New View, but without opening a new window. In each view, you can navigate through the text independently.

Delete view- closes the current view, i.e. the panel or window in which this moment the cursor is located.

Separator location- allows you to position view panels vertically or horizontally.

Next are two switch points: Page mode And Preview mode. In mode Page mode the editing panel displays one page of text, as you saw in Fig. 12.19. In mode Preview mode All pages of the document are displayed on the screen at once. Scroll bars allow you to navigate through pages. This allows you to see how figures, tables, etc. will be arranged.

Next comes the not yet activated (I worked with version 1.1 post-beta of the KWord program) item Non-printing characters, followed by three more switches: Inset frame, Page header And Footer(in the sense of "footer"). These three switches enable (or disable, respectively) the display of the corresponding page design elements (however, Inset frame is not a page design element, it is visible only on the screen).

Purpose of the last item in the menu View obvious from its name - Scale. However, instead of this item it is more convenient to use the drop-down list on the toolbar. Moreover, it is impossible to set an arbitrary scale value in either way; you can only select one of the preset values.


Rice. 12.22. Header and Footer Options

Since we're talking about headers and footers, it's worth mentioning that on the tab Headers and footers, which becomes available when you select a menu item Format | Page, you can set three parameters for the header and footer (see Fig. 12.22).

One of the headers and footers usually displays the current page number. In KWord this can be done from the following menu - Insert. You need to select an item Variable and select the item from the list that appears Page Number.

In general, through the menu Insert you can insert a picture, table, formula, special character, page break, content, variable, Expression, text frame, picture frame, Object Frame. It’s true that working with pictures is quite difficult. Clicking on the picture does not lead to the appearance of a menu or any symbols used to change the size. You must manage to click on the picture frame in the upper left corner, where there is a small area, clicking on which leads to the appearance of small squares in the corners of the image and the centers of the sides, by clinging to which you can change the size of the picture.

It is somewhat more successful to insert a frame with a picture. Calling up the frame management menu is also not easy - you have to go to the same small area on the border of the frame with the right mouse button to call this menu, but you can still do something. After calling the menu, the window shown in Fig. 1 appears. 12.23.


Rice. 12.23. Frame settings window (insets)

In this window, you can set the relationship between the main text and the sidebar (see Fig. 12.23) and the size of the sidebar, which for frames with pictures also determines the size of the image. However, attempts to resize pictures very often lead to the program crashing.

Inserting tables works, but the tables are not very beautiful yet. Inserting formulas is generally something inapplicable for now. The "Expression" sub-item allows you to insert several fixed phrases into the text (hello, goodbye, e-mail address, etc.). The inserted variables can be page number, number of pages in the document, file name, current directory name, current date and time (and, as I understand it, either the time this parameter was inserted, or the time the document was last edited), the data that you entered in the paragraph File | Document details, as well as any values ​​you define. Some complaints can also be made regarding the insertion of variables. In particular, after the first save of the file, the time and date insertion is preserved, and after the second save, it disappears.

On the menu Tools we see three points: Spell checking, User variables And AutoCorrect. Spell checking is a graphical shell for the built-in call to the ispell program. When an unfamiliar word is detected, it is highlighted and the window shown in Fig. is displayed. 12.24. You can replace the word with one of the suggested options or skip it (“ignore” the error). You can also directly correct the word in the line of the proposed replacement, and then click the button Replace.


Rice. 12.24. Possible reactions to misspelled words

Paragraph User Variables serves to define your own variables, and the paragraph AutoCorrect- to set rules for automatically correcting the most typical and common errors, such as two capital letters at the beginning of a word. You can change the replacement rules or set your own.

Via menu item Settings You can enable or disable individual toolbars, customize the appearance of these panels and hotkey bindings, and also make some settings for the program itself.

Well, and finally, the last main menu item, which has a traditional KDE structure: program help, information about Kword, and information about KDE. There is no help for the program yet (in version 1.1), and information about the authors is visible in Fig. 12.25. On the “Translation” tab it is reported that the translation was made by Andrey Cherepanov.


Rice. 12.25. Information about the program developers

This concludes the description of the KWord word processor. Unfortunately, it cannot yet be considered a fully functional test processor. The main complaints are the work with figures and tables. But the processor works quite normally with the Russian language and even allows you to select the character encoding. I don’t know how to do this in MS Word (if it’s even possible). So KWord is quite suitable for creating not very complex documents.

12.7.6 StarWriter and OpenOffice.org Writer word processors

The StarWriter word processor is part of Sun's StarOffice office suite. Homepage: http://www.sun.com/products/staroffice. Download from home page available for free, CD-ROM costs $39.95 (in the US).

The StarOffice package was originally developed by the German company StarDivision, which was founded in the mid-1980s. In the summer of 1999, StarDivision was purchased along with its development by Sun. The beta version of StarOffice 5.1a, released on behalf of Sun, had few fundamental differences from the versions released by the original developer. Of course, the Sun logo appeared and the installation procedure was significantly (in my opinion) simplified, which became very reminiscent of the installation procedures for Windows products: answer a few questions, and then sit and read successive advertising messages. Perhaps this was a consequence of the fact that the StarOffice package was also released in a version for Windows.

In June 2000, Sun released version 5.2 of the package, with StarWriter positioned as an alternative to Microsoft Word that would satisfy the most demanding requirements. Indeed, StarWriter has a fairly large set of file filters and is quite similar to Microsoft Word in terms of a set of basic operations, so the transition from MS Word to StarWriter should be quite simple for the user. Moreover, StarWriter provides most of the features that MS Word has. With it you can create (in WYSIWYG mode) documents High Quality. You can easily get text divided into several columns, insert figures and tables, sidebars into the text, set paragraph format, margin width, etc. Judging by the descriptions, there are features inherent in professional publishing systems, such as controlling the distance between adjacent letters (kerning), setting styles for individual text fragments (headings, quotes, etc.). Using StarWriter you can create envelopes, stickers, letters.

If we talk about in what cases it is worth using StarWriter as a word processor, then first of all we need to mention the fact that it is inseparable from the rest of the StarOffice package. StarOffice itself is an integrated graphical environment from which all other applications can be launched, so it is quite resource-intensive. Therefore, it is hardly advisable to use StarWriter in such cases when you need to create a small memo or a short email (unless, of course, you use the entire StarOffice package as your work environment).

Unfortunately, even version 5.2 of StarWriter is not completely Russified and does not process documents created using MS Word correctly enough, so after some experimentation with this program I gave up using it. You can read more about the StarOffice package as a whole in the book by A. Fedorchuk “Office, graphics, Web in Linux” [P1.6].

On October 13, 2000, Sun open sourced the StarOffice package. Thus, the OpenOffice.org project appeared (pay attention to prefix.org - as they say on the project’s Web page, this is how this project should be correctly named, since “OpenOffice” is a registered trademark of some other product).

The OpenOffice.org source code is based on technology that was originally developed by Sun Microsystems for future versions of the StarOffice™ suite. Unlike StarOffice, the OpenOffice.org project does not contain an integrating shell - the architecture of the package assumes separate use of the applications included in the package. The package is written in C++ and includes all the basic office applications, such as a word processor, spreadsheet, presentation management program, graphics program, charting and formula editing tools. But OpenOffice.org does not include an email, calendar, or browser client.

Other innovations include the use of a file format based on the XML standard, which makes it easier to interoperate with other products (and therefore with other computer users) and also provides a clear outlook for the future development of the product. The product includes converters for other common file formats, including formats of all versions Microsoft Office, and improved support for Asian languages ​​(Chinese, Japanese, Korean).

In the names of individual executable files The OpenOffice.org package traces its origins to StarOffice. The entire package is called by the "soffice" command. Individual package programs are called by the following commands:

Table 12.3. Names of programs in the OpenOffice.org package.

Currently, the OpenOffice.org package has been localized for 27 languages. The package works stably on Solaris, Linux (including PPC Linux) and Windows operating systems. Porting it to FreeBSD, IRIX and Mac OS X platforms is in progress.

It was all general information. It's time to tell you a little about your first impressions of working with the program itself. I worked with version 641b, which is part of the Red Hat Linux 7.2 Cyrillic Edition distribution from Urban Soft.

Installing the program is quite simple - expand the archive in one of the available directories and run the setup program from the resulting install directory. To begin with, you can select the standard installation option (there are also Minimal and Custom options). The installation went through without any problems, after which the OpenOffice.org641 subdirectory appeared in my home directory. This directory contains a symbolic link called soffice that allows you to run the program. This link launches the swriter program, i.e., a word processor. Other programs must be launched by their own names.

The appearance of the program window is, of course, somewhat unusual for an MS Office user. In addition to the usual menu strips and toolbars at the top of the window, there is also a vertical toolbar on the left. But, in general, all the elements of the window are quite clear.

Unfortunately, I became acquainted with this program at the last stage of working on this book, and I am not able to give a detailed description of this word processor. I will note only the most significant.

To begin with, I naturally tried to simply enter arbitrary text in Russian. There were no problems with typing, but for some reason the letters overlap each other (a problem that has already been reported in relation to StarOffice). Attempts to change the font showed that Helvetica was the most acceptable. The text became generally readable, but the effect of running letters was not completely eliminated. Inserting a picture (a snapshot of a program window) and a table went without problems (and when creating a table, its header was immediately formed).

Next, I tried to save the typed text in MS Word format. For this I chose the item File/Save as, and in the File Type drop-down list - Microsoft Word 97/2000/XP, entered the file name and clicked the Save button. Rebooted into Windows and opened the saved file. At first the picture did not appear, however, after entering the menu View I selected the item Page layout, everything fell into place. Everything is fine with the table too. So saving the file in Word format works.

Reverse action- opening a file created in MS Word in OpenOffice.org was also successful. True, initially some lines were printed entirely in squares instead of letters. But, as it turned out, this is a consequence of the difference in font sets (or styles) - after selecting the corresponding part of the text and changing the font, the text becomes quite readable.

By the way, the following brief description of the OpenOffice.org package was typed in the swriter program.

Not having the opportunity to study now detailed description Even the swriter program, not to mention the rest of the programs in the package, I just want to formulate the first conclusion. The most important thing, in my opinion, is that for the first time it became possible under Linux to work with files created in Microsoft Office. Thus, there is no longer any need to run emulators in order to view an MS Word file received as an email attachment from any Microsoft supporter. And it doesn’t matter that there are still complaints about the quality of the image displayed on the screen. All open source products are constantly being improved and developed and shortcomings will be eliminated over time. But the advent of OpenOffice.org breaks the last thread tying Linux devotees to Microsoft products and allows them to move completely to the Linux environment.

12.8. Dictionaries and translators

Personally, I have a negative attitude towards programs that are designed to automatically translate text from one language to another. No matter how hard the developers of such programs try, they cannot achieve any acceptable translation quality, and I think they will not succeed in the near future. Translations created by such programs can simply change the meaning of what is written to the point of absurdity. Therefore, I myself do not use such programs and do not recommend them to you.

Dictionaries are another matter. It seems to me that even professional translators cannot do without a dictionary. Even in our native language, we do not always understand the meaning of some words, so we are forced to use explanatory dictionaries and encyclopedias. So having an electronic dictionary is simply necessary. And such dictionaries exist, in particular for Linux. Naturally, most users first of all need English-Russian dictionaries in order to understand explanations of programs, which in the vast majority of cases are given in English.

I have not conducted a comparative analysis of electronic dictionaries, the results of which I could offer you here. The first program I came across was the slovo program, developed by D. Anisimov, to which I was already accustomed, and it suits me quite well. This program uses the well-known English-Russian Muller dictionary (although other dictionaries can be connected) and gives transcriptions of English words, so in normal practice it is quite sufficient.


Rice. 12.26. slovo program window

Receiving a transcription may cause some difficulties for you, since for this part of the program to work correctly, you need to install special fonts (this is natural, regular fonts do not contain transcription characters). However, in the manual for the program, which is also included in the Russian version, the necessary actions are described in detail, so there is no need to explain this here. At least everything worked out for me, I think that everything will be fine for you too, except that you will have to make a little effort.

After starting the program, the window shown in Fig. 12.26, only initially the three bottom fields are empty.

You can select the word that needs translation from the list in the top field, or directly enter it in the input line (second field from the top). As you type, the highlight in the word list moves to the word closest to the character combination you entered. Pressing the ‹Enter› key causes the translation to appear in the lower field of the program window and the transcription in the field located above the translation. Menu item Dictionaries allows you to change the dictionary (not all dictionaries allow you to display transcriptions; in my case, only the Muller dictionary had this property).

I hope that the explanations given are sufficient for you to be able to use this program effectively.

I came across another common English-Russian dictionary as part of the ALT Linux Junior 1.0 distribution. This is a dictionary mova Evgenia Tsymbalyuk. The graphical shell window for this dictionary is shown in Fig. 12.27.


Rice. 12.27. mova dictionary graphical shell window

In the input line (it is highlighted in yellow), enter the English word and press the "^Word" key. You can simply copy the unknown word into the input line. Instructions for using the program are given in the file Readme_mova_koi.txt attached to it, and in Russian, so No detailed explanation is required here.

Notes:

Since then, my website address has changed to http://rus-linux.net.

Currently, the site http://linux-ve.chat.ru is not supported, and all its contents have been transferred to the site http://rus-linux.net, where you will find the mentioned notes on my personal page.

A text editor for Linux is one of the most popular programs for users of this operating system.

Without it, the user simply will not be able to fully use his computer.

Vi/Vim

Emacs

This text editor is a little more complicated than all the previous ones, but if you understand it, you can feel for yourself how functional it is.

Emacs has a lot of customization options. In addition, each user has the opportunity to extend the functionality of Emacs in a variety of ways.

The most convenient of them is, which you can download on the Internet or create yourself.

The complexity of use can be explained very easily - the fact is that initially Emacs was an interpreter of one of the well-known programming languages ​​called lisp.

At the moment, the editor has a built-in interpreter. This means that with Emacs you can work with the most different languages programming.

For this purpose, the editor has built-in syntax highlighting. In general, very convenient.

Here are some more features of Emacs:

Rice. 6. Emacs

Geany

Finally, in last place in our ranking is an editor called Geany. The main objective of this program is to develop software using the GTK toolkit.

There are also many required functions for development, specifically, syntax highlighting, auto-closing tags ( and ) and much more.

Developers will also be interested to know that Geany has project management support.

That is, the user will not need to install any additional programs, but simply use the built-in functionality of the program.

Other features of Geany:

  • support for plugins (the same extensions);
  • Linux Lessons - Text editor vi. Main features.

    Basic features of the vi text editor. Creating and saving files. Basic modes and editor commands. MORE

A text editor should have an application for any operating system. We have no shortage, but these are graphic editors.

As you know, the real power of Linux lies in the command line. And when you're working on the command line, you need a text editor that can run right inside the terminal.

To this end, today we are going to make a list best command line text editors for Linux.

pressure

If you've been in Linux for quite some time, you must have heard of Vim. Vim is a highly customizable, cross-platform, and highly efficient text editor.

Almost every Linux distribution comes with Vim pre-installed. It is extremely popular due to its wide range of features.

Vim can be quite a pain for first time users. I remember the first time I tried to edit text file with Vim, I was completely confused. I couldn't type one letter on it, and the funny part is I couldn't even figure out how to close the thing. If you're going to use Vim, you'll need to make up your mind to climb a very steep learning curve.

But after you've gone through all that, combed through some paperwork, and memorized your commands and shortcuts, you'll find that the hassle was worth it. You can bend Vim as you wish - customizing your interface, but what seems to suit you is give your workflow more efficiency by using various custom scripts, plugins, and so on. Vim supports syntax highlighting, macro photography, and action history.

As on the official website, it is stated that,

Vim: Power tools for everyone!

It's entirely up to you how you use it. You can just use it for simple text editing, or you can set it up as a full-fledged IDE.

GNU Emacs

GNU Emacs is undoubtedly one of the most powerful text editors out there. If you've heard of Vim and Emacs, you'll know that both of these editors have a very loyal fan base, and they often take their text editor very seriously. And you can find a lot of humor and stuff on the Internet about this:

Emacs is cross-platform and has a command line interface and a graphical interface. It is also very rich in various features and most importantly, extensible.

Like Vim, Emacs also comes with a steep learning curve. But once you master it, you can use your power to its full potential. Emacs can handle almost any type of text file. The interface is customizable to suit your workflow. It supports macro photography and shortcuts.

The unique strength of Emacs is that it can be transformed into something completely different from a text editor. There is a large collection of modules that can transform an application for use in completely different scenarios, such as a calendar, news reader, word processor, etc. You can even play games in Emacs!

Nano-bamboo fiber

When it comes to simplicity, the Nano is one thing. Unlike Vim or Emacs, the learning curve for nano is almost flat.

If you want to simply create and edit a text file and get on with your life, look no further than Nano.

The shortcuts available on the Nano appear at the bottom of the user interface. Nano includes only basic text editor features.

It is minimal and ideal for editing system and configuration files. For those who don't need advanced features from a command line text editor, Nano is a perfect match.

People sometimes ask me - why am I interested in Linux? The answer turns out to be simple. Because Mac is also Linux. Or if not exactly Linux, then Unix in its commercial version. That is, not free and extremely reliable. And so - Mac is one of the variants of Unix. Namely, a system similar to FreeBSD (a version of Darwin on which the MAC OS X kernel is built; the similarity is very conditional, since the Mach kernel is used), plus commercial bells and whistles that turn the system into a reliable stronghold that skillfully resists viruses and other evil spirits.

However, Linux or no Linux, sometimes there is a need for the simplest tools. For example, in text editors. Well, you never know – write a program block. Or a letter. Or a note for memory. Finally, an article. It is highly desirable for this program to have a spell checker. And the texts were saved in txt format. And in other formats, of course. But txt is the default.

Just a question: are there such programs in Linux? Of course. And they are all a little similar to each other.

First of all, the Writer program from the LibreOffice suite. This is, one might say, a big, downright huge text editor... It’s a text editor, but not quite an editor. This program is more often called a “word processor.” It contains many controls that are needed at one time or another. We need, say, a drop cap - text wrapping around a capital letter - take it and put the drop cap. Frames are required to limit the text - take and put frames. Or the text needs an illustration - we take and put the required picture in the text (from the supplied stock or from the pictures available to the user).

This is all very good. It's not always necessary. Most often, it’s not necessary, since we are looking for a simple (if not the simplest) text editor.

Okay, with Writer everything is clear. This is a powerful text editor that we will need to compose letters, documents or even stories. Is there anything simpler? Yes - AbiWord editor. This is a very simple editor that is somewhat popular among Unix users. On the other hand, this editor also has its drawbacks. And the main one is limited functionality. In this editor, for example, there is no auto-capitalization option.

Well, no and no need. Another serious drawback of AbiWord is the questionable compatibility of documents prepared in it with documents prepared in the Word text editor included in MS Office.

Yes, yes, everything is ultimately based on this compatibility. Until the Writer word processor from OpenOffice and LibreOffice (plus various offices that largely replicate each other) learned to handle documents the way Word does, there was no talk of its popularity at all. Now there is, because compatibility is more or less limited.

Okay, are there really simple editors? There are – and quite a lot. One of the most “important” is the gedit program, which one way or another exists in all versions of Linux and Unix.

The gedit program has one very simple task that it is designed to do. We need to write text. Just the text and you don’t need to do anything else. This editor gives just such an opportunity - to write.

But at the same time, the gedit program has a lot of other capabilities. That’s what I’m saying – in life such unimportant needs often arise that such an elementary simple editor is needed... But still an editor? What else can you call it? It is suitable for recording words and texts. Sometimes it has a built-in spell checker - a very simple one, created on the basis of system services. He does not have auto capitalization skills, but this is precisely what is not needed.

What else do you need from a text editor? The most important thing is that he exists.

Choice