Skip to content

Instantly share code, notes, and snippets.

View AnsonH's full-sized avatar
👾
Doing great

Anson Heung AnsonH

👾
Doing great
View GitHub Profile
@AnsonH
AnsonH / init.vim
Last active September 6, 2021 13:01
Vim Tip #3 - Move lines up and down with <A-k> and <A-j>
nnoremap <silent> <A-j> :m .+1<CR>==
nnoremap <silent> <A-k> :m .-2<CR>==
inoremap <silent> <A-j> <Esc>:m .+1<CR>==gi
inoremap <silent> <A-k> <Esc>:m .-2<CR>==gi
vnoremap <silent> <A-j> :m '>+1<CR>gv=gv
vnoremap <silent> <A-k> :m '<-2<CR>gv=gv