FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-21-2008, 11:04 PM
 
Default 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



--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 04-22-2008, 07:05 AM
Alex Samad
 
Default mutt + mailings list ( + vim)

On Tue, Apr 22, 2008 at 01:04:20AM +0200, hh.eu@gmx.de wrote:
> 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>).

thanks for that, exactly what I want


>
> 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
>
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.orgwith a
> subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
>

--
"President Musharraf, he's still tight with us on the war against terror, and that's what I appreciate. He's a -- he understands that we've got to keep Al Qaeda on the run, and that by keeping him on the run, it's more likely we will bring him to justice."

- George W. Bush
08/22/2002
Ruch, OR
 
Old 04-22-2008, 02:30 PM
Brian McKee
 
Default mutt + mailings list ( + vim)

On 21-Apr-08, at 7:04 PM, hh.eu@gmx.de wrote:


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>

[snippage]

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

[snippage]

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>).

[snippage]

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


Wouldn't 'c' be better than 'd<Esc>i' ?

Brian
 
Old 04-25-2008, 11:06 PM
Alex Samad
 
Default mutt + mailings list ( + vim)

On Tue, Apr 22, 2008 at 10:30:48AM -0400, Brian McKee wrote:
>
> On 21-Apr-08, at 7:04 PM, hh.eu@gmx.de wrote:
>
>> 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>
> [snippage]
>> map <C-S-F1> d<Esc>i<CR>[snip]<CR><Esc>
> [snippage]
>> 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>).
> [snippage]
>> You'll have to play around a bit to see how you want things when you
>> don't select full lines.
>
> Wouldn't 'c' be better than 'd<Esc>i' ?



For some reason <C-S-F1> did not register on so I tried it with ^[[23^
(got this from the manual, I type ctrl-V and then the keycombo)

>
> Brian
>



--
"Ah, you know the type. They like to blame it all on the Jews or the Blacks,
'cause if they couldn't, they'd have to wake up to the fact that life's one big,
scary, glorious, complex and ultimately unfathomable crapshoot -- and the only
reason THEY can't seem to keep up is they're a bunch of misfits and losers."
-- an analysis of neo-Nazis and such, Badger comics
 

Thread Tools




All times are GMT. The time now is 07:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org