Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created February 11, 2017 13:35
Show Gist options
  • Save nelstrom/d08d342501d59abdac95b9d28fdb4cfc to your computer and use it in GitHub Desktop.
Save nelstrom/d08d342501d59abdac95b9d28fdb4cfc to your computer and use it in GitHub Desktop.
if exists(':terminal')
" Readline cheatsheet:
" ctrl-a - jump to start of line
" ctrl-e - jump to end of line
" ctrl-k - kill forwards to the end of line
" ctrl-u - kill backwards to the start of line
autocmd TermOpen * nnoremap <buffer> I I<C-a>
autocmd TermOpen * nnoremap <buffer> A A<C-e>
autocmd TermOpen * nnoremap <buffer> C A<C-k>
autocmd TermOpen * nnoremap <buffer> D A<C-k><C-\><C-n>
autocmd TermOpen * nnoremap <buffer> cc A<C-e><C-u>
autocmd TermOpen * nnoremap <buffer> dd A<C-e><C-u><C-\><C-n>
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment