summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoracemouty <[email protected]>2020-06-10 14:43:56 -0500
committeracemouty <[email protected]>2020-06-10 14:43:56 -0500
commit83c6bffda1b1d224efc8149722cdd28986890f42 (patch)
tree7af8b858bab69201118fa1732b966347afba6de2
parent778aa30b30df84af29f427c0d0d1a3ae0f305100 (diff)
feat: can move line selection
users can now move a single line or an entire block of text / code while in visual mode simply select what you need moved and then use shift + k to move the selection up shift + j to move the selection down
-rw-r--r--keys/mappings.vim6
1 files changed, 6 insertions, 0 deletions
diff --git a/keys/mappings.vim b/keys/mappings.vim
index 2801b7ff..94db7ddb 100644
--- a/keys/mappings.vim
+++ b/keys/mappings.vim
@@ -36,6 +36,12 @@ else
" SHIFT-TAB will go back
nnoremap <silent> <S-TAB> :bprevious<CR>
+ " Move selected line / block of text in visual mode
+ " shift + k to move up
+ " shift + j to move down
+ xnoremap K :move '<-2<CR>gv-gv
+ xnoremap J :move '>+1<CR>gv-gv
+
" Alternate way to save
nnoremap <silent> <C-s> :w<CR>
" Alternate way to quit