Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
> that's actually a good idea for extending snippets in my IDE (yasnippet/Emacs) ¹

for the records some trivial templates for yasnippet, which is derived from textmates standard and is similar to snippMate for vim.

Not too far away from Abbrevations in Komodo.

# -*- mode: snippet -*- # name: caller; # key: caller # -- my (${1:$package}, ${2:$filename}, ${3:$line}) = caller; $0

# -*- mode: snippet -*- # name: caller(LEVEL) # key: caller # -- my (${2:$package}, ${3:$filename}, ${4:$line}, ${5:$subroutine}, ${6:$ +hasargs}, ${7:$wantarray}, ${8:$evaltext}, ${9:$is}_require, ${10:$hints}, ${11: +$bitmask}, ${12:$hinthash}) = caller(${1:$LEVEL}); $0

please note that both versions of caller are expanded with the same keyword + TAB and you can chose from a dropdown between both versions.

here the example for splice

# -*- mode: snippet -*- # name: splice @ARR ,OFFSET ,LENGTH ,LIST # key: splice # -- splice @${1:ARR} ,${2:OFFSET} ,${3:LENGTH} , ${4:LIST...};

since I can include code (elisp but also bash or Perl) I'd like to find a way to delete the commas of skipped arguments instead of creating 4 versions for drop down... but I'm still at the beginning.

Vision: Ideally these snippets could be generated from POD-examples and show the documentation¹, I think DBI is a good candidate.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

PS: thanks to Tux for suggesting the return values for stat, (local)time, and caller (with or without args)

¹) probably best realized in combination with autocomplete-mode ... unfortunately emacs-wiki seems to be down at the moment...


In reply to Re^3: When does programming become automatic (if ever)? (IDE snippets) by LanX
in thread When does programming become automatic (if ever)? by nysus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found