updated for version 7.2a
This commit is contained in:
18
runtime/ftplugin/cdrdaoconf.vim
Normal file
18
runtime/ftplugin/cdrdaoconf.vim
Normal file
@ -0,0 +1,18 @@
|
||||
" Vim filetype plugin file
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2007-09-18
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
70
runtime/ftplugin/debcontrol.vim
Normal file
70
runtime/ftplugin/debcontrol.vim
Normal file
@ -0,0 +1,70 @@
|
||||
" Vim filetype plugin file (GUI menu and folding)
|
||||
" Language: Debian control files
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainer: Pierre Habouzit <madcoder@debian.org>
|
||||
" Last Change: 2008-03-08
|
||||
" URL: http://git.debian.org/?p=pkg-vim/vim.git;a=blob_plain;f=runtime/ftplugin/debcontrol.vim;hb=debian
|
||||
|
||||
" 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
|
||||
13
runtime/ftplugin/dosini.vim
Normal file
13
runtime/ftplugin/dosini.vim
Normal file
@ -0,0 +1,13 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Configuration File (ini file) for MSDOS/MS Windows
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2007-08-23
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
|
||||
setlocal comments=:; commentstring=;\ %s formatoptions-=t formatoptions+=croql
|
||||
15
runtime/ftplugin/gitconfig.vim
Normal file
15
runtime/ftplugin/gitconfig.vim
Normal file
@ -0,0 +1,15 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git config file
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2007 Dec 16
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal formatoptions-=t formatoptions+=croql
|
||||
setlocal comments=:#,:; commentstring=;\ %s
|
||||
|
||||
let b:undo_ftplugin = "setl fo< com< cms<"
|
||||
41
runtime/ftplugin/gitrebase.vim
Normal file
41
runtime/ftplugin/gitrebase.vim
Normal file
@ -0,0 +1,41 @@
|
||||
" Vim filetype plugin
|
||||
" Language: git rebase --interactive
|
||||
" Maintainer: Tim Pope <vimNOSPAM@tpope.info>
|
||||
" Last Change: 2008 Apr 16
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if (exists("b:did_ftplugin"))
|
||||
finish
|
||||
endif
|
||||
|
||||
runtime! ftplugin/git.vim
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
setlocal comments=:# commentstring=#\ %s formatoptions-=t
|
||||
if !exists("b:undo_ftplugin")
|
||||
let b:undo_ftplugin = ""
|
||||
endif
|
||||
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<"
|
||||
|
||||
function! s:choose(word)
|
||||
s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
|
||||
endfunction
|
||||
|
||||
function! s:cycle()
|
||||
call s:choose(get({'s':'edit','p':'squash'},getline('.')[0],'pick'))
|
||||
endfunction
|
||||
|
||||
command! -buffer -bar Pick :call s:choose('pick')
|
||||
command! -buffer -bar Squash :call s:choose('squash')
|
||||
command! -buffer -bar Edit :call s:choose('edit')
|
||||
command! -buffer -bar Cycle :call s:cycle()
|
||||
" The above are more useful when they are mapped; for example:
|
||||
"nnoremap <buffer> <silent> S :Cycle<CR>
|
||||
|
||||
if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
|
||||
finish
|
||||
endif
|
||||
|
||||
nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
|
||||
|
||||
let b:undo_ftplugin = b:undo_ftplugin . "|nunmap <buffer> K"
|
||||
Reference in New Issue
Block a user