Thursday, December 29, 2011

Re: mutt and vim playing together

On 12/29/11 10:38, Dominique Pellé wrote:
> Tim Chase wrote:
>> On 12/29/11 08:16, Kai Weber wrote:
>>> What I want to achieve is jumping to the first blank line
>>> where I can start typing my mail instantly. So I search
>>> for ^$ and vim jumps to the first occurrence (with the
>>> consequences I wrote in my first mail).
>>
>>
>> You could just issue a "noh" after your search:
>>
>> vim +'/^$/' -c'set hls' -c'noh'
>>
>> should do the trick (I don't have 'hls' set in my vimrc, so
>> I added it on the command-line to test).
>
>
> If you want to keep the 'hls' option (so further searches
> while reading or editing your email will still be
> highlighted), you could set the "/ register to an empty string
> right after jumping after the first empty line with something
> like this:
>
> vim +'/^$/+1' +'let @/ = ""'

I guess the difference between using ":noh" and "let @/=''" would
be whether your viminfo keeps track of your most recent search,
and if so, whether you want it upon starting to compose your
email. Using ":noh" just tells it not to highlight the searched
item, while the ":let" clears the search completely (overriding
what the viminfo may have held).

-tim


--
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:

Post a Comment