Skip to content
Browse files

update git/commit.vim auto set $EDITOR.

  • Loading branch information...
1 parent 47ba036 commit dd562b111467239eba621ada0d51b361d634b781 @hrsh7th committed Oct 3, 2012
Showing with 10 additions and 23 deletions.
  1. +9 −23 autoload/vcs/git/commit.vim
  2. +1 −0 autoload/vcs/svn/commit.vim
View
32 autoload/vcs/git/commit.vim
@@ -4,31 +4,17 @@ set cpo&vim
function! vcs#git#commit#do(args)
let files = type(a:args) == type([]) ? a:args : [a:args]
+ " TODO: collect windows.
let cwd = getcwd()
exec 'lcd ' . vcs#vcs('root', files)
- if match(vcs#system('echo $EDITOR'), '\w\+') != -1 || match(vcs#system('echo $GIT_EDITOR'), '\w\+') != -1
- exec join([
- \ '!',
- \ 'git',
- \ 'commit',
- \ '--include',
- \ join(vcs#escape(files), ' ')
- \ ], ' ')
- else
- echomsg "can't find $EDITOR or $GIT_EDITOR variable."
- let msg = input('commit message: ')
- if msg != ''
- exec join([
- \ '!',
- \ 'git',
- \ 'commit',
- \ '--include',
- \ '-m',
- \ '"' . msg . '"',
- \ join(vcs#escape(files), ' ')
- \ ], ' ')
- endif
- endif
+ exec join([
+ \ '!',
+ \ 'export EDITOR=vim;',
+ \ 'git',
+ \ 'commit',
+ \ '--include',
+ \ join(vcs#escape(files), ' ')
+ \ ], ' ')
exec 'lcd ' . cwd
endfunction
View
1 autoload/vcs/svn/commit.vim
@@ -3,6 +3,7 @@ set cpo&vim
function! vcs#svn#commit#do(args)
let files = type(a:args) == type([]) ? a:args : [a:args]
+ " TODO: collect windows.
exec join([
\ '!',
\ 'svn',

0 comments on commit dd562b1

Please sign in to comment.
Something went wrong with that request. Please try again.