summaryrefslogtreecommitdiff
path: root/runtime/ftplugin
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-06 17:57:30 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-06 17:57:30 +0200
commit85eee130f44a2201d88ca2aeff0af3b11dd75fa9 (patch)
tree1748e216e4f90786b1a0789a054568976da40c42 /runtime/ftplugin
parent7ce551f317a0bb92f8c0521e96325301e2d220ca (diff)
downloadvim-git-85eee130f44a2201d88ca2aeff0af3b11dd75fa9.tar.gz
Update runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r--runtime/ftplugin/debchangelog.vim128
-rw-r--r--runtime/ftplugin/debcontrol.vim18
-rw-r--r--runtime/ftplugin/man.vim10
3 files changed, 78 insertions, 78 deletions
diff --git a/runtime/ftplugin/debchangelog.vim b/runtime/ftplugin/debchangelog.vim
index 32f683109..a78f7811f 100644
--- a/runtime/ftplugin/debchangelog.vim
+++ b/runtime/ftplugin/debchangelog.vim
@@ -3,20 +3,20 @@
" Maintainer: Debian Vim Maintainers
" Former Maintainers: Michael Piefel <piefel@informatik.hu-berlin.de>
" Stefano Zacchiroli <zack@debian.org>
-" Last Change: 2018-01-06
+" Last Change: 2018-01-28
" License: Vim License
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debchangelog.vim
" Bug completion requires apt-listbugs installed for Debian packages or
" python-launchpadlib installed for Ubuntu packages
-if exists("b:did_ftplugin")
+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")
+if exists('g:debchangelog_fold_enable')
setlocal foldmethod=expr
setlocal foldexpr=DebGetChangelogFold(v:lnum)
setlocal foldtext=DebChangelogFoldText()
@@ -28,10 +28,10 @@ setlocal tw=78
setlocal comments=f:*
" Clean unloading
-let b:undo_ftplugin = "setlocal tw< comments< foldmethod< foldexpr< foldtext<"
+let b:undo_ftplugin = 'setlocal tw< comments< foldmethod< foldexpr< foldtext<'
" }}}1
-if exists("g:did_changelog_ftplugin")
+if exists('g:did_changelog_ftplugin')
finish
endif
@@ -44,41 +44,41 @@ let g:did_changelog_ftplugin = 1
" 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")
+ if exists('$DEBFULLNAME')
return $DEBFULLNAME
- elseif exists("g:debianfullname")
+ elseif exists('g:debianfullname')
return g:debianfullname
else
- return "Your Name"
+ return 'Your Name'
endif
endfunction
" Returns email address, from $DEBEMAIL, $EMAIL or debianemail.
function <SID>Email()
- if exists("$DEBEMAIL")
+ if exists('$DEBEMAIL')
return $DEBEMAIL
- elseif exists("$EMAIL")
+ elseif exists('$EMAIL')
return $EMAIL
- elseif exists("g:debianemail")
+ elseif exists('g:debianemail')
return g:debianemail
else
- return "your@email.address"
+ 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
+ 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
+ if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
echohl WarningMsg
- echo "The entry has not been unfinalised before editing."
+ echo 'The entry has not been unfinalised before editing.'
echohl None
return 1
endif
@@ -86,10 +86,10 @@ function <SID>WarnIfNotUnfinalised()
endfunction
function <SID>Finalised()
- let savelinenum = line(".")
- normal 1G
- call search("^ -- ")
- if match(getline("."), " -- [[:alpha:]][[:alnum:].]")!=-1
+ let savelinenum = line('.')
+ 1
+ call search('^ -- ')
+ if match(getline('.'), ' -- [[:alpha:]][[:alnum:].]')!=-1
let returnvalue = 1
else
let returnvalue = 0
@@ -109,54 +109,54 @@ function NewVersion()
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 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")
+ if exists('g:debchangelog_fold_enable')
foldopen
endif
call AddEntry()
endfunction
function AddEntry()
- normal 1G
- call search("^ -- ")
- normal kk
- call append(".", " * ")
- normal jjj
+ 1
+ call search('^ -- ')
+ .-2
+ call append('.', ' * ')
+ .+3
let warn=<SID>WarnIfNotUnfinalised()
- normal kk
+ .-2
if warn
echohl MoreMsg
- call input("Hit ENTER")
+ call input('Hit ENTER')
echohl None
endif
startinsert!
endfunction
function CloseBug()
- normal 1G
- call search("^ -- ")
+ 1
+ call search('^ -- ')
let warn=<SID>WarnIfNotUnfinalised()
- normal kk
- call append(".", " * (closes: #" . input("Bug number to close: ") . ")")
- normal j^ll
+ .-2
+ call append('.', ' * (closes: #' . input('Bug number to close: ') . ')')
+ normal! j^ll
startinsert
endfunction
function Distribution(dist)
- call setline(1, substitute(getline(1), ') *\%(UNRELEASED\|\l\+\);', ") " . a:dist . ";", ""))
+ call setline(1, substitute(getline(1), ') *\%(UNRELEASED\|\l\+\);', ') ' . a:dist . ';', ''))
endfunction
function Urgency(urg)
- call setline(1, substitute(getline(1), "urgency=.*$", "urgency=" . a:urg, ""))
+ call setline(1, substitute(getline(1), 'urgency=.*$', 'urgency=' . a:urg, ''))
endfunction
function <SID>UnfinaliseMenu()
@@ -172,9 +172,9 @@ endfunction
function Unfinalise()
call <SID>UnfinaliseMenu()
- normal 1G
- call search("^ -- ")
- call setline(".", " -- ")
+ 1
+ call search('^ -- ')
+ call setline('.', ' -- ')
endfunction
function <SID>FinaliseMenu()
@@ -190,9 +190,9 @@ endfunction
function Finalise()
call <SID>FinaliseMenu()
- normal 1G
- call search("^ -- ")
- call setline(".", " -- " . <SID>FullName() . " <" . <SID>Email() . "> " . <SID>Date())
+ 1
+ call search('^ -- ')
+ call setline('.', ' -- ' . <SID>FullName() . ' <' . <SID>Email() . '> ' . <SID>Date())
endfunction
@@ -239,7 +239,7 @@ function! s:getAuthor(zonestart, zoneend)
let linepos = a:zoneend
while linepos >= a:zonestart
let line = getline(linepos)
- if line =~ '^ --'
+ if line =~# '^ --'
return substitute(line, '^ --\s*\([^<]\+\)\s*.*', '\1', '')
endif
let linepos -= 1
@@ -254,7 +254,7 @@ function! DebGetPkgSrcName(lineno)
let pkgname = ''
while lineidx > 0
let curline = getline(lineidx)
- if curline =~ '^\S'
+ if curline =~# '^\S'
let pkgname = matchlist(curline, '^\(\S\+\).*$')[1]
break
endif
@@ -264,7 +264,7 @@ function! DebGetPkgSrcName(lineno)
endfunction
function! DebChangelogFoldText()
- if v:folddashes == '-' " changelog entry fold
+ if v:folddashes ==# '-' " changelog entry fold
return foldtext() . ' -- ' . s:getAuthor(v:foldstart, v:foldend) . ' '
endif
return foldtext()
@@ -272,19 +272,19 @@ endfunction
function! DebGetChangelogFold(lnum)
let line = getline(a:lnum)
- if line =~ '^\w\+'
+ if line =~# '^\w\+'
return '>1' " beginning of a changelog entry
endif
- if line =~ '^\s\+\[.*\]'
+ if line =~# '^\s\+\[.*\]'
return '>2' " beginning of an author-specific chunk
endif
- if line =~ '^ --'
+ if line =~# '^ --'
return '1'
endif
return '='
endfunction
-if exists("g:debchangelog_fold_enable")
+if exists('g:debchangelog_fold_enable')
silent! foldopen! " unfold the entry the cursor is on (usually the first one)
endif
@@ -305,13 +305,13 @@ fun! DebCompleteBugs(findstart, base)
let try_colidx = col('.') - 1
let colidx = -1 " default to no-completion-possible
- while try_colidx > 0 && line[try_colidx - 1] =~ '\s\|\d\|#\|,\|:'
+ while try_colidx > 0 && line[try_colidx - 1] =~# '\s\|\d\|#\|,\|:'
let try_colidx = try_colidx - 1
- if line[try_colidx] == '#' && 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:'
+ elseif line[try_colidx] ==# ':'
+ if try_colidx > 1 && strpart(line, try_colidx - 2, 3) =~? '\clp:'
let g:debchangelog_complete_mode = 'lp'
endif
break
@@ -320,7 +320,7 @@ fun! DebCompleteBugs(findstart, base)
return colidx
else " return matches:
let bug_lines = []
- if g:debchangelog_complete_mode == 'lp'
+ if g:debchangelog_complete_mode ==? 'lp'
if ! has('python')
echoerr 'vim must be built with Python support to use LP bug completion'
return
@@ -363,7 +363,7 @@ EOF
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
+ if parts[1] !~ '^' . a:base
continue
endif
let completion = {}
diff --git a/runtime/ftplugin/debcontrol.vim b/runtime/ftplugin/debcontrol.vim
index 9643d16c2..3a6e39a68 100644
--- a/runtime/ftplugin/debcontrol.vim
+++ b/runtime/ftplugin/debcontrol.vim
@@ -2,17 +2,17 @@
" Language: Debian control files
" Maintainer: Debian Vim Maintainers
" Former Maintainer: Pierre Habouzit <madcoder@debian.org>
-" Last Change: 2018-01-06
+" Last Change: 2018-01-28
" URL: https://salsa.debian.org/vim-team/vim-debian/blob/master/ftplugin/debcontrol.vim
" Do these settings once per buffer
-if exists("b:did_ftplugin")
+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")
+if exists('g:debcontrol_fold_enable')
setlocal foldmethod=expr
setlocal foldexpr=DebControlFold(v:lnum)
setlocal foldtext=DebControlFoldText()
@@ -20,7 +20,7 @@ endif
setlocal textwidth=0
" Clean unloading
-let b:undo_ftplugin = "setlocal tw< foldmethod< foldexpr< foldtext<"
+let b:undo_ftplugin = 'setlocal tw< foldmethod< foldexpr< foldtext<'
" }}}1
@@ -32,7 +32,7 @@ function! s:getField(f, lnum)
while line !~ '^'.a:f.':'
let fwdsteps += 1
let line = getline(a:lnum + fwdsteps)
- if line == ''
+ if line ==# ''
return 'unknown'
endif
endwhile
@@ -40,9 +40,9 @@ function! s:getField(f, lnum)
endfunction
function! DebControlFoldText()
- if v:folddashes == '-' " debcontrol entry fold
+ if v:folddashes ==# '-' " debcontrol entry fold
let type = substitute(getline(v:foldstart), ':.*', '', '')
- if type == 'Source'
+ if type ==# 'Source'
let ftext = substitute(foldtext(), ' *Source: *', ' ', '')
return ftext . ' -- ' . s:getField('Maintainer', v:foldstart) . ' '
endif
@@ -56,11 +56,11 @@ endfunction
function! DebControlFold(l)
" This is for not merging blank lines around folds to them
- if getline(a:l) =~ '^Source:'
+ if getline(a:l) =~# '^Source:'
return '>1'
endif
- if getline(a:l) =~ '^Package:'
+ if getline(a:l) =~# '^Package:'
return '>1'
endif
diff --git a/runtime/ftplugin/man.vim b/runtime/ftplugin/man.vim
index 9e9715693..ea3f9ac6c 100644
--- a/runtime/ftplugin/man.vim
+++ b/runtime/ftplugin/man.vim
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
-" Last Change: 2018 Jan 15
+" Last Change: 2018 May 2
" To make the ":Man" command available before editing a manual page, source
" this script from your startup vimrc file.
@@ -164,7 +164,7 @@ func <SID>GetPage(...)
setl buftype=nofile noswapfile
setl ma nonu nornu nofen
- silent exec "norm 1GdG"
+ silent exec "norm! 1GdG"
let unsetwidth = 0
if empty($MANWIDTH)
let $MANWIDTH = winwidth(0)
@@ -188,10 +188,10 @@ func <SID>GetPage(...)
endif
" Remove blank lines from top and bottom.
while getline(1) =~ '^\s*$'
- silent keepj norm ggdd
+ silent keepj norm! ggdd
endwhile
while getline('$') =~ '^\s*$'
- silent keepj norm Gdd
+ silent keepj norm! Gdd
endwhile
1
setl ft=man nomod
@@ -208,7 +208,7 @@ func <SID>PopPage()
exec "let s:man_tag_col=s:man_tag_col_".s:man_tag_depth
exec s:man_tag_buf."b"
exec s:man_tag_lin
- exec "norm ".s:man_tag_col."|"
+ exec "norm! ".s:man_tag_col."|"
exec "unlet s:man_tag_buf_".s:man_tag_depth
exec "unlet s:man_tag_lin_".s:man_tag_depth
exec "unlet s:man_tag_col_".s:man_tag_depth