Skip to content

Commit

Permalink
Don't override =o or co with warnings
Browse files Browse the repository at this point in the history
Closes #155
  • Loading branch information
tpope committed May 13, 2018
1 parent d1cdafb commit 86823a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin/unimpaired.vim
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,18 @@ call s:map('n', 'yox', ':set <C-R>=<SID>cursor_options()<CR><CR>')
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>')
nmap =o yo

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

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

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

1 comment on commit 86823a1

@vojtechpachol
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be also a check for omap o.

Please sign in to comment.