From 269dd0940dec8084d6a5d5af63c6c34a34b5342c Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Tue, 12 Dec 2017 22:48:01 +0800 Subject: [PATCH 1/3] reimplement move text down and up, use native move command with force silent mode --- autoload/SpaceVim/layers/edit.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index 8d73a74fe..d3cd9973f 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -211,7 +211,7 @@ function! s:text_transient_state() abort \ 'key' : 'J', \ 'desc' : 'move text down', \ 'func' : '', - \ 'cmd' : 'noautocmd normal! "_ddp', + \ 'cmd' : 'silent! m .+1', \ 'exit' : 0, \ }, \ ], @@ -220,7 +220,7 @@ function! s:text_transient_state() abort \ 'key' : 'K', \ 'func' : '', \ 'desc' : 'move text up', - \ 'cmd' : 'noautocmd exe line(".") == 1 ? "" : "normal! \"_ddkP"', + \ 'cmd' : 'silent! m .-2', \ 'exit' : 0, \ }, \ ], From 591670a0459c146dde073ff1fe6422bd29ce3b36 Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Wed, 13 Dec 2017 15:44:36 +0800 Subject: [PATCH 2/3] add noautocmd when moving lines up or down --- autoload/SpaceVim/layers/edit.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index d3cd9973f..bf72fb0a5 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -211,7 +211,7 @@ function! s:text_transient_state() abort \ 'key' : 'J', \ 'desc' : 'move text down', \ 'func' : '', - \ 'cmd' : 'silent! m .+1', + \ 'cmd' : 'noautocmd silent! m .+1', \ 'exit' : 0, \ }, \ ], @@ -219,7 +219,7 @@ function! s:text_transient_state() abort \ { \ 'key' : 'K', \ 'func' : '', - \ 'desc' : 'move text up', + \ 'desc' : 'noautocmd move text up', \ 'cmd' : 'silent! m .-2', \ 'exit' : 0, \ }, From 70e166f441bedf3f3b75de876d0dec06f006110d Mon Sep 17 00:00:00 2001 From: Arith Xu Date: Wed, 13 Dec 2017 18:46:30 +0800 Subject: [PATCH 3/3] fix funny mistake --- autoload/SpaceVim/layers/edit.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/SpaceVim/layers/edit.vim b/autoload/SpaceVim/layers/edit.vim index bf72fb0a5..68a066448 100644 --- a/autoload/SpaceVim/layers/edit.vim +++ b/autoload/SpaceVim/layers/edit.vim @@ -219,8 +219,8 @@ function! s:text_transient_state() abort \ { \ 'key' : 'K', \ 'func' : '', - \ 'desc' : 'noautocmd move text up', - \ 'cmd' : 'silent! m .-2', + \ 'desc' : 'move text up', + \ 'cmd' : 'noautocmd silent! m .-2', \ 'exit' : 0, \ }, \ ],