I am trying to emulate readline keybindings in insert and command-line modes (for example, <C-u>
for deleting from cursor position to beginning of the line, or <C-w>
to delete previous word). The readline action kill-line
deletes from the current cursor position to the end of the line, and it is usually bound to <C-k>
. I have managed to emulate it in insert mode with
inoremap <Plug>(i_kill-line) <Esc>lC
imap <C-k> <Plug>(i_kill-line)
How could I do something similar in command-line mode?
<C-k>
was recently added to my vocabulary, so I wanted to make it available in Vim.set -o vi
:)