Vim: Eclipse-like Ctrl-Backspace and Ctrl-Del

Eclipse has a nice function of deleting a word to the next capital letter when pressing Ctrl + Backspace . For example:

ThisIsSomeText

If you press Ctrl + Backspace , only “Text” will be deleted, where, as in VS, all “ThisIsSomeText” will be deleted.

Is there a way to implement the same in VIM?

If so, is there a similar method for Ctrl - Del ? That pressing Ctrl - Del at the beginning of the previous example will delete only "This", and not the entire "ThisIsSomeText".

+6
vim
source share
2 answers

I don't think this is a native vim function, but I think this script can help (note: I didn't actually use it myself): http://www.vim.org/scripts/script.php?script_id = 1356 & rating = life_changing

Update:

Another script: http://www.vim.org/scripts/script.php?script_id=1905

+4
source share

This can do what you want:

nnoremap <C-BS> d?[AZ] 

There may be some uncertainty in the last word. In addition, you did not specify whether you want it for Normal or Insert mode.

+4
source share

All Articles