K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / vim / vim74 / ftplugin /
server ip : 172.67.156.115

your ip : 172.69.214.189

H O M E


Filename/usr/share/vim/vim74/ftplugin/debcontrol.vim
Size1.84 kb
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:56
Last modified03-Jan-2014 03:40
Last accessed06-Jul-2025 16:34
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
" Vim filetype plugin file (GUI menu and folding)
" Language: Debian control files
" Maintainer: Debian Vim Maintainers <[email protected]>
" Former Maintainer: Pierre Habouzit <[email protected]>
" Last Change: 2008-03-08
" URL: http://hg.debian.org/hg/pkg-vim/vim/raw-file/tip/runtime/ftplugin/debcontrol.vim

" Do these settings once per buffer
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin=1

" {{{1 Local settings (do on every load)
if exists("g:debcontrol_fold_enable")
setlocal foldmethod=expr
setlocal foldexpr=DebControlFold(v:lnum)
setlocal foldtext=DebControlFoldText()
endif
setlocal textwidth=0

" Clean unloading
let b:undo_ftplugin = "setlocal tw< foldmethod< foldexpr< foldtext<"

" }}}1

" {{{1 folding

function! s:getField(f, lnum)
let line = getline(a:lnum)
let fwdsteps = 0
while line !~ '^'.a:f.':'
let fwdsteps += 1
let line = getline(a:lnum + fwdsteps)
if line == ''
return 'unknown'
endif
endwhile
return substitute(line, '^'.a:f.': *', '', '')
endfunction

function! DebControlFoldText()
if v:folddashes == '-' " debcontrol entry fold
let type = substitute(getline(v:foldstart), ':.*', '', '')
if type == 'Source'
let ftext = substitute(foldtext(), ' *Source: *', ' ', '')
return ftext . ' -- ' . s:getField('Maintainer', v:foldstart) . ' '
endif
let arch = s:getField('Architecture', v:foldstart)
let ftext = substitute(foldtext(), ' *Package: *', ' [' . arch . '] ', '')
return ftext . ': ' . s:getField('Description', v:foldstart) . ' '
endif
return foldtext()
endfunction

function! DebControlFold(l)

" This is for not merging blank lines around folds to them
if getline(a:l) =~ '^Source:'
return '>1'
endif

if getline(a:l) =~ '^Package:'
return '>1'
endif

return '='
endfunction

" }}}1