# This is a sample Vroom input file. It should help you get started. # # Edit this file with your content. Then run `vroom --vroom` to start # the show! # # See `perldoc Vroom::Vroom` for complete details. # ---- config # Basic config options. title: Vroom! indent: 0 height: 18 width: 69 skip: 0 # The following options are for Gvim usage. # vim: gvim # fuopt: maxhorz,maxvert # guioptions: egmLtT # guicursor: a:blinkon0-ver25-Cursor # guifont: Bitstream_Vera_Sans_Mono:h18 ---- center Perl and Vim tips by Andrew Grangaard and Tommy Stanton ---- == TOPICS * Vroom * make/quickfix support * perltidy integration * perltidy rc * ctags * keyword/omnicompletion ---- == VROOM * Edit slides in Vi present in Vim! * cpan Vroom::Vroom * http://search.cpan.org/dist/Vroom/ * mix slides with syntax highlighted vim documents ---- == Simple Vroom * make a new directory for your slides * vroom -new or just vim slides.vroom * vim slides.vroom to edit slides. ** Fake YAML format. ---- for page separator ** Can add syntax highlighted chunks and external files * Run 'vroom --vroom' to start presentation mode * VoilĂ ! ---- == VROOM navigation/presentation commands * Hit to move forward. * Hit to go backwards. * Hit 'Q' to quit. * Hit 'RR' to execute the current page as program and show STDOUT. * Hit 'QQ' to quit. * Hit 'EE' to edit a file whose name is under the cursor. * Hit 'VV' to launch Vroom on the current buffer. + == Caveats * need to have 'set exrc' enabled in base .vimrc to get the bindings * the bindings are active while editing slides.vroom ---- perl,i4 # Note: lifted directly from the docs # This is some Perl code. # Notice the syntax highlighting. # Run it with the vim command. for my $word (qw(Vroom totally rocks!)) { print "$word\n"; } ---- i-4 == Quickfix / make support from :help make | The ":make" command executes the command given with the 'makeprg' option. | This is done by passing the command to the shell given with the 'shell' | option. This works almost like typing | | ":!{makeprg} [arguments] {shellpipe} {errorfile}". "Settings from my .vimrc: autocmd FileType perl set makeprg=perl\ $VIMRUNTIME/tools/efm_perl.pl\ -c\ %\ $* autocmd FileType perl set errorformat=%f:%l:%m autocmd FileType perl set autowrite Vim comes with efm_perl.pl to parse the output of perl -c error reporting and convert to the format vim expects (from the Amiga days). It is not +x, so I execute it via explicit perl efm_perl.pl. ---- == Navigating the Quickfix list :cc[!] [nr] Display error [nr], or current error if [nr] is omitted :cn next error :cN previous error :cl show quickfix list :cw show quickfix list in new frame. :cnf jump to the next file in the list that includes a file name. :.cc in quicklist frame, jump to current line error in primary editor window (return does the same thing) +*Older error lists :col[der] Go to a previous (older) error list. :cnew[er] Go to a newer error list ---- perl,i4 #!/usr/bin/perl # Example with errors use strict; use warnings; $foo = 3; my $bar = 5; my $baz = $zoom . "zoom"; ---- == Quickfix vim help :help quickfix :help make :help makeprg ---- == Perltidy integration * cpan Perl::Tidy * create .perltidyrc * add binding to .vimrc .vimrc: vnoremap ,t :!perltidy -q set equalprg=perltidy ---- ---- include ../perltidyrc ---- ---- include ../code_samples/perltidy-example.pl ---- == Ctags * exuberant ctags ( http://ctags.sf.net/ ) * manual tag file: function ctagit () { ctags -f tags --recurse --totals \ --exclude=blib --exclude=.svn \ --exclue=.git --exclude='*~' \ --languages=Perl --langmap=Perl:+.t } ---- == Ctags Usage: vim -t subroutine_name :tag subroutine_name ctrl-] jump to definition of subroutine under cursor. All will jump to appropriate file. ctrl-t or :pop to jump back (or just use ctrl-i and ctrl-o to jump between recent input points) Configure tag file for project: :set tags=tags\ /path/to/tags/for/project.tags ---- == Omnicompletion :help new-omni-completion http://www.perlmonks.org/?node_id=621766 http://www.vim.org/scripts/script.php?script_id=1924 + omniperl.zip version v1.1, 2007-06-17 | Note : This script is a bit buggy and wrong in the details. | It needs a more theoretical sound basis, rework or maybe a | different approach. ctrl-x ctrl-o in insert mode to use omnicompletion. (Have to get omnicompletion enabled first) SuperTab simplifies ctrl-x ctrl-o down to just http://www.vim.org/scripts/script.php?script_id=1643 :help ins-completion ----perl my $now = DateTime->now; $now-> ---- == Tommy Time (II) * people.pl * people.json ---- perl ---- include ../code_samples/people.pl ---- json ---- include ../code_samples/people.json