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

vim reads java.vim syntax file but MacVim does not

Expand Messages
  • Jason
    I am trying to get folds working for Java files in MacVim. To do so I added lines to /usr/share/vim/vim72/syntax/java.vim As recommended at
    Message 1 of 3 , Mar 10, 2010
    • 0 Attachment
      I am trying to get folds working for Java files in MacVim. To do so I
      added lines to

      /usr/share/vim/vim72/syntax/java.vim

      As recommended at http://vim.wikia.com/wiki/Java/C/C%2B%2B_folding

      Now when I type "vim myfile.java" I get folds! Great!

      But when I run MacVim and open myfile.java... there are no folds and I
      get the error message "E490: No fold found" when I type "zc" on a
      foldable block of code.

      The problem seems to be that MacVim is not reading the java.vim
      file... or does not support the lines added (from the link above).

      --
      You received this message from the "vim_mac" 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
    • Carl Jacobsen
      ... I believe it s generally best to avoid modifying manufacturer-supplied files like this; you should be able to achieve the same effect by putting your
      Message 2 of 3 , Mar 10, 2010
      • 0 Attachment
        On Wed, 10 Mar 2010, Jason wrote:

        > I am trying to get folds working for Java files in MacVim. To do so
        > I added lines to
        >
        > /usr/share/vim/vim72/syntax/java.vim
        >
        > As recommended at http://vim.wikia.com/wiki/Java/C/C%2B%2B_folding
        >
        > Now when I type "vim myfile.java" I get folds! Great!

        I believe it's generally best to avoid modifying manufacturer-supplied
        files like this; you should be able to achieve the same effect by putting
        your modified copy of java.vim in ~/.vim/syntax (thus, it'd be the file
        ~/.vim/syntax/java.vim). Vim, and MacVim, will read these first, before
        looking in the normal location. I have quite a few files in ~/.vim/syntax
        for languages that aren't supplied with the stock Vim, or various tweaks
        or updates to languages.

        > But when I run MacVim and open myfile.java... there are no folds and I
        > get the error message "E490: No fold found" when I type "zc" on a
        > foldable block of code.

        Right... those files you were modifying, under /usr/share/vim/vim72 ?
        There's an entire (almost-but-not-quite) duplicate set of them under
        /Applications/MacVim.app/Contents/Resources/vim/runtime. You'd have
        to modify them there too. Another reason why ~/.vim is a good idea.

        Cheers,
        Carl

        --
        You received this message from the "vim_mac" 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
      • Jason Zwolak
        That works great! thanks a bunch -- Jason Zwolak ... -- You received this message from the vim_mac maillist. Do not top-post! Type your reply below the text
        Message 3 of 3 , Mar 11, 2010
        • 0 Attachment
          That works great!

          thanks a bunch
          --
          Jason Zwolak


          On Wed, Mar 10, 2010 at 5:02 PM, Carl Jacobsen <carl@...> wrote:
          On Wed, 10 Mar 2010, Jason wrote:

          I am trying to get folds working for Java files in MacVim.  To do so I added lines to

          /usr/share/vim/vim72/syntax/java.vim

          As recommended at http://vim.wikia.com/wiki/Java/C/C%2B%2B_folding

          Now when I type "vim myfile.java" I get folds!  Great!

          I believe it's generally best to avoid modifying manufacturer-supplied files like this; you should be able to achieve the same effect by putting your modified copy of java.vim in ~/.vim/syntax (thus, it'd be the file ~/.vim/syntax/java.vim).  Vim, and MacVim, will read these first, before looking in the normal location.  I have quite a few files in ~/.vim/syntax for languages that aren't supplied with the stock Vim, or various tweaks or updates to languages.


          But when I run MacVim and open myfile.java... there are no folds and I get the error message "E490: No fold found" when I type "zc" on a foldable block of code.

          Right... those files you were modifying, under /usr/share/vim/vim72 ? There's an entire (almost-but-not-quite) duplicate set of them under /Applications/MacVim.app/Contents/Resources/vim/runtime.  You'd have to modify them there too.  Another reason why ~/.vim is a good idea.

          Cheers,
          Carl


          --
          You received this message from the "vim_mac" 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

          --
          You received this message from the "vim_mac" 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
        Your message has been successfully submitted and would be delivered to recipients shortly.