What is the vim equivalent of emacs' ctrl-k?

How to remove from current cursor position to end of line in vim insert mode?

I know that you can do this with D in command mode, and I know that you can remove from the cursor position to the beginning of the line in insert mode with ctrl-u, so I assume this should be possible.

+5
source share
3 answers

If you are in insert mode and want to execute one command of the normal mode, you can press:

Ctrl + o

After executing the normal mode command, you will return to insert mode. So you can use D as follows:

Ctrl + o D

+7
source

There is no built-in method in VIM for this, but you can use this map to use Ctrl + k in VIM, as in Emacs:

 inoremap <Ck> <Del> 

However, if you want to use the digraph's built-in functions for VIM to write special characters, you must use a different keyword, for example.

0
source

There is no built-in equivalent (as far as I know).

The easiest way from the insert mode is to use Ctrl - O D.

If you want to match this with something easier to remember, you might want to create an insert-display mode that allows you to use normal D mode to delete characters under the cursor to the end of the line:

 :inoremap <Leader>k <CO>D 

Assuming that <Leader> is the default value \ , you should type \ k in insert mode, referring to the mapping.

Insert insert combinations are not without their flaws, as Kent points out in the comments, but have their own capabilities.

Ctrl - k is used to enter digraphs in Wim. I would suggest that you are not trying to redisplay this, although this is possible using the technique above.

0
source

Source: https://habr.com/ru/post/1200582/


All Articles