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

java keyword syntax highlighting

Expand Messages
  • chardson
    I m trying to figure out why there s a discrepancy between syntax highlighting between my two setups: · OS 10.6, MacVim 7.2 stable 1.2 · Ubuntu 9.04, Vim
    Message 1 of 5 , Apr 1 1:54 PM
    • 0 Attachment
      I'm trying to figure out why there's a discrepancy between syntax
      highlighting between my two setups:

      · OS 10.6, MacVim 7.2 stable 1.2
      · Ubuntu 9.04, Vim 7.2.079

      A while ago I moved my .bashrc, .vimrc, and .vim/ to a git repository
      shared on both machines. They are both at the same version and I've
      ensured that none of the files are missing from the repository.
      My .vimrc contains the following:

      syntax on
      set hlsearch
      set number "line numbers
      set bsdir=last "last accessed directory is default working
      directory
      set showmatch "shows cursor after completing a bracket
      set guifont=DejaVu\ Sans\ Mono:h10.00
      colorscheme molokai
      set mouse=a
      set so=7
      let java_highlight_java_lang_ids=1
      set smarttab
      set ts=4 "tabstop in spaces
      set sts=4 "soft tab stop (typically for insert mode)
      set sw=4 "shift width (no of spaces for auto
      indentation)
      set expandtab "spaces, never tab characters
      set cindent "auto C indentation
      set cinoptions=l1,(0,u0,j1
      set tags+=~/.vim/ctagsdb

      My .gvimrc is the only file unique to MacVim and it only specifies a
      font and a tab preference.

      You can see the contents of my .vim/ directory at this link:
      http://i.imgur.com/By16y.png


      Does anyone have any idea why keywords like "public", "class", and
      "this" are not being highlighted on the Ubuntu machine? It's driving
      me a bit nuts. I've searched Topeka (heh, April 1...), but I'm just
      getting basic howtos

      Thanks sincerely
      chardson

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      To unsubscribe, reply using "remove me" as the subject.
    • Benjamin R. Haskell
      ... See the recent vim_use thread about Java syntax highlighting: Why is template highlighted in Java code (OT: Maybe you didn t find it because you
      Message 2 of 5 , Apr 1 2:10 PM
      • 0 Attachment
        On Thu, 1 Apr 2010, chardson wrote:

        > I'm trying to figure out why there's a discrepancy between syntax
        > highlighting between my two setups:
        >
        > · OS 10.6, MacVim 7.2 stable 1.2
        > · Ubuntu 9.04, Vim 7.2.079
        >
        > A while ago I moved my .bashrc, .vimrc, and .vim/ to a git repository
        > shared on both machines. They are both at the same version and I've
        > ensured that none of the files are missing from the repository.

        See the recent vim_use thread about Java syntax highlighting:

        Why is "template" highlighted in Java code

        (OT: Maybe you didn't find it because you topeka'ed it on AltaVista?)

        If I'm not mistaken (big 'if' on this one), Ubuntu uses Debian for its
        upstream sources, and it sounds like there was a Debian packaging error
        that caused an odd version of syntax/java.vim to be included.

        Workaround for that problem would be to explicitly add:

        let java_allow_cpp_keywords=1
        (or 0, according to preference)

        (Though I thought the issue would only affect C++ keywords...
        Maybe there are other differences in the mispackaged version?)

        --
        Best,
        Ben

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        To unsubscribe, reply using "remove me" as the subject.
      • chardson
        I ve tried setting all of the following evs to 1, but it didn t help. java_allow_cpp_keywords java_highlight_all java_highlight_java_lang_ids I also diff d the
        Message 3 of 5 , Apr 5 3:26 PM
        • 0 Attachment
          I've tried setting all of the following evs to 1, but it didn't
          help.
          java_allow_cpp_keywords
          java_highlight_all
          java_highlight_java_lang_ids

          I also diff'd the three syntax/java.vim files from my mac with the one
          on my ubuntu machine, but they are all exactly the same.
          /Applications/Contents/Resources/vim/runtime/syntax/java.vim
          /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/
          java.vim
          /usr/share/vim/vim72/syntax/java.vim

          I might try diff'ing all the syntax files and get back to you




          On Apr 1, 5:10 pm, "Benjamin R. Haskell" <v...@...> wrote:
          > On Thu, 1 Apr 2010, chardson wrote:
          > > I'm trying to figure out why there's a discrepancy between syntax
          > > highlighting between my two setups:
          >
          > >      · OS 10.6, MacVim 7.2 stable 1.2
          > >      · Ubuntu 9.04, Vim 7.2.079
          >
          > > A while ago I moved my .bashrc, .vimrc, and .vim/ to a git repository
          > > shared on both machines.  They are both at the same version and I've
          > > ensured that none of the files are missing from the repository.
          >
          > See the recent vim_use thread about Java syntax highlighting:
          >
          > Why is "template" highlighted in Java code
          >
          > (OT: Maybe you didn't find it because you topeka'ed it on AltaVista?)
          >
          > If I'm not mistaken (big 'if' on this one), Ubuntu uses Debian for its
          > upstream sources, and it sounds like there was a Debian packaging error
          > that caused an odd version of syntax/java.vim to be included.
          >
          > Workaround for that problem would be to explicitly add:
          >
          > let java_allow_cpp_keywords=1
          > (or 0, according to preference)
          >
          > (Though I thought the issue would only affect C++ keywords...
          > Maybe there are other differences in the mispackaged version?)
          >
          > --
          > Best,
          > Ben

          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          To unsubscribe, reply using "remove me" as the subject.
        • Benjamin R. Haskell
          [reversing the top-posting] ... You might also try explicitly setting those to 0. Perhaps a system-wide vimrc is setting them on one platform but not the
          Message 4 of 5 , Apr 5 3:37 PM
          • 0 Attachment
            [reversing the top-posting]

            On Mon, 5 Apr 2010, chardson wrote:

            > On Apr 1, 5:10 pm, "Benjamin R. Haskell" wrote:
            >
            > > On Thu, 1 Apr 2010, chardson wrote:
            > >
            > > > I'm trying to figure out why there's a discrepancy between syntax
            > > > highlighting between my two setups:
            > >
            > > >      · OS 10.6, MacVim 7.2 stable 1.2
            > > >      · Ubuntu 9.04, Vim 7.2.079
            > > > [...]
            > >
            > > See the recent vim_use thread about Java syntax highlighting:
            > >
            > > [...]
            > >
            > > Workaround for that problem would be to explicitly add:
            > >
            > > let java_allow_cpp_keywords=1
            > > (or 0, according to preference)
            > >
            > > (Though I thought the issue would only affect C++ keywords...
            > > Maybe there are other differences in the mispackaged version?)
            > >
            >
            > I've tried setting all of the following evs to 1, but it didn't
            > help.
            > java_allow_cpp_keywords
            > java_highlight_all
            > java_highlight_java_lang_ids

            You might also try explicitly setting those to 0. Perhaps a system-wide
            vimrc is setting them on one platform but not the other? And the old
            behavior was to default java_allow_cpp_keywords to 1 unless it was
            defined.


            > I also diff'd the three syntax/java.vim files from my mac with the one
            > on my ubuntu machine, but they are all exactly the same.
            > /Applications/Contents/Resources/vim/runtime/syntax/java.vim
            > /Applications/MacVim.app/Contents/Resources/vim/runtime/syntax/
            > java.vim
            > /usr/share/vim/vim72/syntax/java.vim
            >
            > I might try diff'ing all the syntax files and get back to you

            Perhaps diffing (the equivalent of) /etc/vim/vimrc between the two
            systems would also help.

            --
            Best,
            Ben

            --
            You received this message from the "vim_use" maillist.
            Do not top-post! Type your reply below the text you are replying to.
            For more information, visit http://www.vim.org/maillist.php

            To unsubscribe, reply using "remove me" as the subject.
          • Matt Wozniski
            ... By evs , did you mean environment variables ? Those aren t environment variables, they re vim-internal variables - you set them with let
            Message 5 of 5 , Apr 5 4:03 PM
            • 0 Attachment
              On Mon, Apr 5, 2010 at 6:26 PM, chardson wrote:
              > I've tried setting all of the following evs to 1, but it didn't
              > help.
              >   java_allow_cpp_keywords
              >   java_highlight_all
              >   java_highlight_java_lang_ids

              By "evs", did you mean "environment variables"? Those aren't
              environment variables, they're vim-internal variables - you set them
              with

              let java_allow_cpp_keywords = 1

              in your vimrc. Of course, if you knew that already, nevermind. :)

              ~Matt

              --
              You received this message from the "vim_use" maillist.
              Do not top-post! Type your reply below the text you are replying to.
              For more information, visit http://www.vim.org/maillist.php

              To unsubscribe, reply using "remove me" as the subject.
            Your message has been successfully submitted and would be delivered to recipients shortly.