瀏覽代碼

Move text left and right with alt h/l

Andrew Swistak 8 年之前
父節點
當前提交
c7c7bf9e44
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. 7 0
      vimrc

+ 7 - 0
vimrc

@@ -127,6 +127,13 @@ nnoremap <silent> <A-k> :m-2<CR>==
 vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
 vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
 vnoremap <silent> <A-k> :m '<-2<CR>gv=gv
 vnoremap <silent> <A-k> :m '<-2<CR>gv=gv
 
 
+" Move text left/right via alt+[hl]
+nnoremap <silent> <A-l> "mx"mp
+nnoremap <silent> <A-h> "mxhh"mp
+" TODO: Maintain selection
+vnoremap <silent> <A-l> "mx"mp
+vnoremap <silent> <A-h> "mxhh"mp
+
 " Clear searches so there aren't underlined words.
 " Clear searches so there aren't underlined words.
 nnoremap <silent> <C-i> :nohlsearch<CR>
 nnoremap <silent> <C-i> :nohlsearch<CR>