Skip to content

Commit

Permalink
Restore legacy maps
Browse files Browse the repository at this point in the history
  • Loading branch information
tpope committed Jul 26, 2018
1 parent 46e0ce7 commit d632599
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions plugin/unimpaired.vim
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,20 @@ call s:map('n', '[o+', ':set cursorline cursorcolumn<CR>')
call s:map('n', ']o+', ':set nocursorline nocursorcolumn<CR>')
call s:map('n', 'yo+', ':set <C-R>=<SID>cursor_options()<CR><CR>')

function! s:legacy_option_map(letter) abort
let y = get(get(g:, 'nremap', {}), 'y', 'y')
return y . 'o' . a:letter . ':echo "Use ' . y . 'o' . a:letter . ' instead"' . "\<CR>"
endfunction

if empty(maparg('co', 'n'))
nmap <silent><expr> co <SID>legacy_option_map(nr2char(getchar()))
nnoremap cop <Nop>
endif
if empty(maparg('=o', 'n'))
nmap <silent><expr> =o <SID>legacy_option_map(nr2char(getchar()))
nnoremap =op <Nop>
endif

function! s:setup_paste() abort
let s:paste = &paste
let s:mouse = &mouse
Expand Down

0 comments on commit d632599

Please sign in to comment.