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

Folding Question...

Expand Messages
  • Furash Gary
    The behavior I want is, if the file is type outline (otl), then set foldmethod=expr (necessary for vimoutliner) else, if the file is a java, beanshell, etc,
    Message 1 of 3 , Feb 1, 2005
    • 0 Attachment
      The behavior I want is, if the file is type outline (otl), then
          set foldmethod=expr
      (necessary for vimoutliner)
      else, if the file is a java, beanshell, etc, then
          set foldmethod=syntax
          syn region cBlockFold start="{" end="{" transparent fold
       
      The advice I've received from the samples is to put this stuff in the _vimrc, but I'm not sure that's the right place.
       
      Gary
       
      Gary Furash, MBA, PMP
      Applications Manager, Maricopa County Attorney's Office
      602-506-0351 (Work), 602-725-1985 (Mobile)
    • Wind
      Hello Furash, You are right there is more right place for this. For stuff like set foldmethod ... I prefere to use ftplugin feature: for example java
      Message 2 of 3 , Feb 1, 2005
      • 0 Attachment
        Hello Furash,
        You are right there is more right place for this.
        For stuff like
        set foldmethod ...
        I prefere to use ftplugin feature:
        for example java configuration *.vim scripts I place in
        the ~/.vim/ftplugin/java/ directory (for M$ win "~/vimfiles/...") so
        they sourced for every java buffer.
        And for syntax stuff I use local copy of the synax scripts at
        ~/.vim/syntax (e.g. ~/.vim/syntax/java.vim).

        Your
        FG>     syn region cBlockFold start="{" end="{" transparent fold
        looks funny ;)
        try my java.vim synax file. It also folds import statments and
        comments("/*....*/" not line comments) and also has feature:
        /// {{{1

        // }}}1
        works like marker folding (with foldmethod=syntax) :)

        Tuesday, February 1, 2005, 4:23:30 PM, you wrote:

        FG> The behavior I want is, if the file is type outline (otl), then
        FG>     set foldmethod=expr
        FG> (necessary for vimoutliner)
        FG> else, if the file is a java, beanshell, etc, then
        FG>     set foldmethod=syntax
        FG>     syn region cBlockFold start="{" end="{" transparent fold
        FG>  
        FG> The advice I've received from the samples is to put this
        FG> stuff in the _vimrc, but I'm not sure that's the right place.
        FG>  
        FG> Gary
        FG>  
        FG> Gary Furash, MBA, PMP
        FG> Applications Manager, Maricopa County Attorney's Office
        FG> 602-506-0351 (Work), 602-725-1985 (Mobile)





        --
        Best regards,
        Wind mailto:sonic_wind@...
      • Luc Hermitte
        Hello, ... I d rather use ftplugins (or any similar mechanism) that messing my .vimrc with autocommands. However, if you want to use the same definition with
        Message 3 of 3 , Feb 1, 2005
        • 0 Attachment
          Hello,

          * On Tue, Feb 01, 2005 at 07:23:30AM -0700, Furash Gary <furashg@...> wrote:
          > The behavior I want is, if the file is type outline (otl), then
          > set foldmethod=expr
          > (necessary for vimoutliner)
          > else, if the file is a java, beanshell, etc, then
          > set foldmethod=syntax
          > syn region cBlockFold start="{" end="{" transparent fold
          >
          > The advice I've received from the samples is to put this stuff in the
          > _vimrc, but I'm not sure that's the right place.

          I'd rather use ftplugins (or any similar mechanism) that messing my
          .vimrc with autocommands. However, if you want to use the same
          definition with many filetypes, an autocommand might be simplier.

          --
          Luc Hermitte
          http://hermitte.free.fr/vim/
        Your message has been successfully submitted and would be delivered to recipients shortly.