git-control.vim 452 Bytes
Newer Older
Moritz Sokoll's avatar
Moritz Sokoll committed
1
2
3
4
5
6
7
8
9
10
" Name: git-control
" Author: Moritz Sokoll
" Description: a git version conrol integration for vim

if exists('g:git_control_loaded')
	finish
endif

function! Git_Commit()
	let commit_message = input('commit message: ')
Moritz Sokoll's avatar
Moritz Sokoll committed
11
	echo ''
Moritz Sokoll's avatar
ye    
Moritz Sokoll committed
12
	if len(commit_message) < 1
Moritz Sokoll's avatar
Moritz Sokoll committed
13
		echo 'message too short'
Moritz Sokoll's avatar
Moritz Sokoll committed
14
15
16
17
18
19
	else
		let stat = system("git commit -am '" . commit_message . "'")
		echo stat
	endif
endfunction

Moritz Sokoll's avatar
Moritz Sokoll committed
20
command! GitCommit call Git_Commit()
Moritz Sokoll's avatar
Moritz Sokoll committed
21
let g:git_control_loaded = 1