Making Emacs to show line number


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Making Emacs to show line number
# 8  
Old 01-28-2004
Quote:
Originally posted by saurya_s
Yes, those are the keys that I am using though not all of them.
Yea, I posted the whole thing figuring it'd make a good reference for someone in the future.. Smilie

Quote:
What I was looking is - if it numbers line of a file , then I can jump to a particular line immediately using go to line command ofcourse it will work good only for a page. how do you do this?
I don't think there is a way in emacs. I looked at a few tutorials and they all pretty much list the same basic commands as I posted above.
# 9  
Old 01-28-2004
Hi
Quite simple thing I guess I am asking. Emacs is thought to be one of the most powerful editors!! So is there any other way of acheiving this kind of thing. I normally use BBEdit on OSX and jump to a line comes very handy, so I thought i might extend that to UNIX as well - will be useful whe I am not on xterm.
SS
# 10  
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..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question