فهرست منبع

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
acemouty 5 سال پیش
والد
کامیت
83c6bffda1
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      keys/mappings.vim

+ 6 - 0
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