[implementations-list] vimpulse interaction with cua increasing number feature
Hello, I am using vimpulse for quite a while now ... and I like it a lot :-) For a while now, I am having difficulties with the interaction of vimpulse and cua. Basically, I am just using cua's feature to insert and increase numbers for the selected rectangle. [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!? Thanks in advance! Fabian
Hi, me again... I found another way inserting incremented number-lines using on: http://xahlee.org/emacs/elisp_examples.html Still, it would be nice, to see other approaches as well. In addition, 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 !? Would be nice, if you have some hints! Best Regards! Fabian On 03/29/2010 11:03 AM, Fabian Braennstroem wrote:
Hello,
I am using vimpulse for quite a while now ... and I like it a lot :-) For a while now, I am having difficulties with the interaction of vimpulse and cua. Basically, I am just using cua's feature to insert and increase numbers for the selected rectangle.
[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!?
Thanks in advance! Fabian
_______________________________________________ implementations-list mailing list [email protected] https://lists.ourproject.org/cgi-bin/mailman/listinfo/implementations-list
Hi Fabian! 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 before release. http://my-svn.assembla.com/svn/vimpulse
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: (require 'rect) (defun my-sequence-rectangle (first incr format) "Insert increasing numbers at beginning of each line." (interactive (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) (string-to-number (read-string "Start value: (0) " nil nil "0"))) (string-to-number (read-string "Increment: (1) " nil nil "1")) (read-string "Format: (%d) "))) (when (= (length format) 0) (setq format "%d")) (apply-on-rectangle (lambda (start-col end-col count-var) (move-to-column start-col) (insert (format format (eval count-var))) (set count-var (+ (eval count-var) incr))) (region-beginning) (region-end) 'first) (vimpulse-visual-mode -1)) (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! Vegard _________________________________________________________________ Få nye Windows Live™ Messenger. http://download.live.com/messenger
Hi Vegard, thanks for your help! On 03/29/2010 10:31 PM, Vegard Øye wrote:
Hi Fabian!
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 before release.
http://my-svn.assembla.com/svn/vimpulse
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.
Ok, I did that now... very nice :-)
[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:
(require 'rect)
(defun my-sequence-rectangle (first incr format) "Insert increasing numbers at beginning of each line." (interactive (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) (string-to-number (read-string "Start value: (0) " nil nil "0"))) (string-to-number (read-string "Increment: (1) " nil nil "1")) (read-string "Format: (%d) "))) (when (= (length format) 0) (setq format "%d")) (apply-on-rectangle (lambda (start-col end-col count-var) (move-to-column start-col) (insert (format format (eval count-var))) (set count-var (+ (eval count-var) incr))) (region-beginning) (region-end) 'first) (vimpulse-visual-mode -1))
(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.
This works quite well... thanks! Best Regards! Fabian
participants (2)
-
Fabian Braennstroem -
Vegard Øye