fgl.vim : Syntax folding for IBM Informix 4GL or 4J programs
script karma |
Rating 3/2,
Downloaded by 1864 |
Comments, bugs, improvements
|
Vim wiki
|
created by |
Tim Kim |
|
script type |
syntax |
|
description |
fgl.vim is Informix 4GL syntax file.
|
|
install details |
Drop this script in 'syntax' directory under your vim installation directory.
Personally I have the following settings in .vimrc as well
- To set an initial folding level (how much to fold upon opening a 4GL program)
- To map SPACEBAR to toggle between folding and unfolding
- To change a defult vim text on folded line
For this, copy the following section to your .vimrc. Folding/Unfolding is just as easy as pressing SPACEBAR
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
set foldlevel=1 " change the number to set initial folding level
set foldtext=MyFoldText()
noremap <space> :call ToggleFold() <cr>
function MyFoldText()
let line = getline(v:foldstart)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return strpart(v:folddashes, 2, strlen(v:folddashes) - foldlevel(line("."))*3) . sub .
\ " ------ [" . (v:foldend - v:foldstart) . " lines] "
endfunction
fun! ToggleFold()
if foldlevel('.') == 0
normal! l
else
if foldclosed('.') < 0
. foldclose
else
. foldopen
endif
endif
" Clear status line
echo
endfun
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
script versions (upload new version)
Click on the package to download.
fgl.vim |
1.4 |
2008-12-06 |
6.0 |
Tim Kim |
A fix for a problm with INPUT statement |
fgl.vim |
1.3 |
2008-11-27 |
6.0 |
Tim Kim |
Fix error with DISPLAY statement |
fgl.vim |
1.2 |
2008-11-23 |
6.0 |
Tim Kim |
Fix folding error with INPUT statement
Added ELSE folding for IF statement |
fgl.vim |
1.1 |
2008-07-13 |
6.0 |
Tim Kim |
Fix a bug.
Commented out then/else block for if statement so that it creates a fold for the whole if block. |
fgl.vim |
1.0 |
2008-07-09 |
6.0 |
Tim Kim |
Initial upload |
ip used for rating: 18.226.181.89
|