From 411609336b103e518e2f7d351dbcb7f818c5a865 Mon Sep 17 00:00:00 2001 From: Thomas Buckley-Houston Date: Mon, 12 Jun 2017 23:10:07 +0700 Subject: Paste over selection / And 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 for normal mode shortcut to `:` --- autoload/novim_mode.vim | 2 ++ spec/novim_mode_spec.rb | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) 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 : + nnoremap : " replaces native for one-time normal mode commands. inoremap @@ -134,6 +135,7 @@ function! g:SetNoVimModeShortcuts() set virtualedit=onemore " NB. All these use the named 'p' register. inoremap "pP + snoremap "pP snoremap "pyi inoremap "pY snoremap "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 ? type 'gone' after <<-EOF gone EOF end + + specify 'paste over selection' do + before <<-EOF + cut me and paste over me + EOF + + 7.times { type '' } + type '' + 10.times { type '' } + 7.times { type '' } + type '' + + after <<-EOF + and paste cut me + EOF + end end describe 'Pane control' do -- cgit v1.2.3-70-g09d2