Linux Text Editors PDF
Document Details

Uploaded by WellConnectedPrimrose4105
Eastern Samar State University
Tags
Summary
This document provides an overview of text editors in a Linux environment, focusing on the vi editor and its modes, commands, and functions. It covers creating, editing, and deleting text within a command-line interface. The guide also includes practical examples and details concerning cursor movements in text editors. Keywords: Linux, text editor, vi, vim.
Full Transcript
IT1917 Linux Applications Reasons for Using Text editors in Linux Scripts are written in text editors. Many Linux programs use text-based data files for input. Many of Linux-operating system services use configuration files that are text-based. Common Text-Based Editors Used in Linu...
IT1917 Linux Applications Reasons for Using Text editors in Linux Scripts are written in text editors. Many Linux programs use text-based data files for input. Many of Linux-operating system services use configuration files that are text-based. Common Text-Based Editors Used in Linux emacs – can be customized and extended with different modes, enabling it to be used like IDE for programming languages such Java or C. It has to be installed first. nano – is a text editor designed for beginners. gedit – comes with the Gnome desktop. It only runs in the GUI environment. vi – is a native editor found in all Linux and Unix systems. Most Linux distributions do not include real vi; rather, they include an enhanced replacement called vim (short for vi improved). Three (3) Modes of vi Editor command: Keystrokes entered operate as command rather than characters entered into the document. insert: Any character entered is placed at the current cursor position. replace: Any character entered replaces the character at the current cursor position. Starting vi: Creating a new file: Confirmation message: To add text, press the “i” key: To exit insert mode and return to command mode, press Esc. To save the change/s you have made, press the :w command. Confirmation message: 03 Handout 1 *Property of STI Page 1 of 3 IT1917 Cursor Movement Commands: Key Moves: l or Right arrow One character to the right h or Left arrow One character to the left j or Down arrow One line down k or Up arrow One line up 0 To the beginning of the current line ^ To the first non-whitespace character on the current line $ To the end of the current line w To the beginning of the next word or punctuation character W To the beginning of the next word, ignoring punctuation characters Ctrl+f or Page Down One page down Ctrl+b or Page Up One page up numberG To line number (Ex. 1G moves to the first line of the file.) G To the last line of the file To append text to an existing file, use the A command. The A command moves the cursor to the end of the line before starting insert mode. To insert a blank line between two (2) existing lines. You can use either the o command to insert the line below the current line: To insert the line above the current line, use the O command instead: Text Deletion Commands: Command Deletes: x The current character 3x The current character and the next two (2) characters dd The current line 5dd The current line and the next four lines dW From the current cursor position to the beginning of the next word d$ From the current cursor location to the end of the current line d0 From the current cursor location to the beginning of the line d^ From the current cursor location to the first non-whitespace character in the line dG From the current line to the end of the file d20G From the current line to the twentieth line of the file Text Yanking/Pasting Commands: Command Copies: yy The current line 5yy The current line and the next four lines yW From the current cursor position to the beginning of the next word 03 Handout 1 *Property of STI Page 2 of 3 IT1917 y$ From the current cursor location to the end of the current line y0 From the current cursor location to the beginning of the line y^ From the current cursor location to the first non-whitespace character in the line yG From the current line to the end of the file y20G From the current line to the twentieth line of the file Productivity Software It enables users to work with documents and files such as: o Word-processed documents o Spreadsheets o Presentation graphics documents o Database relations o Graphic images LibreOffice is the office suite for Linux. It includes: o Writer (word processing): It has AutoComplete feature, which can suggest commonly-used words and phrases to complete what you have started typing, using the built-in dictionary and by scanning the documents you open. o Calc (spreadsheet): It has Advanced DataPilot technology that makes it easy to pull in raw data from corporate databases, and then cross-tabulate, summarize, and convert it into meaningful information. Real-time data streams can now be integrated in sheets and reports, and factored in calculations. o Impress (presentation): It has the Fontworks tool that lets you create attractive 2D and 3D images from text. It supports multiple monitors, and its bundled Presenter Console extensions allows you more control over your slide show, such as the ability to: ▪ see the upcoming slide; ▪ view slide notes; and ▪ control the presentation timer while the audience is looking at the current slide. o Draw (vector graphics and flowcharts): It is an excellent package for producing technical drawings, brochures, posters, and many other documents. It lets you manipulate graphical objects, group them, crop them, use objects in 3D, and much more. o Base (database): It provides native-support drivers from some of the most widely employed multi-user database engines: ▪ MySQL/MariaDB ▪ Adabas D ▪ MS Access ▪ PostgreSQL o Math (formula editing): It enables you to insert perfectly formatted mathematical and scientific formulas in your text documents, spreadsheets, presentations, and drawings. GIMP is the recommended image editor for the Linux platform. It includes the following features: o Customizable Interface o Photo Enhancement o Digital Retouching o Hardware Support References: Barret, Daniel J. (2016). Linux pocket guide. 3rd ed. USA: O’Reilly Media, Inc. Fox, Richard. (2015). Linux with operating system concepts. USA: CRC Press, Taylor & Francis Group, LLC. Shotts, William E. Jr. (2016). The linux command line. 3rd ed. USA: No Starch Press. 03 Handout 1 *Property of STI Page 3 of 3