~ubuntu-branches/ubuntu/maverick/vim/maverick

« back to all changes in this revision

Viewing changes to runtime/ftplugin/gitrebase.vim

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2008-06-26 13:42:18 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080626134218-703edeyb8k70qpbz
Tags: 1:7.1.314-3ubuntu1
* Resynchronise with Debian. Remaining changes:
  - Enable detection of GNU screen as a mouse-capable terminal.
  - Add NoDisplay=true to gvim.desktop.
  - Drop vim-lesstif package and lesstif2-dev build-dependency.
  - Build-depend on libxt-dev.
  - Enable Python interpreter on basic builds.
  - Create a .pot file for translations.
  - Disable autoindent, line-wrapping, and backup files by default.
* Fixes various vulnerabilities due to improper quoting of 'execute'
  arguments (LP: #240216).
* Drop fixes for upgrade problems from Ubuntu 6.06 LTS; direct upgrades
  from 6.06 to 8.10 will not be supported.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
" Vim filetype plugin
2
2
" Language:     git rebase --interactive
3
3
" Maintainer:   Tim Pope <vimNOSPAM@tpope.info>
4
 
" Last Change:  2008 Feb 14
 
4
" Last Change:  2008 Apr 16
5
5
 
6
6
" Only do this when not done yet for this buffer
7
7
if (exists("b:did_ftplugin"))
8
8
    finish
9
9
endif
 
10
 
 
11
runtime! ftplugin/git.vim
10
12
let b:did_ftplugin = 1
11
13
 
12
14
setlocal comments=:# commentstring=#\ %s formatoptions-=t
13
 
setlocal keywordprg=git\ show
14
 
let b:undo_ftplugin = "setl com< cms< fo< keywordprg<"
 
15
if !exists("b:undo_ftplugin")
 
16
    let b:undo_ftplugin = ""
 
17
endif
 
18
let b:undo_ftplugin = b:undo_ftplugin."|setl com< cms< fo<"
 
19
 
 
20
function! s:choose(word)
 
21
    s/^\(\w\+\>\)\=\(\s*\)\ze\x\{4,40\}\>/\=(strlen(submatch(1)) == 1 ? a:word[0] : a:word) . substitute(submatch(2),'^$',' ','')/e
 
22
endfunction
 
23
 
 
24
function! s:cycle()
 
25
    call s:choose(get({'s':'edit','p':'squash'},getline('.')[0],'pick'))
 
26
endfunction
 
27
 
 
28
command! -buffer -bar Pick   :call s:choose('pick')
 
29
command! -buffer -bar Squash :call s:choose('squash')
 
30
command! -buffer -bar Edit   :call s:choose('edit')
 
31
command! -buffer -bar Cycle  :call s:cycle()
 
32
" The above are more useful when they are mapped; for example:
 
33
"nnoremap <buffer> <silent> S :Cycle<CR>
 
34
 
 
35
if exists("g:no_plugin_maps") || exists("g:no_gitrebase_maps")
 
36
    finish
 
37
endif
 
38
 
 
39
nnoremap <buffer> <expr> K col('.') < 7 && expand('<Lt>cword>') =~ '\X' && getline('.') =~ '^\w\+\s\+\x\+\>' ? 'wK' : 'K'
 
40
 
 
41
let b:undo_ftplugin = b:undo_ftplugin . "|nunmap <buffer> K"