Loading ...
Sorry, an error occurred while loading the content.

Re: Syntax Highlighting: Vim 7, perl not working

Expand Messages
  • Chisum Lindauer
    ... First make sure your filetype is set right. I think for perl you can ... or ... If that doesn t work for you take a look at this site:
    Message 1 of 3 , May 31, 2006
    • 0 Attachment
      Gregory Margo wrote:

      >On Tue, May 30, 2006 at 07:21:47PM -0400, Jack Donohue wrote:
      >
      >
      >>Just started using vim7, quite happy so far. Major problem is that syntax
      >>highlighting doesn't work for *.pl files.
      >>
      >>I see filetype=conf rather than perl, which I don't understand.
      >>
      >>Here are the scripts loaded:
      >>
      >> 1: c:/vim/_vimrc
      >> 2: c:/vim/vimfiles/plugin/SpellChecker.vim
      >> 3: c:/vim/vimfiles/plugin/ccase.vim
      >> 4: c:/vim/vimfiles/plugin/closetag.vim
      >> 5: c:/vim/vimfiles/plugin/matchit.vim
      >> 6: c:/vim/vimfiles/plugin/mru.vim
      >> 7: c:/vim/_vim_mru_list
      >> 8: c:/vim/vimfiles/plugin/taglist.vim
      >> 9: c:/vim/vimfiles/plugin/TagsMenu.vim
      >>10: c:/vim/vim70/plugin/getscript.vim
      >>11: c:/vim/vim70/plugin/gzip.vim
      >>12: c:/vim/vim70/plugin/matchparen.vim
      >>13: c:/vim/vim70/plugin/netrwPlugin.vim
      >>14: c:/vim/vim70/plugin/rrhelper.vim
      >>15: c:/vim/vim70/plugin/spellfile.vim
      >>16: c:/vim/vim70/plugin/tarPlugin.vim
      >>17: c:/vim/vim70/plugin/tohtml.vim
      >>18: c:/vim/vim70/plugin/vimballPlugin.vim
      >>19: c:/vim/vim70/plugin/zipPlugin.vim
      >>20: c:/vim/vim70/menu.vim
      >>21: c:/vim/vim70/autoload/paste.vim
      >>22: c:/vim/_gvimrc
      >>23: c:/vim/abbreviations.vim
      >>24: c:/vim/vim70/syntax/syntax.vim
      >>25: c:/vim/vim70/syntax/synload.vim
      >>26: c:/vim/vim70/syntax/syncolor.vim
      >>27: c:/vim/vim70/filetype.vim
      >>28: c:/vim/vim70/ftplugin.vim
      >>29: c:/vim/vim70/indent.vim
      >>30: c:/vim/jmd.vim
      >>31: c:/vim/vim70/syntax/perl.vim
      >>32: c:/vim/vimfiles/ftplugin/perl_jmd.vim
      >>33: c:/vim/vim70/ftplugin/perl.vim
      >>34: c:/vim/vim70/indent/perl.vim
      >>35: c:/vim/vim70/scripts.vim
      >>36: c:/vim/vim70/syntax/conf.vim
      >>37: c:/vim/vim70/ftplugin/conf.vim
      >>38: c:/vim/vim70/autoload/netrw.vim
      >>39: c:/vim/vim70/syntax/netrw.vim
      >>40: c:/vim/vim70/syntax/html.vim
      >>41: c:/vim/vim70/syntax/javascript.vim
      >>42: c:/vim/vim70/syntax/vb.vim
      >>43: c:/vim/vim70/syntax/css.vim
      >>44: c:/vim/vimfiles/ftplugin/html.vim
      >>45: c:/vim/vimfiles/ftplugin/htm.vim
      >>46: c:/vim/vimfiles/ftplugin/html_jmd.vim
      >>47: c:/vim/vim70/ftplugin/html.vim
      >>48: c:/vim/vim70/indent/html.vim
      >>49: c:/vim/vim70/ftplugin/javascript.vim
      >>50: c:/vim/vim70/syntax/help.vim
      >>51: c:/vim/vim70/ftplugin/help.vim
      >>
      >>Anything there that could be causing problems?
      >>
      >>Thanks,
      >>
      >>
      >>Jack
      >>
      >>
      >
      >Do you have a variable "g:filetype_pl" set? If so, this overrides the
      >filetype default for perl. See ":help filetype-overrule", and
      >filetype.vim.
      >
      >
      >
      First make sure your filetype is set right. I think for perl you can
      type one of the following:
      :set ft=perl
      or
      :set ft=pl

      If that doesn't work for you take a look at this site:
      http://www.vim.org/htmldoc/syntax.html#syntax-loading
      There you will see the order of operations perfomed when you type :syntax on
      Here is the files used in :syntax loading etc:
      http://www.vim.org/htmldoc/syntax.html#:syn-files

      Try manually doing the steps for a perl file, i.e.:
      * Clear out any old syntax
      <http://www.vim.org/htmldoc/syntax.html#syntax> by sourcing
      $VIMRUNTIME/syntax/nosyntax.vim
      * Take a look at the following command and try running it- :au Syntax
      perl source $VIMRUNTIME/syntax/perl.vim

      Hopefully that will set your syntax highlighting up properly. If not
      I'm not sure what to do :) If it does work, then you have a config file
      somewhere misbehaving, or a vim "variable" set incorrectly perhaps...
      Good Luck,
      Chisum
    Your message has been successfully submitted and would be delivered to recipients shortly.