Deprecate CTRL-N and CTRL-P

This commit is contained in:
Tim Pope
2021-08-14 10:21:27 -04:00
parent bec8e7b7c7
commit f3e92c7721

View File

@@ -6886,12 +6886,8 @@ function! fugitive#MapJumps(...) abort
call s:Map('n', 'p', ':<C-U>exe <SID>GF("pedit")<CR>', '<silent>') call s:Map('n', 'p', ':<C-U>exe <SID>GF("pedit")<CR>', '<silent>')
if !exists('g:fugitive_no_maps') if !exists('g:fugitive_no_maps')
if exists(':CtrlP') && get(g:, 'ctrl_p_map') =~? '^<c-p>$' call s:Map('n', '<C-P>', ':exe <SID>PreviousItem(v:count1)<Bar>echohl WarningMsg<Bar>echo "CTRL-P is deprecated in favor of ("<Bar>echohl NONE<CR>', '<unique>')
nnoremap <buffer> <silent> <C-P> :<C-U>execute line('.') == 1 ? 'CtrlP ' . s:fnameescape(<SID>Tree()) : <SID>PreviousItem(v:count1)<CR> call s:Map('n', '<C-N>', ':exe <SID>NextItem(v:count1)<Bar>echohl WarningMsg<Bar>echo "CTRL-N is deprecated in favor of )"<Bar>echohl NONE<CR>', '<unique>')
else
nnoremap <buffer> <silent> <C-P> :<C-U>execute <SID>PreviousItem(v:count1)<CR>
endif
nnoremap <buffer> <silent> <C-N> :<C-U>execute <SID>NextItem(v:count1)<CR>
endif endif
call s:MapMotion('(', 'exe <SID>PreviousItem(v:count1)') call s:MapMotion('(', 'exe <SID>PreviousItem(v:count1)')
call s:MapMotion(')', 'exe <SID>NextItem(v:count1)') call s:MapMotion(')', 'exe <SID>NextItem(v:count1)')