Skip to content

Instantly share code, notes, and snippets.

@ahaxu
Last active January 7, 2024 03:15
Show Gist options
  • Save ahaxu/2c49b0c657fbb289bb85166eda16bc7d to your computer and use it in GitHub Desktop.
Save ahaxu/2c49b0c657fbb289bb85166eda16bc7d to your computer and use it in GitHub Desktop.
vim rebind move up down when in insert mode or command mode
" In insert or command mode, move normally by using Ctrl
inoremap <C-h> <Left>
inoremap <C-j> <Down>
inoremap <C-k> <Up>
inoremap <C-l> <Right>
cnoremap <C-h> <Left>
cnoremap <C-j> <Down>
cnoremap <C-k> <Up>
cnoremap <C-l> <Right>
" if above not work, please use this for using `Tab` or `Shift + Tab`
inoremap <expr> <Tab> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
inoremap <expr> <S-Tab> coc#pum#visible() ? coc#pum#prev(1) : "\<S-Tab>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment