diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-04-13 23:04:47 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-04-13 23:04:47 +0200 |
commit | 53bfca22f1f67934defa5f9c62ae5a6d5cf9f198 (patch) | |
tree | 99509c9b58f5f10912f19b8179c4743d4c205835 /runtime/ftplugin | |
parent | 09210ac93cacd4552593604066a86b2e7036a636 (diff) |
Updated runtime files.
Diffstat (limited to 'runtime/ftplugin')
-rw-r--r-- | runtime/ftplugin/git.vim | 5 | ||||
-rw-r--r-- | runtime/ftplugin/gitcommit.vim | 17 |
2 files changed, 11 insertions, 11 deletions
diff --git a/runtime/ftplugin/git.vim b/runtime/ftplugin/git.vim index e043c7587e..c9bcd43698 100644 --- a/runtime/ftplugin/git.vim +++ b/runtime/ftplugin/git.vim @@ -1,7 +1,6 @@ " Vim filetype plugin " Language: generic git output " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2010 May 21 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -10,7 +9,9 @@ endif let b:did_ftplugin = 1 if !exists('b:git_dir') - if expand('%:p') =~# '\.git\>' + if expand('%:p') =~# '[\/]\.git[\/]modules[\/]' + " Stay out of the way + elseif expand('%:p') =~# '\.git\>' let b:git_dir = matchstr(expand('%:p'),'.*\.git\>') elseif $GIT_DIR != '' let b:git_dir = $GIT_DIR diff --git a/runtime/ftplugin/gitcommit.vim b/runtime/ftplugin/gitcommit.vim index 94d635c5dd..86ee5222eb 100644 --- a/runtime/ftplugin/gitcommit.vim +++ b/runtime/ftplugin/gitcommit.vim @@ -1,7 +1,7 @@ " Vim filetype plugin " Language: git commit file " Maintainer: Tim Pope <vimNOSPAM@tpope.org> -" Last Change: 2010 May 21 +" Last Change: 2012 April 7 " Only do this when not done yet for this buffer if (exists("b:did_ftplugin")) @@ -11,13 +11,14 @@ endif runtime! ftplugin/git.vim let b:did_ftplugin = 1 +setlocal nomodeline + +let b:undo_ftplugin = 'setl modeline<' + if &textwidth == 0 " make sure that log messages play nice with git-log on standard terminals setlocal textwidth=72 - if !exists("b:undo_ftplugin") - let b:undo_ftplugin = "" - endif - let b:undo_ftplugin = b:undo_ftplugin . "|setl tw<" + let b:undo_ftplugin .= "|setl tw<" endif if exists("g:no_gitcommit_commands") || v:version < 700 @@ -28,8 +29,6 @@ if !exists("b:git_dir") let b:git_dir = expand("%:p:h") endif -" Automatically diffing can be done with: -" autocmd FileType gitcommit DiffGitCached | wincmd p command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>) function! s:diffcomplete(A,L,P) @@ -58,11 +57,11 @@ function! s:gitdiffcached(bang,gitdir,...) else let extra = "-p --stat=".&columns endif - call system(git." diff --cached --no-color ".extra." > ".(exists("*shellescape") ? shellescape(name) : name)) + call system(git." diff --cached --no-color --no-ext-diff ".extra." > ".(exists("*shellescape") ? shellescape(name) : name)) exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name) wincmd P let b:git_dir = a:gitdir command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>) - nnoremap <silent> q :q<CR> + nnoremap <buffer> <silent> q :q<CR> setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git endfunction |