aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/git-shortcuts/ftplugin/git/git_shortcuts.vim
blob: 0b23ce173f8499c2246d3bad7f9d8bb39740b3e0 (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 <silent> <buffer> <Plug>GitShortcutsCommitBackward :call git_shortcuts#CommitBackward()<CR>
nnoremap <silent> <buffer> <Plug>GitShortcutsCommitForward :call git_shortcuts#CommitForward()<CR>

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