diff options
author | Thomas Buckley-Houston | 2017-06-12 16:10:07 +0000 |
---|---|---|
committer | Thomas Buckley-Houston | 2017-06-12 16:10:07 +0000 |
commit | 411609336b103e518e2f7d351dbcb7f818c5a865 (patch) | |
tree | af1634b051d44cb94366447a691064cd1da994be | |
parent | 86e4f10b26be46b2160b344b48ab2776b54c0272 (diff) |
Paste over selection / And <Alt-o> for normal mode
So when you paste something and there's an active selection of text then
the selection is replaced by that which is pasted.
Also, includes <Alt-o> for normal mode shortcut to `:`
-rw-r--r-- | autoload/novim_mode.vim | 2 | ||||
-rw-r--r-- | spec/novim_mode_spec.rb | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/autoload/novim_mode.vim b/autoload/novim_mode.vim index a8de55a..4a566ac 100644 --- a/autoload/novim_mode.vim +++ b/autoload/novim_mode.vim @@ -92,6 +92,7 @@ function! g:SetNoVimModeShortcuts() " ALT+; for command prompt inoremap <M-;> <C-O>: + nnoremap <M-;> : " <ALT+o> replaces native <C-O> for one-time normal mode commands. inoremap <M-o> <C-O> @@ -134,6 +135,7 @@ function! g:SetNoVimModeShortcuts() set virtualedit=onemore " NB. All these use the named 'p' register. inoremap <C-V> <C-O>"pP + snoremap <C-V> <C-O>"pP snoremap <C-C> <C-O>"pyi inoremap <C-C> <C-O>"pY snoremap <C-X> <C-O>"pxi diff --git a/spec/novim_mode_spec.rb b/spec/novim_mode_spec.rb index b960b10..0b99674 100644 --- a/spec/novim_mode_spec.rb +++ b/spec/novim_mode_spec.rb @@ -66,13 +66,28 @@ describe 'Basic editing' do select me EOF - # Conventional behaviour shouldn't need the <End>? type '<C-a>gone' after <<-EOF gone EOF end + + specify 'paste over selection' do + before <<-EOF + cut me and paste over me + EOF + + 7.times { type '<S-Right>' } + type '<C-x>' + 10.times { type '<Right>' } + 7.times { type '<S-Right>' } + type '<C-v>' + + after <<-EOF + and paste cut me + EOF + end end describe 'Pane control' do |