/
usr
/
share
/
vim
/
vim74
/
ftplugin
/
/usr/share/vim/vim74/ftplugin
mkdir
upload
Name
Size
Mode
Actions
a2ps.vim
458
0644
edit
dl
rm
aap.vim
716
0644
edit
dl
rm
abap.vim
800
0644
edit
dl
rm
abaqus.vim
3391
0644
edit
dl
rm
ada.vim
6408
0644
edit
dl
rm
alsaconf.vim
426
0644
edit
dl
rm
ant.vim
1341
0644
edit
dl
rm
arch.vim
419
0644
edit
dl
rm
art.vim
410
0644
edit
dl
rm
aspvbs.vim
1916
0644
edit
dl
rm
automake.vim
325
0644
edit
dl
rm
bdf.vim
437
0644
edit
dl
rm
bst.vim
333
0644
edit
dl
rm
btm.vim
316
0644
edit
dl
rm
c.vim
1964
0644
edit
dl
rm
calendar.vim
450
0644
edit
dl
rm
cdrdaoconf.vim
375
0644
edit
dl
rm
ch.vim
472
0644
edit
dl
rm
changelog.vim
8742
0644
edit
dl
rm
clojure.vim
2846
0644
edit
dl
rm
cobol.vim
9392
0644
edit
dl
rm
conf.vim
422
0644
edit
dl
rm
config.vim
1274
0644
edit
dl
rm
context.vim
955
0644
edit
dl
rm
cpp.vim
288
0644
edit
dl
rm
crm.vim
402
0644
edit
dl
rm
cs.vim
802
0644
edit
dl
rm
csc.vim
734
0644
edit
dl
rm
csh.vim
1633
0644
edit
dl
rm
css.vim
516
0644
edit
dl
rm
cucumber.vim
5325
0644
edit
dl
rm
cvsrc.vim
387
0644
edit
dl
rm
debchangelog.vim
11532
0644
edit
dl
rm
debcontrol.vim
1886
0644
edit
dl
rm
denyhosts.vim
375
0644
edit
dl
rm
dictconf.vim
422
0644
edit
dl
rm
dictdconf.vim
423
0644
edit
dl
rm
diff.vim
355
0644
edit
dl
rm
dircolors.vim
419
0644
edit
dl
rm
docbk.vim
530
0644
edit
dl
rm
dosbatch.vim
777
0644
edit
dl
rm
dosini.vim
446
0644
edit
dl
rm
dtd.vim
1123
0644
edit
dl
rm
dtrace.vim
1151
0644
edit
dl
rm
elinks.vim
424
0644
edit
dl
rm
erlang.vim
1811
0644
edit
dl
rm
eruby.vim
3150
0644
edit
dl
rm
eterm.vim
458
0644
edit
dl
rm
falcon.vim
1344
0644
edit
dl
rm
fetchmail.vim
416
0644
edit
dl
rm
flexwiki.vim
1876
0644
edit
dl
rm
fortran.vim
4257
0644
edit
dl
rm
framescript.vim
768
0644
edit
dl
rm
fvwm.vim
390
0644
edit
dl
rm
git.vim
1218
0644
edit
dl
rm
gitcommit.vim
2213
0644
edit
dl
rm
gitconfig.vim
376
0644
edit
dl
rm
gitrebase.vim
1434
0644
edit
dl
rm
gitsendemail.vim
157
0644
edit
dl
rm
gpg.vim
421
0644
edit
dl
rm
gprof.vim
939
0644
edit
dl
rm
group.vim
413
0644
edit
dl
rm
grub.vim
422
0644
edit
dl
rm
haml.vim
1887
0644
edit
dl
rm
hamster.vim
1923
0644
edit
dl
rm
haskell.vim
433
0644
edit
dl
rm
help.vim
430
0644
edit
dl
rm
hostconf.vim
375
0644
edit
dl
rm
hostsaccess.vim
424
0644
edit
dl
rm
html.vim
2935
0644
edit
dl
rm
htmldjango.vim
331
0644
edit
dl
rm
indent.vim
442
0644
edit
dl
rm
initex.vim
1005
0644
edit
dl
rm
ishd.vim
1264
0644
edit
dl
rm
java.vim
1686
0644
edit
dl
rm
javascript.vim
1047
0644
edit
dl
rm
jsp.vim
2011
0644
edit
dl
rm
kconfig.vim
375
0644
edit
dl
rm
kwt.vim
851
0644
edit
dl
rm
ld.vim
458
0644
edit
dl
rm
lftp.vim
422
0644
edit
dl
rm
libao.vim
428
0644
edit
dl
rm
limits.vim
424
0644
edit
dl
rm
liquid.vim
1897
0644
edit
dl
rm
lisp.vim
911
0644
edit
dl
rm
logcheck.vim
500
0644
edit
dl
rm
loginaccess.vim
430
0644
edit
dl
rm
logindefs.vim
428
0644
edit
dl
rm
logtalk.dict
1790
0644
edit
dl
rm
logtalk.vim
401
0644
edit
dl
rm
lprolog.vim
1279
0644
edit
dl
rm
lua.vim
973
0644
edit
dl
rm
m4.vim
414
0644
edit
dl
rm
mail.vim
1107
0644
edit
dl
rm
mailaliases.vim
375
0644
edit
dl
rm
mailcap.vim
422
0644
edit
dl
rm
make.vim
935
0644
edit
dl
rm
man.vim
4707
0644
edit
dl
rm
manconf.vim
432
0644
edit
dl
rm
markdown.vim
572
0644
edit
dl
rm
matlab.vim
649
0644
edit
dl
rm
mf.vim
404
0644
edit
dl
rm
modconf.vim
465
0644
edit
dl
rm
mp.vim
621
0644
edit
dl
rm
mplayerconf.vim
460
0644
edit
dl
rm
mrxvtrc.vim
798
0644
edit
dl
rm
msmessages.vim
1141
0644
edit
dl
rm
muttrc.vim
455
0644
edit
dl
rm
nanorc.vim
435
0644
edit
dl
rm
netrc.vim
416
0644
edit
dl
rm
nsis.vim
553
0644
edit
dl
rm
objc.vim
296
0644
edit
dl
rm
ocaml.vim
23041
0644
edit
dl
rm
occam.vim
1297
0644
edit
dl
rm
pamconf.vim
421
0644
edit
dl
rm
pascal.vim
667
0644
edit
dl
rm
passwd.vim
412
0644
edit
dl
rm
pdf.vim
2613
0644
edit
dl
rm
perl.vim
2946
0644
edit
dl
rm
perl6.vim
2529
0644
edit
dl
rm
php.vim
2813
0644
edit
dl
rm
pinfo.vim
423
0644
edit
dl
rm
plaintex.vim
1150
0644
edit
dl
rm
postscr.vim
1006
0644
edit
dl
rm
procmail.vim
467
0644
edit
dl
rm
prolog.vim
428
0644
edit
dl
rm
protocols.vim
445
0644
edit
dl
rm
pyrex.vim
766
0644
edit
dl
rm
python.vim
1359
0644
edit
dl
rm
qf.vim
459
0644
edit
dl
rm
quake.vim
427
0644
edit
dl
rm
racc.vim
437
0644
edit
dl
rm
readline.vim
426
0644
edit
dl
rm
README.txt
869
0644
edit
dl
rm
reva.vim
709
0644
edit
dl
rm
rnc.vim
419
0644
edit
dl
rm
rpl.vim
620
0644
edit
dl
rm
rst.vim
444
0644
edit
dl
rm
ruby.vim
16235
0644
edit
dl
rm
sass.vim
580
0644
edit
dl
rm
scheme.vim
1752
0644
edit
dl
rm
screen.vim
424
0644
edit
dl
rm
scss.vim
200
0644
edit
dl
rm
sensors.vim
443
0644
edit
dl
rm
services.vim
440
0644
edit
dl
rm
setserial.vim
427
0644
edit
dl
rm
sgml.vim
1210
0644
edit
dl
rm
sh.vim
1202
0644
edit
dl
rm
sieve.vim
457
0644
edit
dl
rm
slpconf.vim
465
0644
edit
dl
rm
slpreg.vim
464
0644
edit
dl
rm
slpspi.vim
455
0644
edit
dl
rm
spec.vim
5330
0644
edit
dl
rm
sql.vim
20562
0644
edit
dl
rm
sshconfig.vim
429
0644
edit
dl
rm
sudoers.vim
426
0644
edit
dl
rm
svg.vim
1200
0644
edit
dl
rm
sysctl.vim
441
0644
edit
dl
rm
tcl.vim
1002
0644
edit
dl
rm
tcsh.vim
1207
0644
edit
dl
rm
terminfo.vim
418
0644
edit
dl
rm
tex.vim
1641
0644
edit
dl
rm
treetop.vim
404
0644
edit
dl
rm
tt2html.vim
434
0644
edit
dl
rm
udevconf.vim
422
0644
edit
dl
rm
udevperm.vim
420
0644
edit
dl
rm
udevrules.vim
414
0644
edit
dl
rm
updatedb.vim
431
0644
edit
dl
rm
vb.vim
1907
0644
edit
dl
rm
verilog.vim
1681
0644
edit
dl
rm
vhdl.vim
3497
0644
edit
dl
rm
vim.vim
2951
0644
edit
dl
rm
xdefaults.vim
469
0644
edit
dl
rm
xf86conf.vim
422
0644
edit
dl
rm
xhtml.vim
2036
0644
edit
dl
rm
xinetd.vim
464
0644
edit
dl
rm
xml.vim
1911
0644
edit
dl
rm
xmodmap.vim
422
0644
edit
dl
rm
xs.vim
465
0644
edit
dl
rm
xsd.vim
1171
0644
edit
dl
rm
xslt.vim
539
0644
edit
dl
rm
yaml.vim
452
0644
edit
dl
rm
zimbu.vim
5322
0644
edit
dl
rm
zsh.vim
674
0644
edit
dl
rm
Edit:
/usr/share/vim/vim74/ftplugin/debchangelog.vim
(11532B)
" Vim filetype plugin file (GUI menu, folding and completion) " Language: Debian Changelog " Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> " Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de> " Stefano Zacchiroli <zack@debian.org> " Last Change: 2012-01-31 " License: Vim License " URL: http://hg.debian.org/hg/pkg-vim/vim/file/unstable/runtime/ftplugin/debchangelog.vim " Bug completion requires apt-listbugs installed for Debian packages or " python-launchpadlib installed for Ubuntu packages if exists("b:did_ftplugin") finish endif let b:did_ftplugin=1 " {{{1 Local settings (do on every load) if exists("g:debchangelog_fold_enable") setlocal foldmethod=expr setlocal foldexpr=DebGetChangelogFold(v:lnum) setlocal foldtext=DebChangelogFoldText() endif " Debian changelogs are not supposed to have any other text width, " so the user cannot override this setting setlocal tw=78 setlocal comments=f:* " Clean unloading let b:undo_ftplugin = "setlocal tw< comments< foldmethod< foldexpr< foldtext<" " }}}1 if exists("g:did_changelog_ftplugin") finish endif " Don't load another plugin (this is global) let g:did_changelog_ftplugin = 1 " {{{1 GUI menu " Helper functions returning various data. " Returns full name, either from $DEBFULLNAME or debianfullname. " TODO Is there a way to determine name from anywhere else? function <SID>FullName() if exists("$DEBFULLNAME") return $DEBFULLNAME elseif exists("g:debianfullname") return g:debianfullname else return "Your Name" endif endfunction " Returns email address, from $DEBEMAIL, $EMAIL or debianemail. function <SID>Email() if exists("$DEBEMAIL") return $DEBEMAIL elseif exists("$EMAIL") return $EMAIL elseif exists("g:debianemail") return g:debianemail else return "your@email.address" endif endfunction " Returns date in RFC822 format. function <SID>Date() let savelang = v:lc_time execute "language time C" let dateandtime = strftime("%a, %d %b %Y %X %z") execute "language time " . savelang return dateandtime endfunction function <SID>WarnIfNotUnfinalised() if match(getline("."), " -- [[:alpha:]][[:alnum:].]")!=-1 echohl WarningMsg echo "The entry has not been unfinalised before editing." echohl None return 1 endif return 0 endfunction function <SID>Finalised() let savelinenum = line(".") normal 1G call search("^ -- ") if match(getline("."), " -- [[:alpha:]][[:alnum:].]")!=-1 let returnvalue = 1 else let returnvalue = 0 endif execute savelinenum return returnvalue endfunction " These functions implement the menus function NewVersion() " The new entry is unfinalised and shall be changed amenu disable Changelog.New\ Version amenu enable Changelog.Add\ Entry amenu enable Changelog.Close\ Bug amenu enable Changelog.Set\ Distribution amenu enable Changelog.Set\ Urgency amenu disable Changelog.Unfinalise amenu enable Changelog.Finalise call append(0, substitute(getline(1), '-\([[:digit:]]\+\))', '-$$\1)', '')) call append(1, "") call append(2, "") call append(3, " -- ") call append(4, "") call Urgency("low") normal 1G0 call search(")") normal h normal call setline(1, substitute(getline(1), '-\$\$', '-', '')) if exists("g:debchangelog_fold_enable") foldopen endif call AddEntry() endfunction function AddEntry() normal 1G call search("^ -- ") normal kk call append(".", " * ") normal jjj let warn=<SID>WarnIfNotUnfinalised() normal kk if warn echohl MoreMsg call input("Hit ENTER") echohl None endif startinsert! endfunction function CloseBug() normal 1G call search("^ -- ") let warn=<SID>WarnIfNotUnfinalised() normal kk call append(".", " * (closes: #" . input("Bug number to close: ") . ")") normal j^ll startinsert endfunction function Distribution(dist) call setline(1, substitute(getline(1), ") [[:lower:] ]*;", ") " . a:dist . ";", "")) endfunction function Urgency(urg) call setline(1, substitute(getline(1), "urgency=.*$", "urgency=" . a:urg, "")) endfunction function <SID>UnfinaliseMenu() " This means the entry shall be changed amenu disable Changelog.New\ Version amenu enable Changelog.Add\ Entry amenu enable Changelog.Close\ Bug amenu enable Changelog.Set\ Distribution amenu enable Changelog.Set\ Urgency amenu disable Changelog.Unfinalise amenu enable Changelog.Finalise endfunction function Unfinalise() call <SID>UnfinaliseMenu() normal 1G call search("^ -- ") call setline(".", " -- ") endfunction function <SID>FinaliseMenu() " This means the entry should not be changed anymore amenu enable Changelog.New\ Version amenu disable Changelog.Add\ Entry amenu disable Changelog.Close\ Bug amenu disable Changelog.Set\ Distribution amenu disable Changelog.Set\ Urgency amenu enable Changelog.Unfinalise amenu disable Changelog.Finalise endfunction function Finalise() call <SID>FinaliseMenu() normal 1G call search("^ -- ") call setline(".", " -- " . <SID>FullName() . " <" . <SID>Email() . "> " . <SID>Date()) endfunction function <SID>MakeMenu() amenu &Changelog.&New\ Version :call NewVersion()<CR> amenu Changelog.&Add\ Entry :call AddEntry()<CR> amenu Changelog.&Close\ Bug :call CloseBug()<CR> menu Changelog.-sep- <nul> amenu Changelog.Set\ &Distribution.&unstable :call Distribution("unstable")<CR> amenu Changelog.Set\ Distribution.&frozen :call Distribution("frozen")<CR> amenu Changelog.Set\ Distribution.&stable :call Distribution("stable")<CR> menu Changelog.Set\ Distribution.-sep- <nul> amenu Changelog.Set\ Distribution.frozen\ unstable :call Distribution("frozen unstable")<CR> amenu Changelog.Set\ Distribution.stable\ unstable :call Distribution("stable unstable")<CR> amenu Changelog.Set\ Distribution.stable\ frozen :call Distribution("stable frozen")<CR> amenu Changelog.Set\ Distribution.stable\ frozen\ unstable :call Distribution("stable frozen unstable")<CR> amenu Changelog.Set\ &Urgency.&low :call Urgency("low")<CR> amenu Changelog.Set\ Urgency.&medium :call Urgency("medium")<CR> amenu Changelog.Set\ Urgency.&high :call Urgency("high")<CR> menu Changelog.-sep- <nul> amenu Changelog.U&nfinalise :call Unfinalise()<CR> amenu Changelog.&Finalise :call Finalise()<CR> if <SID>Finalised() call <SID>FinaliseMenu() else call <SID>UnfinaliseMenu() endif endfunction augroup changelogMenu au BufEnter * if &filetype == "debchangelog" | call <SID>MakeMenu() | endif au BufLeave * if &filetype == "debchangelog" | silent! aunmenu Changelog | endif augroup END " }}} " {{{1 folding " look for an author name in the [zonestart zoneend] lines searching backward function! s:getAuthor(zonestart, zoneend) let linepos = a:zoneend while linepos >= a:zonestart let line = getline(linepos) if line =~ '^ --' return substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '') endif let linepos -= 1 endwhile return '[unknown]' endfunction " Look for a package source name searching backward from the givenline and " returns it. Return the empty string if the package name can't be found function! DebGetPkgSrcName(lineno) let lineidx = a:lineno let pkgname = '' while lineidx > 0 let curline = getline(lineidx) if curline =~ '^\S' let pkgname = matchlist(curline, '^\(\S\+\).*$')[1] break endif let lineidx = lineidx - 1 endwhile return pkgname endfunction function! DebChangelogFoldText() if v:folddashes == '-' " changelog entry fold return foldtext() . ' -- ' . s:getAuthor(v:foldstart, v:foldend) . ' ' endif return foldtext() endfunction function! DebGetChangelogFold(lnum) let line = getline(a:lnum) if line =~ '^\w\+' return '>1' " beginning of a changelog entry endif if line =~ '^\s\+\[.*\]' return '>2' " beginning of an author-specific chunk endif if line =~ '^ --' return '1' endif return '=' endfunction if exists("g:debchangelog_fold_enable") silent! foldopen! " unfold the entry the cursor is on (usually the first one) endif " }}} " {{{1 omnicompletion for Closes: # if !exists('g:debchangelog_listbugs_severities') let g:debchangelog_listbugs_severities = 'critical,grave,serious,important,normal,minor,wishlist' endif fun! DebCompleteBugs(findstart, base) if a:findstart let line = getline('.') " try to detect whether this is closes: or lp: let g:debchangelog_complete_mode = 'debbugs' let try_colidx = col('.') - 1 let colidx = -1 " default to no-completion-possible while try_colidx > 0 && line[try_colidx - 1] =~ '\s\|\d\|#\|,\|:' let try_colidx = try_colidx - 1 if line[try_colidx] == '#' && colidx == -1 " found hash, where we complete from: let colidx = try_colidx elseif line[try_colidx] == ':' if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~ '\clp:' let g:debchangelog_complete_mode = 'lp' endif break endif endwhile return colidx else " return matches: let bug_lines = [] if g:debchangelog_complete_mode == 'lp' if ! has('python') echoerr 'vim must be built with Python support to use LP bug completion' return endif let pkgsrc = DebGetPkgSrcName(line('.')) python << EOF import vim try: from launchpadlib.launchpad import Launchpad from lazr.restfulclient.errors import HTTPError # login anonymously lp = Launchpad.login_anonymously('debchangelog.vim', 'production') ubuntu = lp.distributions['ubuntu'] try: sp = ubuntu.getSourcePackage(name=vim.eval('pkgsrc')) status = ('New', 'Incomplete', 'Confirmed', 'Triaged', 'In Progress', 'Fix Committed') tasklist = sp.searchTasks(status=status, order_by='id') liststr = '[' for task in tasklist: bug = task.bug liststr += "'#%d - %s'," % (bug.id, bug.title.replace('\'', '\'\'')) liststr += ']' vim.command('silent let bug_lines = %s' % liststr.encode('utf-8')) except HTTPError: pass except ImportError: vim.command('echoerr \'python-launchpadlib >= 1.5.4 needs to be installed to use Launchpad bug completion\'') EOF else if ! filereadable('/usr/sbin/apt-listbugs') echoerr 'apt-listbugs not found, you should install it to use Closes bug completion' return endif let pkgsrc = DebGetPkgSrcName(line('.')) let listbugs_output = system('/usr/sbin/apt-listbugs -s ' . g:debchangelog_listbugs_severities . ' list ' . pkgsrc . ' | grep "^ #" 2> /dev/null') let bug_lines = split(listbugs_output, '\n') endif let completions = [] for line in bug_lines let parts = matchlist(line, '^\s*\(#\S\+\)\s*-\s*\(.*\)$') " filter only those which match a:base: if parts[1] !~ "^" . a:base continue endif let completion = {} let completion['word'] = parts[1] let completion['menu'] = parts[2] let completion['info'] = parts[0] let completions += [completion] endfor return completions endif endfun setlocal omnifunc=DebCompleteBugs " }}} " vim: set foldmethod=marker:
Save
cmd:
run