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

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

Re: Saving and recalling registers, using the same key sequence ?


From: Óscar Fuentes
Subject: Re: Saving and recalling registers, using the same key sequence ?
Date: Wed, 20 Mar 2019 20:23:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.90 (gnu/linux)

jonetsu <address@hidden> writes:

> Is it possible to save a text register and use it in the exact same way
> at a later time ?  
>
> For instance, I define very simple useful things that I recall by doing:
>
> C-x r i i  ;; inserts : #include <>
> C-x r i u  ;; inserts : using std::;
> C-x r i n  ;; inserts : << '\n';
>
> I would like to have these always ready when editing C++ code.  They
> could be globally defined, or bound to the editing of C++ files, I
> wouldn't mind.

You can use `set-register' to set your registers programatically in your
.emacs file:

(set-register ?i "#include <>")

IMO abbrevs are a better choice for what you want. See `Abbrevs' in the
Emacs manual.

Depending on your specific needs and preferences, the Yasnippet package
can be even better.



reply via email to

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