Skip to content

Commit

Permalink
Improve configuration and other minor issues
Browse files Browse the repository at this point in the history
- Rename 'g:Perl_Perl' into 'g:Perl_Executable'. The setting 'g:Perl_Perl'
  still works for backwards compatibility.
- Use 'g:Xterm_Options' instead of 'g:Perl_XtermDefaults'. The setting
  'g:Perl_XtermDefaults' still works for backwards compatibility.
- Improve perldoc integration.
- Minor changes.
- Documentation.

taken from WolfgangMehner/vim-plugins, revision
WolfgangMehner/vim-plugins@5bc11a2
  • Loading branch information
WolfgangMehner committed Jul 22, 2016
1 parent a7bab32 commit 397d029
Show file tree
Hide file tree
Showing 10 changed files with 491 additions and 460 deletions.
125 changes: 57 additions & 68 deletions README.md
Expand Up @@ -7,27 +7,9 @@ The development happens here:
[WolfgangMehner/vim-plugins](https://github.com/WolfgangMehner/vim-plugins)


Preview Version
================================================================================

___This is a preview version!___

This version is a preview, containing a reworked template engine.
Please report any problems.

The new features of Perl-Support and the template engine are:

- No need to edit stock templates anymore, by doing the personalization/
customization in separate files
- Setup wizard for customization and personalization file
- More to come ...

_Please read the release notes below._


--------------------------------------------------------------------------------

README for perl-support.vim (Version 5.4pre) / January 05 2016
README for perl-support.vim (Version 5.4) / March 13 2016
================================================================================

* INSTALLATION
Expand All @@ -45,7 +27,7 @@ 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.
This plug-in can be used with Vim version 7.x.


--------------------------------------------------------------------------------
Expand All @@ -56,22 +38,22 @@ INSTALLATION
A system-wide installation for all users can also be done. This will have
further effects on how the plug-in works. For a step-by-step instruction, as
well as an explanation of the other consequences, please see the help file
'doc/csupport.txt' or look up the documentation via:
`doc/perlsupport.txt` or look up the documentation via:

:help perlsupport-system-wide


(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).
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
(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
(1.1) Copy the zip archive `perl-support.zip` to `$HOME/.vim` and run

unzip perl-support.zip

Expand All @@ -81,19 +63,19 @@ structure which is needed below the local installation directory $HOME/.vim/
$HOME/.vim/doc/...
$HOME/.vim/plugin/perl-support.vim

(1.2) Loading of plugin files must be enabled. If not use
(1.2) Loading of plug-in 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.
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
(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 _runtimepath_/templates/personal.templates .
It will help you set up the file `_runtimepath_/templates/personal.templates`.
The file is read by all plug-ins supporting this feature to get your personal
details. Here is the minimal personalization (my settings as an example):

Expand All @@ -102,33 +84,33 @@ structure which is needed below the local installation directory $HOME/.vim/
SetMacro( 'EMAIL', 'wolfgang-mehner@web.de' )
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.
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)
(Read more about the template system in the plug-in documentation)

(1.4) Make the plugin help accessible by typing the following command on the
(1.4) Make the plug-in 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.
(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
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).
`$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'
(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
(2.1) Copy the zip archive `perl-support.zip` to `$HOME/vimfiles` and run

unzip perl-support.zip

Expand All @@ -138,19 +120,19 @@ $HOME/vimfiles/ (find the value of $HOME with ":echo $HOME" from inside Vim).
$HOME/vimfiles/doc/...
$HOME/vimfiles/plugin/perl-support.vim

(2.2) Loading of plugin files must be enabled. If not use
(2.2) Loading of plug-in 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.
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
(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 _runtimepath_/templates/personal.templates .
It will help you set up the file `_runtimepath_/templates/personal.templates`.
The file is read by all plug-ins supporting this feature to get your personal
details. Here is the minimal personalization (my settings as an example):

Expand All @@ -159,20 +141,24 @@ $HOME/vimfiles/ (find the value of $HOME with ":echo $HOME" from inside Vim).
SetMacro( 'EMAIL', 'wolfgang-mehner@web.de' )
SetMacro( 'COPYRIGHT', 'Copyright (c) |YEAR|, |AUTHOR|' )

Use the file $HOME/vimfiles/templates/perl.templates to customize or add to
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)
(Read more about the template system in the plug-in documentation)

(2.4) Make the plugin help accessible by typing the following command on the
(2.4) Make the plug-in 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.
(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.

(2.6) Make sure the shell is set up correctly. The options 'shell',
'shellcmdflag', 'shellquote', and 'shellxquote' must be set consistently.
Compare `:help perlsupport-troubleshooting`.


(3) ADDITIONAL REMARKS
Expand All @@ -186,9 +172,9 @@ There are a lot of features and options which can be used and influenced:
* the Perl module list
* reading Perl documentation with integrated calls to perldoc
* removing the root menu
* using additional plugins
* using additional plug-ins

Look at the perlsupport help with:
Look at the Perl Support help with:

:help perlsupport

Expand All @@ -200,27 +186,30 @@ Look at the perlsupport help with:
+-----------------------------------------------+

Any problems? See the TROUBLESHOOTING section at the end of the help file
'doc/perlsupport.txt'.
`doc/perlsupport.txt`.


--------------------------------------------------------------------------------

RELEASE NOTES
================================================================================

RELEASE NOTES FOR VERSION 5.4pre
RELEASE NOTES FOR VERSION 5.4
----------------------------------------------------------------------
- Add 'g:Perl_CustomTemplateFile'.
- Add template personalization file and setup wizard.
- Rename setting 'g:Perl_Perl' into 'g:Perl_Executable'.
('g:Perl_Perl' still works for backwards compatibility.)
- Respect 'g:Xterm_Executable' and 'g:Xterm_Options'.
('g:Perl_XtermDefaults' still works for backwards compatibility.)
- Remove unused 'g:Perl_GuiTemplateBrowser' and 'g:Perl_MenuHeader'.
- New and reworked templates.
- Change map "\vs" -> "\vps", in favor of a more consistent naming scheme.
- Minor changes.


RELEASE NOTES FOR OLDER VERSIONS
----------------------------------------------------------------------
-> see file 'perl-support/doc/ChangeLog'
-> see file `perl-support/doc/ChangeLog`


--------------------------------------------------------------------------------
Expand Down Expand Up @@ -327,25 +316,25 @@ ___The settings are explained in the files themselves.___
ADDITIONAL TIPS
================================================================================

(1) You may want to use a central hidden directory for all your backup files (see also
rc/customization.vimrc ):
(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 ):
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.2 Create `$HOME/.vim.backupdir`.

1.3 Add the following line to your shell initialization file ~/.profile :
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 !
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).
(see mapping in file `customization.gvimrc`).

(3) gVim. Use tear off menus.

Expand Down
2 changes: 1 addition & 1 deletion autoload/mmtemplates/config.vim
Expand Up @@ -42,7 +42,7 @@ if &cp || ( exists('g:TemplatesConfig_Version') && g:TemplatesConfig_Version !=
finish
endif

let s:TemplatesConfig_Version = '1.0beta' " version number of this script; do not change
let s:TemplatesConfig_Version = '1.0' " version number of this script; do not change

"-------------------------------------------------------------------------------
" --- Find Newest Version --- {{{2
Expand Down
39 changes: 35 additions & 4 deletions autoload/mmtemplates/core.vim
Expand Up @@ -42,7 +42,7 @@ if &cp || ( exists('g:Templates_Version') && g:Templates_Version != 'searching'
finish
endif
"
let s:Templates_Version = '1.0beta' " version number of this script; do not change
let s:Templates_Version = '1.0' " version number of this script; do not change
"
"----------------------------------------------------------------------
" --- Find Newest Version --- {{{2
Expand Down Expand Up @@ -1385,6 +1385,7 @@ let s:FileReadNameSpace_0_9 = {
\ 'SetMap' : 'ss',
\ 'SetShortcut' : 'ss',
\ 'SetMenuEntry' : 'ss',
\ 'SetExpansion' : 'sss\?',
\
\ 'MenuShortcut' : 'ss',
\ }
Expand Down Expand Up @@ -1605,6 +1606,34 @@ function! s:SetMenuEntry ( name, menu_entry )
"
endfunction " ---------- end of function s:SetMenuEntry ----------
"
"----------------------------------------------------------------------
" s:SetExpansion : Set the expansion of a list menu (template function). {{{2
"-------------------------------------------------------------------------------

function! s:SetExpansion ( name, expand_left, ... )

let expand_left = a:expand_left
if a:0 >= 1 | let expand_right = a:1
else | let expand_right = ''
endif

" check for valid name and format
if ! has_key ( s:library.templates, a:name.'!!type' )
return s:ErrorMsg ( 'The template does not exist: '.a:name )
endif

let templ_menu = s:library.templates[ a:name.'!!menu' ]

if templ_menu.entry != 2
let templ_menu.entry = 2
let templ_menu.expand_list = ''
endif

let templ_menu.expand_left = expand_left
let templ_menu.expand_right = expand_right

endfunction " ---------- end of function s:SetExpansion ----------

"----------------------------------------------------------------------
" s:IncludeFile : Read a template file (template function). {{{2
"----------------------------------------------------------------------
Expand Down Expand Up @@ -1912,7 +1941,9 @@ function! s:IncludeFile ( templatefile, ... )
call remove ( s:t_runtime.state_stack, -1 )
"
endfunction " ---------- end of function s:IncludeFile ----------
"
" }}}2
"----------------------------------------------------------------------

"----------------------------------------------------------------------
" mmtemplates#core#ReadTemplates : Read a template file. {{{1
"----------------------------------------------------------------------
Expand Down Expand Up @@ -4991,8 +5022,8 @@ function! mmtemplates#core#EditTemplateFiles ( library, file )
" ==================================================
"
if ! available
" :TODO:18.12.2014 20:01:WM: start setup wizard
return
return s:ErrorMsg ( 'This template file is not avaiable. Use the wizard to set it up',
\ 'or follow the instructions of your plug-in for setting up this file.' )
endif
"
" ==================================================
Expand Down

0 comments on commit 397d029

Please sign in to comment.