aboutsummaryrefslogtreecommitdiff
path: root/mappings.vim
diff options
context:
space:
mode:
authorjdhao <jdhao@hotmail.com>2020-09-27 21:29:46 +0800
committerjdhao <jdhao@hotmail.com>2020-09-27 21:29:46 +0800
commit5c4223b27dcf161d7b0f8c660d413425d9fefd0a (patch)
tree7a792d5a5994ee96332517abaed00f4cc0902e14 /mappings.vim
parent2d843076955b5978a9a6ce4ec1f647bdb1133275 (diff)
add mapping to move single or multiple lines
Diffstat (limited to 'mappings.vim')
-rw-r--r--mappings.vim8
1 files changed, 8 insertions, 0 deletions
diff --git a/mappings.vim b/mappings.vim
index 5c4a0a1..53f2ed7 100644
--- a/mappings.vim
+++ b/mappings.vim
@@ -167,4 +167,12 @@ nnoremap <silent> <leader>y :%y<CR>
" Toggle cursor column
nnoremap <silent> <leader>cl :call utils#ToggleCursorCol()<CR>
+
+" Move current line up and down
+nnoremap <silent> <A-k> <Cmd>call utils#SwitchLine(line('.'), 'up')<CR>
+nnoremap <silent> <A-j> <Cmd>call utils#SwitchLine(line('.'), 'down')<CR>
+
+" Move current visual-line selection up and down
+xnoremap <silent> <A-k> :<C-U>call utils#MoveSelection('up')<CR>
+xnoremap <silent> <A-j> :<C-U>call utils#MoveSelection('down')<CR>
"}