Thursday, December 29, 2011

Re: mutt and vim playing together

Tim Chase wrote:

> On 12/29/11 08:16, Kai Weber wrote:
>>
>> * Marc Weber<marco-oweber@gmx.de>:
>>
>>>> So everytime I edit a mail the first line and following manually
>>>> inserted blank
>>>> lines are highlighted.
>>>
>>> Why do you need this?
>>> Use syntax commands instead.
>>
>>
>> Syntax highlighting is not what I look for.
>>
>> 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).
>
> -tim


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 @/ = ""'

See :help quote/

-- Dominique

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