README for perl-support.vim (Version 5.4pre) / March 08 2015
- INSTALLATION
- RELEASE NOTES
- FILES
- ADDITIONAL TIPS
- CREDITS
Perl Support implements a Perl-IDE for Vim/gVim. It has been written to considerably speed up writing code in a consistent style. This is done by inserting complete statements, comments, idioms, code snippets, templates, and POD documentation. Reading perldoc is integrated. Syntax checking, running a script, running perltidy, running perlcritics, starting a debugger and a profiler can be done with a keystroke. There are many additional hints and options which can improve speed and comfort when writing Perl. Please read the documentation. This plugin can be used with Vim version 7.x . Most features should work with Vim version 6.x.
INSTALLATION
(1) LINUX
The subdirectories in the zip archive perl-support.zip mirror the directory structure which is needed below the local installation directory $HOME/.vim/ (find the value of $HOME with ":echo $HOME" from inside Vim).
(1.0) Save the template files in '$HOME/.vim/perl-support/templates/Templates' if you have changed any of them.
(1.1) Copy the zip archive perl-support.zip to $HOME/.vim and run
unzip perl-support.zip
Afterwards, these files should exist:
$HOME/.vim/autoload/mmtemplates/...
$HOME/.vim/doc/...
$HOME/.vim/plugin/perl-support.vim
(1.2) Loading of plugin files must be enabled. If not use
:filetype plugin on
This is the minimal content of the file '$HOME/.vimrc'. Create one if there is none or use the files in $HOME/.vim/perl-support/rc as a starting point.
(1.3) Set at least some personal details. Use the map \ntw inside a Perl buffer or the menu entry:
Perl -> Snippets -> template setup wizard
It will help you set up the file
SetMacro( 'AUTHOR', 'Dr. Fritz Mehner' )
SetMacro( 'AUTHORREF', 'fgm' )
SetMacro( 'EMAIL', 'mehner.fritz@fh-swf.de' )
SetMacro( 'ORGANIZATION','FH Südwestfalen, Iserlohn' )
SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' )
Use the file $HOME/.vim/templates/perl.templates to customize or add to your Perl template library. It can also be set up via the wizard.
(Read more about the template system in the plugin documentation)
(1.4) Make the plugin help accessible by typing the following command on the Vim command line:
:helptags $HOME/.vim/doc/
(1.5) Consider additional settings in the file '$HOME/.vimrc'. The files customization.vimrc and customization.gvimrc are replacements or extensions for your .vimrc and .gvimrc. You may want to use parts of them. The files are documented.
(2) WINDOWS
The subdirectories in the zip archive perl-support.zip mirror the directory structure which is needed below the local installation directory $HOME/vimfiles/ (find the value of $HOME with ":echo $HOME" from inside Vim).
(2.0) Save the template files in '$HOME/vimfiles/perl-support/templates/Templates' if you have changed any of them.
(2.1) Copy the zip archive perl-support.zip to $HOME/vimfiles and run
unzip perl-support.zip
Afterwards, these files should exist:
$HOME/vimfiles/autoload/mmtemplates/...
$HOME/vimfiles/doc/...
$HOME/vimfiles/plugin/perl-support.vim
(2.2) Loading of plugin files must be enabled. If not use
:filetype plugin on
This is the minimal content of the file '$HOME/_vimrc'. Create one if there is none or use the files in $HOME/vimfiles/perl-support/rc as a starting point.
(2.3) Set at least some personal details. Use the map \ntw inside a Perl buffer or the menu entry:
Perl -> Snippets -> template setup wizard
It will help you set up the file
SetMacro( 'AUTHOR', 'Dr. Fritz Mehner' )
SetMacro( 'AUTHORREF', 'fgm' )
SetMacro( 'EMAIL', 'mehner.fritz@fh-swf.de' )
SetMacro( 'ORGANIZATION','FH Südwestfalen, Iserlohn' )
SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' )
Use the file $HOME/vimfiles/templates/perl.templates to customize or add to your Perl template library. It can also be set up via the wizard.
(Read more about the template system in the plugin documentation)
(2.4) Make the plugin help accessible by typing the following command on the Vim command line:
:helptags $HOME\vimfiles\doc\
(2.5) Consider additional settings in the file '$HOME/_vimrc'. The files customization.vimrc and customization.gvimrc are replacements or extensions for your _vimrc and _gvimrc. You may want to use parts of them. The files are documented.
(3) ADDITIONAL REMARKS
There are a lot of features and options which can be used and influenced:
- use of template files and tags
- using and managing personal code snippets
- Perl dictionary for keyword completion
- the Perl module list
- reading Perl documentation with integrated calls to perldoc
- removing the root menu
- using additional plugins
Look at the perlsupport help with
:help perlsupport
+-----------------------------------------------+
| +-------------------------------------------+ |
| | ** PLEASE READ THE DOCUMENTATION ** | |
| | Actions differ for different modes! | |
| +-------------------------------------------+ |
+-----------------------------------------------+
Any problems ? See the TROUBLESHOOTING section at the end of the help file 'doc/perlsupport.txt'.
For a system-wide installation please see the help file 'doc/perlsupport.txt'.
RELEASE NOTES
RELEASE NOTES FOR VERSION 5.4pre
- Added 'g:Perl_CustomTemplateFile' and 'g:Perl_AdditionalTemplates'.
- Added template personalization file and setup wizard.
- Removed unused 'g:Perl_GuiTemplateBrowser'.
- New and reworked templates.
- Changed map "\vs" -> "\vps", in favor of a more consistent naming scheme.
- Minor changes.
RELEASE NOTES FOR OLDER VERSIONS
-> see file 'perl-support/doc/ChangeLog'
FILES
README.md
This file.
autoload/perlsupportprofiling.vim
Profiler support.
autoload/perlsupportregex.vim
Regex analyser code.
autoload/mmtemplates/*
The template system.
autoload/mmtoolbox/*
The toolbox (make, ...).
doc/perlsupport.txt
The help file for perl support.
doc/templatesupport.txt
The help file for the template system.
doc/toolbox*.txt
The help files for the toolbox.
ftplugin/make.vim
Access hotkeys for make(1) in makefiles.
ftplugin/perl.vim
A filetype plugin. Define hotkeys, create a local
dictionary for each Perl file.
ftplugin/pod.vim
A filetype plugin. Define hotkeys for filetype 'pod'.
ftplugin/qf.vim
A filetype plugin used by the profilers.
plugin/perl-support.vim
The Perl plugin for Vim/gVim.
perl-support/codesnippets/*
Some Perl code snippets as a starting point.
perl-support/modules/
Directory for the list of installed Perl modules.
perl-support/scripts/*
Several helper scripts.
perl-support/templates/Templates
Perl main template file.
perl-support/templates/*.templates
Several dependent template files.
perl-support/wordlists/perl.list
A file used as dictionary for automatic word completion.
This file is referenced in the file customization.vimrc.
syntax/template.vim
Template syntax file.
The following files and extensions are for convenience only. perl-support.vim will work without them:
perl-support/rc/customization.ctags
Additional settings I use in .ctags to enable navigation
through POD with the plugin taglist.vim.
perl-support/rc/customization.gvimrc
Additional settings I use in .gvimrc:
hot keys, mouse settings, ...
The file is commented. Append it to your .gvimrc if you
like.
perl-support/rc/customization.perltidyrc
Additional settings I use in .perltidyrc to customize
perltidy.
perl-support/rc/customization.smallprof
Additional settings I use to control the profiler
Devel::SmallProf
perl-support/rc/customization.vimrc
Additional settings I use in .vimrc:
incremental search, tabstop, hot keys,
font, use of dictionaries, ...
The file is commented. Append it to your .vimrc if you
like.
perl-support/rc/*.templates
Sample template files for customization. Used by the
template setup wizard.
perl-support/doc/perl-hot-keys.pdf
Reference card for the key mappings. The mappings can
also be used with the non-GUI Vim, where the menus are
not available.
perl-support/doc/pmdesc3.text
The man page for pmdesc3.
perl-support/doc/ChangeLog
The change log.
ADDITIONAL TIPS
(1) You may want to use a central hidden directory for all your backup files (see also rc/customization.vimrc ):
1.1 Add the following line to .vimrc (see also rc/customization.vimrc ):
set backupdir =$HOME/.vim.backupdir
1.2 Create $HOME/.vim.backupdir .
1.3 Add the following line to your shell initialization file ~/.profile :
find $HOME/.vim.backupdir/ -name "*" -type f -mtime +60 -exec rm -f {} \;
When you are logging in all files in the backup directory older then 60 days (-mtime +60) will be removed (60 days is a suggestion, of course). Be shure to backup in shorter terms !
(2) gVim. Toggle 'insert mode' <--> 'normal mode' with the right mouse button (see mapping in file customization.gvimrc).
(3) gVim. Use tear off menus.
(4) Try 'Focus under mouse' as window behavior (No mouse click when the mouse pointer is back from the menu entry).
(5) Use Emulate3Buttons "on" (X11) even for a 3-button mouse. Pressing left and right button simultaneously without moving your fingers is faster than moving a finger to the middle button (which is often a wheel).
CREDITS
Wolfgang Mehner (wolfgang-mehner AT web.de) for the implementation of the powerful template system templatesupport.
David Fishburn (fishburn AT ianywhere.com) for the implementation of the single root menu and several suggestions for improving the customization and the documentation.
Ryan Hennig (hennig AT amazon.com) improved the install script.
Aristotle, http://qs321.pair.com/~monkads/ is the author of the script pmdesc2 which is the base of the included script pmdesc3.
David Fishburn contributed changes for the Windows platform and suggested to not let snippets and templates enter the list of alternate files.
The two files pod-template-application.pl and pod-template-module.pl are taken from Damian Conway's book "Perl Best Practices".