Perl Support Vim Plug-In | |||||||||
|
|
|
root menu |
Perl Support - Vim Plug-In( version 5.4 )View the ReadmeRead the Perl Support Help File The key mappings of this plugin (PDF) What's new? Lua and Perl Incorporated in SpaceVim Jan 2017 New Plug-in Versions Released Jul/Aug 2016 Covered in the 01/2016 issue of Linux-Magazin, Plugin featured in the Hacker Public Radio episode Useful Vim Plugins Plugin presented at the 11. Deutscher Perl-Workshop in Frankfurt, 2009 Plugin featured in the The Geek Stuff article |
|
Features |
---|
Speed-up the development of Perl Scripts:
|
Menus | Explanation | ||
---|---|---|---|
Menu Comments : insert commentsA lot of the menu entries are defined in a so-called template library. The library defines the menu entries, maps and the inserted text. The personal information can also be configured there. A file header can be inserted into each new file: #!/usr/bin/env perl #=============================================================================== # # FILE: somescript.pl # # USAGE: ./somescript.pl # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: Wolfgang Mehner (WM), <thisguy@doggymail.de> # ORGANIZATION: # VERSION: 1.0 # CREATED: 12.03.2016 12:06 # REVISION: --- #=============================================================================== use strict; use warnings; use utf8; This prolog is generated from the template shown below. This template file can easily be changed by the user.
Tags (like == Comments.file description pl == map:chpl, sc:d, start, noindent == #!|PERL_INTERPRETER| #=============================================================================== # # FILE: |FILENAME| # # USAGE: ./|FILENAME| # # DESCRIPTION: <CURSOR> # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: |AUTHOR| (|AUTHORREF|), |EMAIL| # ORGANIZATION: |ORGANIZATION| # VERSION: 1.0 # CREATED: |DATE| |TIME| # REVISION: --- #=============================================================================== use strict; use warnings; use utf8; == ENDTEMPLATE == The entry keyword comments ➞ todo generates a special end-of-line comment. These comments are easily locatable by their keywords (e.g. :TODO:). Date and author reference name are inserted by the editor.
# :TODO:29.02.2015 12:34:WM:
These comments are not for the final version of a script, of course. |
|||
Menu Statements : insert statementsInsert statements with jump tags for convenient editing, using the entry if, else or via the map \sie: if ( | ) { <-IF_PART-> } else { <-ELSE_PART-> } The cursor is positioned after the "if". Use CTRL+J to jump to the tags and start editing. A lot of menu entires have a special behavior in visual mode. Select some lines in visual mode ...
print "This is $i\n";
then use the entry foreach. The text is inserted around the selected lines and they are indented: foreach my $| ( ) { print "This is $i\n"; } |
|||
Menu Idioms : insert frequently used statementsInsert an empty subroutine using subroutine. You will be asks for the name of the subroutine and the following lines will be inserted: sub brain_function { my ( $par1 ) = @_; return ; } ## --- end sub brain_function |
|||
|
|||
Regular expression testerIf you have a Vim binary with Perl interface compiled in you can
test regular expressions very easily. Multi-line regular expressions are allowed.
They work properly if the flag Match several regular expressions with several targets. Multi-line strings are also allowed. List all matches using the modifier Test a regular expression with embedded code. Multi-line strings are also allowed. See :help perlsupport-regex-match for more options and features. |
|||
Menu Snippets : insert code snippets and manage templatesThe plug-in comes with a facility to extract, manage and insert often used code snippets. Visually select a few lines and use the menu entry write code snippet to write these lines into a file. The code snippet can then be edited and inserted again using read code snippet. (See :help perlsupport-snippets-menu) The templates which define the behavior of most of the menu entries are also manage here. Use templates setup wizard to create a personalization file with your personal details for the comments. The templates support different coding styles. Use the entry choose style to switch between them. |
|||
Menu Profiling : run a profilerThree profilers can be run from within the Vim session. The reports will be shown in the quickfix buffer: |
|||
Menu Run : run the script, check the syntax, start debuggerRun the script or check the syntax. In case of errors an error window will be opened to show the current list of errors: The Perl documentation can be read for the word under the cursor by typing Navigate through PODs with an addition to the taglist-plugin (based on Exuberant Ctags) : Optional: Run perlcritic for the current buffer (search for 'Perl::Critic' or 'perlcritic' on CPAN to get the latest version) : |
|||
Menu Help : call helpHelp is quickly accessible through the Help menu. Place the cursor on the name of a module, function, or FAQ keyword ... open my $pin, "ls -l |"; then use the entry or the map \h and the help will be displayed in a Vim buffer. The same works for any word in the English language. Placing the cursor on a word and hitting \he opens a dictionary for the word. |
|||
Toolbox Make : make integrationRun make in the current directory, passing cmd.-line arguments: :Make -j3 In larger projects a specific makefile can be chosen: :MakeFile ../Makefile ... and run from anywhere: :Make doc The tool will change the directory and execute the previously chosen makefile, independently of the current working directory. |
Page updated: October 23 2018 / Mail to: Wolfgang Mehner