Tuesday, November 1, 2011

Re: mapping ALT-backspace

On 02/11/11 03:53, meino.cramer@gmx.de wrote:
> Hi,
>
> the zsh I am using is recoginzing ALT-backspace as "delete one
> word backward", which is very handy.
>
> Unfortunately I have not found a way to map this in a similiar
> way for vim.
>
> How can I map ALT-backspace in vim?
>
> Thank you very much in advance for any help!
> Best regards,
> mcc
>

In Console Vim, it may depend on your terminal: I'm not sure that every
terminal passes something recognizable to Vim when you hit Alt-Backspace.

In gvim, it's <M-BS> and my gvim (with GTK2/Gnome2 GUI) sees it.

To see if Vim gets something when you hit that key combo, open Vim in
Insert mode in an empty buffer and hit Ctrl-V followed by Alt-Backspace,
then Ctrl-K followed by Alt-Backspace. If you don't get anything, Vim
hasn't seen the keypress. If it sees something, in gvim you should see
the <> equivazlent in both cases; in Console Vim you should see the
bytes passed by the keyboard interface after Ctrl-V, or the <>
equivalent (here, <M-BS>, unless the keyboard passes something else)
after Ctrl-K.

In Insert mode, to delete the word before the cursor you can hit Ctrl-W,
see :help i_CTRL-W

In Normal mode, you should be able to use Shift-Left as a modifier to
the d (delete) command, to delete [count] words leftwards, or the
command daw ("delete a word") to delete the word under the cursor (on
both sides) and the white space on one side of it. See :help text-objects


Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
209. Your house stinks because you haven't cleaned it in a week.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: