• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Tweakers Anonymous
 

Tweakers Anonymous

on

  • 1,522 views

Have you ever spent most of a day getting your editor set up "just right"? Have you justified the time spent on customizing your configuration in terms of the overall productivity gains that are going ...

Have you ever spent most of a day getting your editor set up "just right"? Have you justified the time spent on customizing your configuration in terms of the overall productivity gains that are going to result once you remember what key binding you put that new tweak on? Or maybe, whenever you see a tweak described for that _other_ editor, you can't rest until you've duplicated and maybe even expanded upon it for the clearly superior editor you use? If the above hit too close to home -- particularly if you've ever written a program specifically to allow you to more easily deploy your editor configuration on a new machine -- this talk is for you.

We're going to talk about editor tweaks that make writing, testing, running, and otherwise working with Perl faster and easier, so you can focus on the stuff that really matters: beer, go karts, and cool new editor color themes...

Statistics

Views

Total Views
1,522
Views on SlideShare
1,522
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n

Tweakers Anonymous Tweakers Anonymous Presentation Transcript

  • Tweakers Anonymous John SJ Anderson dc.pm @genehack genehack@genehack.org
  • An elegant weapon for a more civilized age
  • An elegant weapon for a more civilized age
  • But instead...
  • But instead...
  • But instead...
  • But instead...• Not editor specific
  • But instead...• Not editor specific• Less about how
  • But instead...• Not editor specific• Less about how• More about what
  • But instead...• Not editor specific• Less about how• More about what• Should be able to apply ideas to any programmer’s editor
  • Programmer’s editor
  • Programmer’s editor• Syntax highlighting
  • Programmer’s editor• Syntax highlighting• Indentation support
  • Programmer’s editor• Syntax highlighting• Indentation support• Programable
  • Syntax highlighting
  • Syntax highlighting• If nothing else, this helps catch stupid typos faster
  • Syntax highlighting• If nothing else, this helps catch stupid typos faster• Can also sometimes obscure the code -- you may want to be able to easily toggle it on and off
  • Syntax highlighting• If nothing else, this helps catch stupid typos faster• Can also sometimes obscure the code -- you may want to be able to easily toggle it on and off• Not to the angry fruit salad level
  • Syntax highlighting• If nothing else, this helps catch stupid typos faster• Can also sometimes obscure the code -- you may want to be able to easily toggle it on and off• Not to the angry fruit salad level• Just something that distinguishes keywords from variables from function names
  • Indentation support
  • Indentation supportWell, then get one that does do auto-indent.You cant do good work with bad tools. -- Mark Jason Dominuss Good Advice #11918
  • Programable
  • Programable• Doesn’t need to be Turing complete or anything crazy
  • Programable• Doesn’t need to be Turing complete or anything crazy• (Although you may be missing out if it isn’t.)
  • Programable• Doesn’t need to be Turing complete or anything crazy• (Although you may be missing out if it isn’t.)• If you can send a selection to an external program and replace the selection with the output, you’re probably set
  • The generic advice
  • The generic advice• Pay some attention to what you’re doing
  • The generic advice• Pay some attention to what you’re doing• Set things up so stuff you do most often can be done most easily
  • The generic advice• Pay some attention to what you’re doing• Set things up so stuff you do most often can be done most easily• E.g., saving a file, closing a file, defining and running macros, etc. etc.
  • The generic advice• Pay some attention to what you’re doing• Set things up so stuff you do most often can be done most easily• E.g., saving a file, closing a file, defining and running macros, etc. etc.• The F keys are not there just so you can skip tracks in your MP3 player
  • The generic advice• Pay some attention to what you’re doing• Set things up so stuff you do most often can be done most easily• E.g., saving a file, closing a file, defining and running macros, etc. etc.• The F keys are not there just so you can skip tracks in your MP3 player• Keep your config in git so you can revert it when you screw it up
  • Ever done this?
  • Ever done this?$ vim my_awesome_script.pl
  • Ever done this?$ vim my_awesome_script.pl# hack hack hack; !wq
  • Ever done this?$ vim my_awesome_script.pl# hack hack hack; !wq$ ./my_awesome_script.pl
  • Ever done this?$ vim my_awesome_script.pl# hack hack hack; !wq$ ./my_awesome_script.plbash: ./awesome_script.pl: permission denied
  • This is fixable: auto chmod +xautocmd BufWritePost *.pl !chmod +x %(add-hook after-save-hookexecutable-make-buffer-file-executable-if-script-p)
  • Commit messages
  • Commit messages• Set up $GIT_EDITOR so you can write commit messages in your editor of choice
  • Commit messages• Set up $GIT_EDITOR so you can write commit messages in your editor of choice• emacsclient is particularly nice here:
  • Commit messages• Set up $GIT_EDITOR so you can write commit messages in your editor of choice• emacsclient is particularly nice here: export GIT_EDITOR=‘emacsclient -t’
  • Code Tidying
  • Code Tidying• Same idea as “make executable on save”
  • Code Tidying• Same idea as “make executable on save”• When you save a file, before the write, run perltidy, and save the output of that instead
  • Code Tidying• Same idea as “make executable on save”• When you save a file, before the write, run perltidy, and save the output of that instead• If you don’t want to do that, do the world a favor and set up your editor to delete trailing whitespace when you save a file.
  • Code Tidying• Same idea as “make executable on save”• When you save a file, before the write, run perltidy, and save the output of that instead• If you don’t want to do that, do the world a favor and set up your editor to delete trailing whitespace when you save a file.• Please.
  • Syntax Checking
  • Syntax Checking• Beating the same one-trick pony
  • Syntax Checking• Beating the same one-trick pony• Run ‘perl -c’ after you save
  • Syntax Checking• Beating the same one-trick pony• Run ‘perl -c’ after you save• Gripe if there are errors
  • Even Better:Syntax Checking
  • Even Better:Syntax Checking On The Fly!
  • Ill-advised live demo!
  • Even Betterest:Syntax Checking On The Fly
  • Even Betterest: Syntax Checking& Static Analysis On The Fly
  • Even more ill-advisedlive demoing!
  • Code Browsing
  • Code Browsing• Emacs calls this find-file-at-point
  • Code Browsing• Emacs calls this find-file-at-point• ffap!
  • Code Browsing• Emacs calls this find-file-at-point• ffap!• With add-ons (such as PerlySense) one can get quite fancy
  • Documentation Browsing• Same idea here, really
  • Auto-Completion
  • Auto-CompletionWhile it isn’t possible to do this perfectly,you can get closer than you might think...
  • Auto-CompletionWhile it isn’t possible to do this perfectly,you can get closer than you might think......but it might not be worth the effort
  • Share & Enjoy• My editor config: https://github.com/genehack/emacs
  • Thanks!Questions?
  • First EverDC-Baltimore Perl Workshop 14 April 2012 dcbpw.org