[Top][All Lists]

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

RE: Indenting paragraphs manually

From: Drew Adams
Subject: RE: Indenting paragraphs manually
Date: Sun, 6 Mar 2011 12:26:39 -0800

> > You can type "C-x TAB" once and then repeat it with "C-x z".
> Indeed, that is another solution, but IMO has it's own drawbacks:
>  - As shown, the indentation is made by steps of 1 space.
>  - If you use a prefix argument (to avoid the above problem), it
>    becomes cumbersome.
> The complexity of this method is also higher than having a simple,
> easy to type command that indents the region to the next tab stop and
> can be repeated several times in a row.

(defun incremental-tab (arg)
  (interactive "P")
  (require 'repeat)
  (let ((repeat-message-function  'ignore))
    (setq last-repeatable-command  'indent-rigidly)
    (repeat nil)))

(define-key ctl-x-map "\t" 'incremental-tab)

Or if `C-x TAB TAB...' is too much for you, hold down `f5':

(global-set-key [f5] 'incremental-tab)

Hit `C--' at any time to reverse, `C-1' to reverse back again:

`f5 f5 f5 f5 C-- f5 f5 C-1 f5'...

reply via email to

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