[implementations-list] vimpulse interaction with cua increasing number feature
vegard_oye at hotmail.com
Mon Mar 29 22:31:54 CEST 2010
Are you using the Subversion version of Vimpulse? You'll need to point
your SVN client to the address below if you want the latest bugfixes
>> I have a new problem with my traditional handling in dired mode.
>> In dired mode, I am not able to split the window horizontally or
>> vertically anymore using :sp or :vs !?
Fixed in SVN revision 159.
> [M-n] fills each line of the rectangle with increasing numbers using
> a supplied format string (prompt)
> Does anyone have a hint, how I could get this cua-feature to work
> with the new vimpulse? Maybe, there is already a vimpulse function,
> which can do the same!?
The Cua function will only work on Cua rectangles. However, since
Vimpulse's block selections are rectangle compatible, an equivalent
rectangle command can be written as follows:
(defun my-sequence-rectangle (first incr format)
"Insert increasing numbers at beginning of each line."
(list (if current-prefix-arg
(read-string "Start value: (0) " nil nil "0")))
(read-string "Increment: (1) " nil nil "1"))
(read-string "Format: (%d) ")))
(when (= (length format) 0)
(setq format "%d"))
(lambda (start-col end-col count-var)
(insert (format format (eval count-var)))
(set count-var (+ (eval count-var) incr)))
(region-beginning) (region-end) 'first)
(vimpulse-vmap (kbd "M-n") 'my-sequence-rectangle)
If you compare it with `cua-sequence-rectangle', you'll see they are
quite similar; the Cua function uses `cua--rectangle-operation' for
applying a lambda function on each line, whereas this function uses
`apply-on-rectangle' from rect.el.
Hope this helps!
Få nye Windows Live™ Messenger.
More information about the implementations-list