Skip to content

Instantly share code, notes, and snippets.

@phcostabh
Created August 20, 2014 16:24
Show Gist options
  • Save phcostabh/d5a2e8024a69b6fcd973 to your computer and use it in GitHub Desktop.
Save phcostabh/d5a2e8024a69b6fcd973 to your computer and use it in GitHub Desktop.
" Normal mode
nnoremap <C-j> :m .+1<CR>==
nnoremap <C-k> :m .-2<CR>==
" Insert mode
inoremap <C-j> <ESC>:m .+1<CR>==gi
inoremap <C-k> <ESC>:m .-2<CR>==gi
" Visual mode
vnoremap <C-j> :m '>+1<CR>gv=gv
vnoremap <C-k> :m '<-2<CR>gv=gv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment