Bug#460897: vim: please improve syntax based folding of c/c++ comments

Helmut Grohne helmut at subdivi.de
Tue Jan 15 14:53:49 UTC 2008


Package: vim
Version: 1:7.1-175+2
Severity: wishlist
Tags: patch

I'm using syntax highlighting and foldmethod=syntax on C++ files. Let me
give an example:

/**
 * This is a doxygen comment.
 * ...
 */

This gets folded to:

+--  4 lines folded -----...

It would be much better to see the first useful line of the comment.
This can be achieved using a foldtext function like:

fun My_c_fold_line()
        let line = getline(v:foldstart)
        if line =~ '^\s*/\*\*\?\s*$'
                return getline(v:foldstart+1)
        else
                return line
        endif
endfun

It would be great if you could incorporate this or an improved version
in the syntax files.

Helmut

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.20.1 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash

Versions of packages vim depends on:
ii  libc6                     2.7-6          GNU C Library: Shared libraries
ii  libgpmg1                  1.19.6-25      General Purpose Mouse - shared lib
ii  libncurses5               5.6+20080105-1 Shared libraries for terminal hand
ii  vim-common                1:7.1-175+2    Vi IMproved - Common files
ii  vim-runtime               1:7.1-175+2    Vi IMproved - Runtime files

vim recommends no packages.

-- no debconf information





More information about the pkg-vim-maintainers mailing list