aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/git-shortcuts/ftplugin/git/git_shortcuts.vim
blob: f57db667c0061541cfa6ea5a3517724ba04ccf66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
if exists('g:no_plugin_maps') || exists('g:no_git_shortcut_maps')
	finish
endif

let b:undo_ftplugin = ''

if !hasmapto('<Plug>GitShortcutsCommitBackward')
	nmap <buffer> [[ <Plug>GitShortcutsCommitBackward
	omap <buffer> [[ <Plug>GitShortcutsCommitBackward

	let b:undo_ftplugin .= '| nunmap <buffer> [['
	let b:undo_ftplugin .= '| ounmap <buffer> [['
endif

if !hasmapto('<Plug>GitShortcutsCommitForward')
	nmap <buffer> ]] <Plug>GitShortcutsCommitForward
	omap <buffer> ]] <Plug>GitShortcutsCommitForward

	let b:undo_ftplugin .= '| nunmap <buffer> ]]'
	let b:undo_ftplugin .= '| ounmap <buffer> ]]'
endif

nnoremap <buffer> <Plug>GitShortcutsCommitBackward :call git_shortcuts#CommitBackward()<CR>
nnoremap <buffer> <Plug>GitShortcutsCommitForward :call git_shortcuts#CommitForward()<CR>

onoremap <buffer> <Plug>GitShortcutsCommitBackward :call git_shortcuts#CommitBackward()<CR>
onoremap <buffer> <Plug>GitShortcutsCommitForward :call git_shortcuts#CommitForward()<CR>