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

55169Re: Folding with shell syntax

Expand Messages
  • Gary Johnson
    Nov 29, 2004
      On 2004-11-29, vim@... wrote:
      > On Mon, Nov 29, 2004 at 04:17:40PM +0200, Sonic_Wind wrote:
      > > Hello Henrik,
      > >
      > > Monday, November 29, 2004, 2:35:02 PM, you wrote:
      > >
      > > > Fellow vim users!
      > >
      > > > I am in great need of using function folding, and i have
      > > > tried to enable it
      > > > with the syntax folding, but i can't get it to work.
      > >
      > > > Since there seem to be support for folding in the syntax
      > > > file, cant i just
      > > > enable it by a simple command, like "syntax on" but "folding on"?
      > >
      > > > set foldmethod=syntax and enabling folding does not seem to work.
      > >
      > > > I'm using VIM 6.3...
      > >
      > > > Thanks for any pointers, google was unable to help me ;)
      > >
      > >
      > > set foldmethod=syntax " means that syntax regions will be folded
      > > " the discription of such rigions must contain
      > > " fold key word
      > > for C-like languages this might looks like:
      > > sy region myFold start="{" end="}" fold transparent
      > > , so what language do you use.
      > It's shell scripts .sh files, syntax highlighting works fine. But
      > do i have to define them with start and end if the syntaxfile
      > supports folding, should i not be able to just start the folding?

      I can't get this to work, either. More precisely, the folding of
      "here" documents works fine but the folding of functions does not.
      I tried to isolate the problem to something in my setup, but even a
      minimal configuration still exhibits the problem.

      I created the following test file, syn_test.sh:


      cat << EOF > /dev/null

      fix_path() {


      started vim with this command:

      vim -N -u NONE syn_test.sh

      and executed these commands within vim:

      set foldmethod=syntax
      let g:sh_fold_enabled=1
      so $VIMRUNTIME/syntax/sh.vim

      The result was that the four lines of the "here" document were
      folded but the function was not. It looks like a bug in
      syntax/sh.vim to me.

      I am running vim-6.3 on an HP-UX 10.20 system.

      VIM - Vi IMproved 6.3 (2004 June 7, compiled Jun 8 2004 13:44:24)
      Compiled by garyjohn@davinci
      Normal version with X11-Motif GUI. Features included (+) or not (-):
      -arabic +autocmd +balloon_eval +browse +builtin_terms +byte_offset +cindent
      +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
      +cryptv +cscope +dialog_con_gui +diff +digraphs -dnd -ebcdic -emacs_tags +eval
      +ex_extra +extra_search -farsi +file_in_path +find_in_path +folding -footer
      +fork() -gettext -hangul_input -iconv +insert_expand +jumplist -keymap -langmap
      +libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
      +modify_fname +mouse +mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
      -mouse_netterm +mouse_xterm -multi_byte +multi_lang +netbeans_intg -osfiletype
      +path_extra -perl +postscript +printer -python +quickfix -rightleft -ruby
      +scrollbind +signs +smartindent -sniff +statusline -sun_workshop +syntax
      +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse
      +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual
      +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup
      +X11 +xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
      system vimrc file: "$VIM/vimrc"
      user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
      system gvimrc file: "$VIM/gvimrc"
      user gvimrc file: "$HOME/.gvimrc"
      system menu file: "$VIMRUNTIME/menu.vim"
      fall-back for $VIM: "/home/garyjohn/src/vim-6.3/share/vim"
      Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MOTIF -I/usr/dt/include -g -O2
      Linking: gcc -L/usr/dt/lib -L/usr/local/lib -o vim -lXext -lXm -lXt -lX11 -lSM -lICE -lcurses


      Gary Johnson | Agilent Technologies
      garyjohn@... | Wireless Division
      | Spokane, Washington, USA
    • Show all 9 messages in this topic