Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Toggling test plans with vim

by diotalevi (Canon)
on Aug 09, 2006 at 14:06 UTC ( #566416=note: print w/replies, xml ) Need Help??


in reply to Toggling test plans with vim

Here's the same thing written in Elisp for all those Emacs users out there.

;; Ctrl-C t p ;; (global-set-key "\C-ctp" 'toggle-test-plan) ;; or rather, only set this when editing perl code (eval-after-load "cperl-mode" '(add-hook 'cperl-mode-hook (lambda () ;; ... other perl only key bindings go here (local-set-key "\C-ctp" 'toggle-test-plan) )) (defun toggle-test-plan () "..." (interactive) (let ((new-pos)) (save-excursion (goto-char (point-min)) (cond ((re-search-forward "More[ \t]+tests[ \t]*=>[ \t]*" nil t) (replace-match "More 'no_plan'; # tests => " t t)) ((re-search-forward "More[ \t]+'no_plan';[ \t]*#[ \t]*" ni +l t) (replace-match "More " t t) (setq new-pos (point))))) (if new-pos (goto-char new-pos))))

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://566416]
help
Chatterbox?
[stevieb]: my RPi::WiringPi now fully supports: GPIO, LCDs, digital potentiometers, analog to digital converters, shift registers, barometric pressure sensor, direct access to SPI bus, and ability for more :)
[stevieb]: ...just need to perform many tests and POD review this week, then I'm going to put together some real projects and post about them

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2017-01-22 22:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (190 votes). Check out past polls.