vim-perl 插件有哪些功能而 "syntax on" 没有?

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

我正在尝试将 vim 设置为 Perl 的 IDE。我使用的是通用的、基于文本的 vim,而不是 gvim。

我根据其他人的建议使用 vim 插件管理器在 https://github.com/vim-perl/vim-perl 安装了 "vim-perl" 插件。至少我认为它已安装,但我没有注意到文件的处理方式有任何差异。

首先我用 Debian 的包管理器安装了 vim-addon-manager。然后我将以下代码放入我的 .vimrc 文件并重新加载它:

" 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': '.*'})

那么 vim-perl 插件应该为我做什么呢?我在任何地方都找不到任何好的文档。

至少 vim-perl 的一部分包含在 Vim 的出厂默认配置中; cp。 $VIMRUNTIME/ftplugin/perl.vim$VIMRUNTIME/syntax/perl.vim。通过安装(并定期升级)插件,您将获得:

  • 较新版本的脚本,具有潜在的增强功能和错误修复
  • 一些附加功能(f.e。Vim 本身还没有 syntax/mason.vim

如果您经常编辑重要的 Perl 脚本,或使用最新的语言功能,安装 vim-perl 值得考虑。如果你只是一个临时程序员,我会等到真正需要的时候。