Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-19-2010, 01:27 PM   #1
Registered: Feb 2008
Posts: 32

Rep: Reputation: 15
single key to increment the number in emacs

What is the procedure to increment the number under the cursor ?


Which key i have to press to make this 12 to become 13.

I know the method of keeping the number in register and incrementing, .

But am looking for a single key to increment the number under cursor. Can anybody help me ?
Old 07-19-2010, 03:08 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913Reputation: 913
I'm afraid you'll have to develop your own lisp foo, and
magically bind it to a single key; there's no such built-in
function in Emacs ...

1 members found this post helpful.
Old 08-05-2011, 01:50 PM   #3
David A
LQ Newbie
Registered: Aug 2011
Location: Sweden
Posts: 2

Rep: Reputation: Disabled
The page currently contains two functions that can do what you want.

Copy one of the functions and the key definition to your emacs init file (usually ~/.emacs).

Last edited by David A; 08-14-2011 at 06:43 PM. Reason: improve link/url


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] shell scripting: How can I increment a file by number dv502 Programming 11 08-27-2010 09:43 AM
[Bash] increment number in a string czezz Programming 4 07-01-2009 12:34 PM
How to backup mysql single table with increment sgm277 Linux - Server 9 06-05-2008 02:16 AM
Alt no longer META key when using in-terminal option of Emacs (emacs -nw) frznchckn Linux - Software 1 06-02-2007 03:41 AM
Line number in Emacs as default saurya_s Linux - Software 1 01-28-2004 07:37 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration