[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mutt + mailings list ( + vim)



Am 21.04.2008 um 23:45 schrieb Alex Samad:
so whilst viewing an email, I press shift-l, this starts vim with the
emails, I then use up and down arrows and v to highlight some text, I
would then like to press <some key combo> and have the text replaced by
<cr>[snip]<cr>

I haven't used this before, but try putting something like this into
your ~/.vimrc file:

map <C-S-F1> d<Esc>i<CR>[snip]<CR><Esc>

This will create a shortcut for Ctrl+Shift+F1 (think of a better one, I
used this for testing to make sure I didn't interfere with the defaults).

You make a selection in vim, i.e. press Shift+v, then go down a few
lines, and then press the shortcut, which will delete the selection (d),
go into insert mode (i) and put in your text and then leave insert mode
again (<Esc>).

So actually it's pretty easy. Type

:help key-mapping

in vim for more info.

You'll have to play around a bit to see how you want things when you
don't select full lines.

-Moritz



Reply to: