• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Vimperl
 

Vimperl

on

  • 156 views

My talk at telaviv.pm meetup on May 28

My talk at telaviv.pm meetup on May 28

Statistics

Views

Total Views
156
Views on SlideShare
156
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Vimperl Vimperl Presentation Transcript

    • Effective Text Editing for Perl Developers Ynon Perek ynon@ynonperek.com
    • Agenda What’s Wrong with my editor? Can you fix it? Should I Switch Editors?
    • ! text editors slow you down Keynote Template
    • Reasons to be angry • A text editor always slows you down • Some are worse than others
    • type less, Keynote Template more"
    • Some annoyances with “naive” text editors • Writing code • Navigating in code • Testing code • Running code
    • 1 while(<>) {! 2 ! 3 }! 4 ! 5 sub doStuff {! 6 ! 7 }! 8 ! 9 for ( my $i=0; $i < 10; $i++ ) {! 10 ! 11 } Code is written in sentences, 
 not characters
    • Code uses boilerplates 1 package BlogPost;! 2 use Moose;! 3 use v5.18;! 4 ! 5 ! 6 1; 1 <!DOCTYPE html>! 2 <html>! 3 <head>! 4 <meta charset="utf-8" />! 5 <title>test</title>! 6 </head>! 7 <body>! 8 ! 9 </body>! 10 </html>
    • Code has context 1 use strict;! 2 use warnings;! 3 use List::MoreUtils qw/pairwise/;! 4 use v5.18;! 5 ! 6 my @foo, @bar;! 7 my %h = pairwise(@foo, @bar); you’ll probably want @foo or @bar here
    • Code can be repetitive 1 my $mail = {! 2 john => 'john@gmail.com',! 3 bob => 'bob@walla.co.il',! 4 barbara => 'bar@gmail.com',! 5 george => 'g@george.com',! 6 };! 7 ! 1 my $mail = {! 2 john => 'john@gmail.com',! 3 bob => 'bob@walla.co.il',! 4 barbara => 'bar@gmail.com',! 5 george => 'g@george.com',! 6 };! 7 !
    • The more you type… • you’ll waste more time • you’ll make more mistakes • you’ll be less happy
    • A text editor can be a friend • In writing: • Code snippets • File templates • Context aware auto complete • Verify syntax and find errors early
    • A text editor can be a friend • While working on a project: • File navigation • Documentation • Quickly find what you need
    • A text editor can be a friend • While running and testing: • Reminds you to run unit tests • Helps you run complex flows
    • Agenda What’s Wrong with my editor? Can you fix it? Should I Switch Editors?
    • Fixing a text editor • File templates • Code snippets • Omni complete • Easy project navigation + documentation • Running + testing
    • We’ll use … #janus A fully customisable text editor A collection of plugins and settings for vim to get started +
    • Getting Started (Ubuntu) sudo apt-get install vim-gnome Install vim curl -Lo- https://bit.ly/janus-bootstrap | bash Install janus
    • What We Got • Line and column numbers • Nicer colours and better defaults
    • What We Got • Find in files - ack • Fuzzy file finder • Easy code comments • Project drawer • Tab completion • Basic snippets
    • Now let’s get to work
    • Demos - Editing • Adding new snippets with snipMate • File templates with vim-template • Align perl hashes • Perl omni-complete • Auto-close parens
    • Plugins Installed • Viewdoc:
 http://www.vim.org/scripts/script.php? script_id=3893 • Vim template:
 https://github.com/aperezdc/vim-template/ • Auto pairs:
 https://github.com/ynonp/auto-pairs
    • Q & A
    • Thanks For Listening • Ynon Perek • http://ynonperek.com/ • ynon@ynonperek.com