0% found this document useful (0 votes)
20 views18 pages

Emacs Unit3

Uploaded by

woyevi6712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views18 pages

Emacs Unit3

Uploaded by

woyevi6712
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Emacs, Nano, Pico and

Gedit
Prof. Ms. S. S. Tantarpale
What is Emacs?
Emacs is different things to different people.
Depending who you ask, you'll could get any of the following responses:
• Text Editor
• Mail Client
• News Reader
• Word Processor
• Religion
• Integrated Development Environment
• Whatever you want it to be!
• Emacs is one of the most popular and powerful text editors used on
Linux (and Unix).
• It is second in popularity only to vi. It is known for it huge feature set,
ability to be easily customized, and lack of bugs.
• It's large feature set and ability to be customized actually are the result
of how Emacs was designed and implemented.
• Without going into all the details, I'll simply point out that Emacs isn't
``just an editor''.
• It is an editor written mostly in the programming language Lisp. At
the core of Emacs is a full−featured Lisp interpreter written in C.
• Only the most basic and low−level pieces of Emacs are written in C.
The majority of the editor is actually written in Lisp.
Ports and Versions
• It's worth pointing out that there are actually two different Emacs
editors:
GNU Emacs and XEmacs.
Both come from the same heritage and share most of the
same features.
Starting & Quitting Emacs
• At your shell prompt, type emacs and hit enter. Emacs should start up. If not, it is
either not installed or not in your path.
• Once you've seen Emacs, you need to know how to exit. The keystrokes for leaving
Emacs are C−x C−c. The C−x notation means hold down the Ctrl key and press x.
• In this case, you'll then need to hold down Emacs Beginner's HOWTO Ports and
Versions 3 Ctrl and press c to finish the task.
• The keystrokes used in Emacs will likely seem odd, foreign, and maybe even
uncomfortable to you at first−−especially if you're a vi user.
• Unlike vi, Emacs doesn't have separate modes for editing text and issuing
commands.
• To re−cap: emacs will start Emacs. C−x C−c will exit Emacs.
• What you'll see When Emacs starts up it will consume a whole X window (or
screen if you're running on a console instead of in the X Window System). You'll
see a menu across the top, some text in the main part of the screen, and a couple of
lines at the bottom. It will look something like this ASCII sketch:
• +−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
−+
|Buffers Files Tools Edit Search Mule Help |
||
|Welcome to GNU Emacs, one component of a Linux−based GNU system. | | | | | | |
| ... | | | |−−−1:−−−F1 *scratch* (Lisp Interaction)−−L1−−All−−−−−−−−−−−−−| |For
information about the GNU Project and its goals, type C−h C−p. | +−−−−−−−−−−−−
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−+
Keyboard Basics
• If you're a vi user, the notion of using the k, j, l, h keys to move up a
line, down a line, forward by a character, and backward by a character
probably took some getting used to. In fact, it might have taken you a
few hours or even weeks of practice before you could comfortably
navigate a file using the various key combinations available in vi.

• Emacs is no different. There are different keystrokes and commands to


learn. Just like vi, you only need to master the basics to get a lot of
work done.
Command Keys (Meta, Esc, Control,
and Alt)
• Emacs makes heavy use of multi−key combinations. Because it is not a modal editor
like vi, you don't have to think about being in ``command mode'' or ``editing mode''
before you can try to move the cursor or execute a command.
• Instead, you just press the right combination of keys and Emacs does as told (usually).
• The keys that Emacs makes the most use of are usually abbreviated in the
documentation as C (for Control or Ctrl) and M for (Meta). You'll want to use either
Esc or Alt for the Meta key.
• In most standard configurations, both Esc and Alt do essentially the same thing. So
when you see a reference in any Emacs related documentation to C−x f it means
``press control−x and then f.''
• And if you see a reference to something like M−x shell is means ``press alt−x and
type the word shell''.
The Nano Text Editor
• Nano is a text editor suited to working in UNIX. It is not as powerful
as PC window-based editors, as it does not rely on the mouse, but still
has many useful features.
• Most nano commands are invoked by holding down the Ctrl key (that
is, the control key), and pressing one of the other keys.
• In this text, the control key is referred to using ^.
• For example, ^X means ``hold down the CTRL key and press the x
key''.
Starting nano Editor
• To edit a file called filename, type nano filename.
• In nano, you can insert another file:
^R read an existing file into nano (inserted at the current cursor
position)
^T opens a browser that allows you to select a file name from a
list of files and directories
Navigation
• The usual mouse-based point-and-click method is not supported by nano. Use
the arrow keys to move around the page in nano. Other navigation commands:
• ^A move to beginning of line
• ^E move to end of line
• ^Y move down a page
• ^V move up a page
• ^_ move to a specific line (^_^V moves to the top of the file, ^_^Y to the
bottom)
• ^C find out what line the cursor is currently on
• ^W search for some text.
• When searching, you will be prompted for the text to search for. It searches
from the current cursor position, wrapping back up to the top if necessary.
• Editing
Insert new text at the current cursor position just by typing the
text in.
Delete commands:
^D delete character currently under the cursor
BackSpace delete character currently in front of the cursor
^K delete entire line
^\ search for (and replace) a string of characters
• Saving and Exiting
^O save contents without exiting (you will be prompted for a file
to save to)
^X exit nano (you will be prompted to save your file if you
haven't)
^T when saving a file, opens a browser that allows you to select a
file name from a list of files and directories
Pico Editor
• Using Pico to Edit Files.
• Pico is an application which allows you to create and edit text files.
Pico is also the default editor for the Pine email and news reader. Pico
is automatically invoked within Pine each time you compose an email
message or newsgroup article.
• Pico can also be used as a stand-alone text editor by typing pico
filename at a Unix prompt. As all the available commands are listed
across the bottom of the screen, Pico is one of the most user friendly
text editors available on the Unix system
Entering Text and Executing
Commands
• Each character typed is automatically inserted into the buffer at the
current cursor position.
• Editing commands and cursor movement (besides arrow keys) are
executed by typing special control-key sequences.
• A caret (^) is used to denote the control key, sometimes marked on the
keyboard with the word Control or the letters CTRL.
• On the Pico menu, the key combination -q is written as ^Q, which
means to hold down the key and then type q
Commands:
• ^F Move forward one character
• ^B Move backwards one character
• ^P Move to the previous line
• ^N Move to the next line
• ^A Move to the beginning of the current line
• ^E Move to the end of the current line
• ^V Move one page forward
• ^Y Move one page backwards
• ^W^Y Move to the first line of the file
• ^W^V Move to the last line of the file
Gedit Editor
• Gedit editor is the default editor for the GNOME desktop environment.
When we open a file, it will open with the Gedit editor.
• It provides straightforward functionalities like any basic text editor. It is a
lightweight editor with a straight forward user interface.
• It was publicly released in the year 2000 with a GNOME desktop
environment.
• It is developed using the C programming language and supports all font
family.
• To invoke the gedit editor from the terminal, execute the below command:
gedit filename
Thank you !

You might also like