Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Making Emacs to show line number Post 46884 by oombera on Wednesday 28th of January 2004 12:32:04 PM
Old 01-28-2004
http://grok2.tripod.com/
Code:
emacs for vi users

Open/Save/Quit

 Action                  Vi        Emacs 
 open file               :e        Ctrl - x Ctrl - f 
 save file               :w        Ctrl - x Ctrl - s 
 quit editor             :q        Ctrl - x Ctrl - c 

Move Cursor

 Action                  Vi        Emacs 
 left                    h         Ctrl - b 
 down                    j         Ctrl - n 
 up                      k         Ctrl - p 
 right                   l         Ctrl - f 
 back one word           b         Esc - b 
 foward one word         w         Esc - f 
 beginning of line       ^         Ctrl - a 
 end of line             $         Ctrl - e 
 page up                 Ctrl - b  Esc - v 
 page down               Ctrl - f  Ctrl - v 
 jump to line number 'n' nG        Esc - x goto-line RET n

Delete Text

 Action                  Vi        Emacs 
 delete char             x         Ctrl - d 
 delete word             dw        Esc - d 
 delete line             dd        Ctrl - k Ctrl - k 
 delete 'n' lines        ndd       Esc - n Ctrl - k 

Undo

 Action                  Vi        Emacs 
 undo                    u         Ctrl - x u 

Yank/Place

 Action                  Vi        Emacs 
 yank 'n' lines          nyy       Ctrl - SPACE, move cursor upto the first character of
                                   the line next to last line you want to yank, Esc - w 
 place (emacs calls
 this yank -- yank
 from the copy buffer)   p or P    Ctrl - y 

Search

 Action                  Vi        Emacs 
 search forward          /         Ctrl - s (text incremental search) 
 search backward         ?         Ctrl - r (text incremental search) 

Glossary

 RET: Many commands in emacs bring up a prompt line at the bottom of the editor screen
      (like the ":" command line at the bottom of the vi editor) where you need to
      provide additional information after which you press the Enter/Return key
      to cause the command to act.

 Esc: Unlike the Alt/Ctrl/Meta/Shift key combinations, Esc key combinations require
      that you press and release the Esc key before you press the next key. On Unix
      workstations, you may be able to use the Meta key instead of the Esc key (in
      which case, you would keep the Meta key pressed when pressing the next key in
      the key combination).

-----
Oops .. well, this still doesn't show you how to display line numbers in emacs, but at least you can go to a certain line..

Last edited by oombera; 01-28-2004 at 03:37 PM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

emacs as a line editor

hello, I would like to use emacs as a line editor (I use emacs as editor). I try "set -o emacs" but I have nothing. Thank you for any help (5 Replies)
Discussion started by: annemar
5 Replies

2. Shell Programming and Scripting

making sure a command line paramter is a number

i need to make sure that a command line paramter is with in a certin set of numbers and i dont know how todo it with out checking individual numbers. if test $1 -eq (need something here) then echo hi fi like if i put individual numbers in there it works fine but how do i do a range (3 Replies)
Discussion started by: rcunn87
3 Replies

3. Shell Programming and Scripting

Show result only if number is greater then

Hello all Im trying to write one liner that will show me results only if the result of the expression is greater then 0 For example: I do : find . -name "*.dsp" | xargs grep -c SecurityHandler the result are : ./foo/blah/a.dsp:0 ./foo/blah1/b.dsp:1 ./foo/blah2/c.dsp:2... (1 Reply)
Discussion started by: umen
1 Replies

4. Programming

Emacs line indentation

Hi. I'm writing a document in Python, so indentation is crucial. I want to indent a whole section by exactly one tab. Any idea how to go about this? I'm using terminal emacs (no mouse input) Thanks for any help! (2 Replies)
Discussion started by: Rledley
2 Replies

5. Shell Programming and Scripting

Making script show command (e.g. copy) being executed and variable substitution?

When script is running you only see when some of the commands are not successfull. Is there a way to see which command are executed and to show the substitution of variables as every line is executed ? (3 Replies)
Discussion started by: gr0124
3 Replies

6. UNIX for Dummies Questions & Answers

How to read contents of a file from a given line number upto line number again specified by user

Hello Everyone. I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below: if ; then if ; then tail +$1 $3 | head -n $2 else ... (5 Replies)
Discussion started by: grc
5 Replies

7. Shell Programming and Scripting

How to use command tail -f & show line number.

Hello Guys, I have created function which is as follow: tail -f filename |grep "Key word" output from this command 19-11-2011 21:09:15,234 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,286 - INFO Numbement - error number:result = :11 19-11-2011 21:09:15,523 - INFO... (5 Replies)
Discussion started by: ooilinlove
5 Replies

8. UNIX for Dummies Questions & Answers

How to use emacs? Also how to open existing emacs files with .cgi format?

Hi All, I am new to this forum and a beginner in unix. Please correct me if I put the question in a wrong way.. How to use emacs editor? Also how to open existing emacs files with .cgi format? I have the following link :- http link i.e. url and path : /abc/xyz.dev/xyz/documents What... (7 Replies)
Discussion started by: swathi123
7 Replies

9. Shell Programming and Scripting

Show difference between two number

Hi, I would like to show the difference between two numbers. For example. input.txt 1 7 2 10 0 0 6 7 I would like a third field showing the difference between the numbers as below: ouput.txt 1 7 6 2 10 8 0 0 0 6 7 1 How do I do this? (4 Replies)
Discussion started by: general_lee
4 Replies
SURF(1) 						      General Commands Manual							   SURF(1)

NAME
surf - simple webkit-based browser SYNOPSIS
surf [-e xid] [-i] [-p] [-s] [-v] [-x] URI DESCRIPTION
surf is a simple Web browser based on WebKit/GTK+. It is able to display websites and follow links. It supports the XEmbed protocol which makes it possible to embed it in another application. Furthermore, one can point surf to another URI by setting its XProperties. OPTIONS
-e xid Reparents to window specified by xid. -i Disable Images -p Disable Plugins -s Disable Javascript -v Prints version information to standard output, then exits. -x Prints xid to standard output. This can be used to script the browser by using xprop(1). USAGE
Escape Stops loading current page or stops download. Ctrl-h Walks back the history. Ctrl-l Walks forward the history. Ctrl-k Scrolls page upwards. Ctrl-j Scrolls page downwards. Ctrl-Shift-k Zooms page in. Ctrl-Shift-j Zooms page out Ctrl-Shift-i Resets Zoom Ctrl-/ Opens the search-bar. Ctrl-n Go to next search result. Ctrl-Shift-n Go to previous search result. Ctrl-g Opens the URL-bar. Ctrl-p Loads URI from primary selection. Ctrl-Shift-p Calls Printpage Dialog. Ctrl-r Reloads the website. Ctrl-Shift-r Reloads the website without using cache. Ctrl-y Copies current URI to primary selection. Ctrl-o show the sourcecode of the current page. SEE ALSO
dmenu(1) xprop(1) BUGS
Please report them! surf-0.4.1 SURF(1)
All times are GMT -4. The time now is 04:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy