StevieD
StevieD

Reputation: 7443

What does vim-perl plugin do that "syntax on" doesn't?

I'm trying to get vim set up as an IDE for Perl. I'm using generic, text-based vim, not gvim.

I installed the "vim-perl" addon at https://github.com/vim-perl/vim-perl using the vim addon manager per the suggestion of someone else. At least I think it's installed but I don't notice any difference in how the file is processed.

First I installed the vim-addon-manager with Debian's package manager. Then I put the following code in my .vimrc file and reloaded it:

" put this line first in ~/.vimrc
set nocompatible | filetype indent plugin on | syn on

fun! SetupVAM()
  let c = get(g:, 'vim_addon_manager', {}) 
  let g:vim_addon_manager = c 
  let c.plugin_root_dir = expand('$HOME', 1) . '/.vim/vim-addons'

  " Force your ~/.vim/after directory to be last in &rtp always:
  " let g:vim_addon_manager.rtp_list_hook = 'vam#ForceUsersAfterDirectoriesToBeLast'

  " most used options you may want to use:
  " let c.log_to_buf = 1
  " let c.auto_install = 0
 let &rtp.=(empty(&rtp)?'':',').c.plugin_root_dir.'/vim-addon-manager'
  if !isdirectory(c.plugin_root_dir.'/vim-addon-manager/autoload')
    execute '!git clone --depth=1 git://github.com/MarcWeber/vim-addon-manager '
        \       shellescape(c.plugin_root_dir.'/vim-addon-manager', 1)
  endif

  " This provides the VAMActivate command, you could be passing plugin names, too
  call vam#ActivateAddons([], {}) 
endfun
all SetupVAM()

" ACTIVATING PLUGINS

" OPTION 1, use VAMActivate
VAMActivate github:vim-perl/vim-perl 

" OPTION 2: use call vam#ActivateAddons
"call vam#ActivateAddons([vim-perl], {})
 use <c-x><c-p> to complete plugin names

" OPTION 3: Create a file ~/.vim-srcipts putting a PLUGIN_NAME into each line
" See lazy loading plugins section in README.md for details
" call vam#Scripts('~/.vim-scripts', {'tag_regex': '.*'})

So what exactly is the vim-perl addon supposed to do for me? I can't find any good documenation anywhere.

Upvotes: 0

Views: 438

Answers (1)

Ingo Karkat
Ingo Karkat

Reputation: 172768

At least parts of vim-perl are incorporated in the factory-default configuration of Vim; cp. $VIMRUNTIME/ftplugin/perl.vim and $VIMRUNTIME/syntax/perl.vim. By installing (and regularly upgrading) the plugin, you'll get:

  • a newer version of the scripts, with potential enhancements and bug fixes
  • some additional functionality (f.e. there's a syntax/mason.vim that's not yet in Vim itself)

If you regularly edit non-trivial Perl scripts, or use latest language features, installing vim-perl is worth contemplating. If you're just a casual programmer, I would wait until a real need arises.

Upvotes: 1

Related Questions