Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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))))

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊


Comment on Re: Toggling test plans with vim
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://566416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (14)
As of 2014-11-27 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (183 votes), past polls