help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: putting double quotes efficiently


From: Udyant Wig
Subject: Re: putting double quotes efficiently
Date: Mon, 03 Jun 2013 15:50:17 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

You might also try keyboard macros.

Here's how I'd do it:

0.  Move point to the first line (anywhere will do).

        print _!_line1
        print linetwo
        print line3

1.  Press C-x ( to begin recording a keyboard macro

2.  Press C-a to move to the beginning of the line

        _!_print line1
        print linetwo
        print line3

3.  Press M-f to move forward a word 

        print _!_line1
        print linetwo
        print line3
        
4.  Press " to insert one double-qoutes

        print "_!_line1
        print linetwo
        print line3

5.  There are two options here, any of which work fine:

    5.0.  Either, M-f again to move forward,
    5.1.  Or, C-e to move to the end of the line

        print "line1_!_
        print linetwo
        print line3

6.  Press " to insert the second double-quotes

        print "line1"_!_
        print linetwo
        print line3

7.  Press ; to insert the semi-colon

        print "line1";_!_
        print linetwo
        print line3

8.  Press C-n to move down a line

        print "line1";
        print linetwo_!_
        print line3

9.  Press C-x ) to finish recording the keyboard macro

10.  Press C-x e to repeat the keyboard macro

        print "line1";
        print "linetwo";
        print line3_!_

11.  You can now simply press `e' to repeat

        print "line1";
        print "linetwo";
        print "line3";

The above goes very quickly when actually typing.        
        
The Info node (emacs)Keyboard Macros is the authoritative reference.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]