Skip to content

Commit d632599

Browse files
committed
Restore legacy maps
1 parent 46e0ce7 commit d632599

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Diff for: plugin/unimpaired.vim

+14
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,20 @@ call s:map('n', '[o+', ':set cursorline cursorcolumn<CR>')
284284
call s:map('n', ']o+', ':set nocursorline nocursorcolumn<CR>')
285285
call s:map('n', 'yo+', ':set <C-R>=<SID>cursor_options()<CR><CR>')
286286

287+
function! s:legacy_option_map(letter) abort
288+
let y = get(get(g:, 'nremap', {}), 'y', 'y')
289+
return y . 'o' . a:letter . ':echo "Use ' . y . 'o' . a:letter . ' instead"' . "\<CR>"
290+
endfunction
291+
292+
if empty(maparg('co', 'n'))
293+
nmap <silent><expr> co <SID>legacy_option_map(nr2char(getchar()))
294+
nnoremap cop <Nop>
295+
endif
296+
if empty(maparg('=o', 'n'))
297+
nmap <silent><expr> =o <SID>legacy_option_map(nr2char(getchar()))
298+
nnoremap =op <Nop>
299+
endif
300+
287301
function! s:setup_paste() abort
288302
let s:paste = &paste
289303
let s:mouse = &mouse

0 commit comments

Comments
 (0)