From 13b68264a5f97b6fd81b8be5aad846f102c60453 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 24 Jan 2022 13:04:42 +0100 Subject: Rename git.vim to gitcommit.vim The ftype seems to have changed in revent vim versions. --- .vim/ftplugin/git.vim | 70 --------------------------------------------- .vim/ftplugin/gitcommit.vim | 70 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 .vim/ftplugin/git.vim create mode 100644 .vim/ftplugin/gitcommit.vim diff --git a/.vim/ftplugin/git.vim b/.vim/ftplugin/git.vim deleted file mode 100644 index 22beee9..0000000 --- a/.vim/ftplugin/git.vim +++ /dev/null @@ -1,70 +0,0 @@ -"============================================================================= -" Copyright: Copyright © Pierre Habouzit -" Permission is hereby granted to use and distribute this code, -" with or without modifications, provided that this copyright -" notice is copied with it. Like anything else that's free, -" bufexplorer.vim is provided *as is* and comes with no -" warranty of any kind, either expressed or implied. In no -" event will the copyright holder be liable for any damages -" resulting from the use of this software. -" Description: git-commit(1) helper -" Maintainer: Pierre Habouzit -" Last Changed: Mon, 26 Nov 2007 10:06:15 +0100 -" Usage: This file should live in your ftplugin directory. -" -" The configurations variables are: -" -" g:git_diff_opts - options to add to git diff, -" (default "-C -C") -" g:git_diff_spawn_mode - use auto-split on commit ? -" * 1 == hsplit -" * 2 == vsplit -" * none else (default) -" -" The default keymaping is: -" -" gd - view the diff in a hsplit -" ghd - view the diff in a hsplit -" gvd - view the diff in a vsplit -"========================================================================={{{= - -if exists("b:did_ftplugin") | finish | endif - -let b:did_ftplugin = 1 - -setlocal tw=72 -setlocal nowarn nowb - -function! Git_diff_windows(vertsplit, auto, opts) - if a:vertsplit - rightbelow vnew - else - rightbelow new - endif - silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile - exe "normal :r!LANG=C git diff --stat -p --cached ".a:opts."\no\1GddO\" - setlocal nomodifiable - noremap q :bw - if a:auto - redraw! - wincmd p - redraw! - endif -endfunction - -noremap gd :call Git_diff_windows(0, 0) -noremap ghd :call Git_diff_windows(0, 0) -noremap gvd :call Git_diff_windows(1, 0) - -if !exists("g:git_diff_opts") - let g:git_diff_opts = "-C -C" -endif -if exists("g:git_diff_spawn_mode") - if g:git_diff_spawn_mode == 1 - call Git_diff_windows(0, 1, g:git_diff_opts) - elseif g:git_diff_spawn_mode == 2 - call Git_diff_windows(1, 1, g:git_diff_opts) - endif -endif - -" }}} diff --git a/.vim/ftplugin/gitcommit.vim b/.vim/ftplugin/gitcommit.vim new file mode 100644 index 0000000..22beee9 --- /dev/null +++ b/.vim/ftplugin/gitcommit.vim @@ -0,0 +1,70 @@ +"============================================================================= +" Copyright: Copyright © Pierre Habouzit +" Permission is hereby granted to use and distribute this code, +" with or without modifications, provided that this copyright +" notice is copied with it. Like anything else that's free, +" bufexplorer.vim is provided *as is* and comes with no +" warranty of any kind, either expressed or implied. In no +" event will the copyright holder be liable for any damages +" resulting from the use of this software. +" Description: git-commit(1) helper +" Maintainer: Pierre Habouzit +" Last Changed: Mon, 26 Nov 2007 10:06:15 +0100 +" Usage: This file should live in your ftplugin directory. +" +" The configurations variables are: +" +" g:git_diff_opts - options to add to git diff, +" (default "-C -C") +" g:git_diff_spawn_mode - use auto-split on commit ? +" * 1 == hsplit +" * 2 == vsplit +" * none else (default) +" +" The default keymaping is: +" +" gd - view the diff in a hsplit +" ghd - view the diff in a hsplit +" gvd - view the diff in a vsplit +"========================================================================={{{= + +if exists("b:did_ftplugin") | finish | endif + +let b:did_ftplugin = 1 + +setlocal tw=72 +setlocal nowarn nowb + +function! Git_diff_windows(vertsplit, auto, opts) + if a:vertsplit + rightbelow vnew + else + rightbelow new + endif + silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile + exe "normal :r!LANG=C git diff --stat -p --cached ".a:opts."\no\1GddO\" + setlocal nomodifiable + noremap q :bw + if a:auto + redraw! + wincmd p + redraw! + endif +endfunction + +noremap gd :call Git_diff_windows(0, 0) +noremap ghd :call Git_diff_windows(0, 0) +noremap gvd :call Git_diff_windows(1, 0) + +if !exists("g:git_diff_opts") + let g:git_diff_opts = "-C -C" +endif +if exists("g:git_diff_spawn_mode") + if g:git_diff_spawn_mode == 1 + call Git_diff_windows(0, 1, g:git_diff_opts) + elseif g:git_diff_spawn_mode == 2 + call Git_diff_windows(1, 1, g:git_diff_opts) + endif +endif + +" }}} -- cgit v1.2.3-54-g00ecf