tpope / vim-rsi

rsi.vim: Readline style insertion
http://www.vim.org/scripts/script.php?script_id=4359
583 stars 35 forks source link

Add Ctrl-K mapping for command mode #15

Closed jgdavey closed 10 years ago

jgdavey commented 10 years ago

I use this so much at the command line that I frequently do the same in vim.

Ctrl-K deletes "⇥ from the cursor to the end of the line"

There's probably an elegant way to do this using mappings, but I'm not sure how.

jgdavey commented 10 years ago

It's worth noting that that is currently mapped to inserting digraphs, and a <C-K> mapping would stomp on that. Not sure how to get around that either.

tpope commented 10 years ago

Yeah I consider the conflict with digraphs severe enough that I'm not really willing to entertain making it a part of rsi.vim.

jeromedalbert commented 8 years ago

FYI, for anyone interested in a way to do this:

inoremap <c-k> <c-o>D
cnoremap <c-k> <c-\>e getcmdpos() == 1 ? '' : getcmdline()[:getcmdpos()-2]<CR>

(since OS X has pretty good digraph support for my needs, I am OK with overriding ctrl-k)