Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Toggling test plans with vim

by diotalevi (Canon)
on Aug 09, 2006 at 14:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://566416]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-25 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found