Friday, May 28, 2010

Re: How to avoid returning to the beginning when I search for one string

On 05/27/2010 10:29 PM, John Beckett wrote:
> robert song wrote:
>> I search for one string in vim with "n", but if all strings
>> is searched, it will return to the beginning of the file.
>
> See 'nowrapscan' at:
> http://vim.wikia.com/wiki/Searching
>
> However, the better answer is to get used to it because it is
> very useful in practice! What you need to do is have a prominent
> message when wrap around occurs so you don't wonder when it has
> happened. For example:
>
> :hi WarningMsg ctermfg=15 ctermbg=12 guifg=White guibg=Red gui=NONE

Even with a prominent warning, it can still be easy to miss in
some cases -- I usually fly with the default 'wrapscan', but when
searching long CSV/tab-delim files, I am visually focused on the
hits, not elsewhere on the screen (where the msg is), often
hitting "n" dozens if not hundreds of times. This "road
hypnotism" leads me to temporarily set 'nowrapscan' and search
from the top -- it's much easier to see when you've hit the
bottom if nothing changes visually even after multiple hits of
"n". Not something I use often, but about twice a month, I'm
glad to have the option to change the behavior.

-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

Formatting help files

Hi.
I have some help files along with my scripts and I wanto give them a better formatting.
So far the text layout is not too  bad, but I am wondering is there is anyway to make some letter to appear as bold or italic, like when you write a wiki.
Is this possible with vim help files format????
thanks

--
Un saludo
Best Regards
Pablo Giménez

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

Re: Any command to format C source in a nice way?

On Fri, May 28, 2010 at 7:26 AM, robert song <robertsong.japan@gmail.com> wrote:
> Is there any command to format the specified line directly?
>

You can try uncrustify http://uncrustify.sourceforge.net/

But you example is a hard one, how can you decide what is "nice way"?
Can you post it formated?

Regards,
Kazuo

--
«Dans la vie, rien n'est à craindre, tout est à comprendre»
Marie Sklodowska Curie.

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

Any command to format C source in a nice way?

Hi, everyone.

Sometimes C codes in some files are hard to read,
for example:
if (!(({ unsigned long flag, roksum; (void)0; __asm__("adds %1, %2,
%3; sbcccs %1, %1, %0; movcc %0, #0" : "=&r" (flag), "=&r" (roksum) :
"r" (buf), "Ir" (count), "0" (current_thread_info()->addr_limit) :
"cc"); flag; }) == 0))
return -14;

Is there any command to format the specified line directly?

Best Regards,
robert

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

Re: Syntax Highlighting Minor Groups

Okay, I went here:

http://stackoverflow.com/questions/1199267/braces-and-operators-coloring-in-vim-for-c/1199578#1199578

Tried the following code to see the operator classification:

:map <F3> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '>
trans<' . synIDattr(synID(line("."),col("."),0),"name") . "> lo<" .
synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>


And apparently there's no group for the brackets, ++, ;, etc. operators.
Which means we would have to do this with pattern matching huh?


airforceone wrote:
>
> Jürgen,
>
> Thanks! It works! But, for some reason, I am unable to get the Operator
> minor group highlighting to work.
>
> For example,
>
> hi Operator gui=none guifg=Red
>
> Doesn't work for some reason...
>
>
>
>
>
>
> Jürgen Krämer-4 wrote:
>>
>>
>> Hi,
>>
>> airforceone schrieb:
>>>
>>> I'm trying to figure out how to highlight specific portions of the
>>> syntax.
>>> Take a look at this (taken from the vim documentation):
>>>
>>> *Statement any statement
>>> Conditional if, then, else, endif, switch, etc.
>>> Repeat for, do, while, etc.
>>> Label case, default, etc.
>>> Operator "sizeof", "+", "*", etc.
>>> Keyword any other keyword
>>> Exception try, catch, throw
>>>
>>> We can do syntax highlighting for the Statement syntax by doing the
>>> following in vimrc:
>>>
>>> hi Statement gui=none guifg=Red
>>>
>>> That command will apply highlighting to all the minor groups as well
>>> (conditional, repeat, etc.)
>>>
>>> Is it possible to apply highlighting to a specific group (conditional,
>>> repeat, label, etc), rather than the major group (statement)?
>>>
>>> I tried doing pattern matching but that takes way too much work...
>>
>> have you tried
>>
>> hi Conditional guifg=Red
>>
>> ?
>>
>> This worked for me.
>>
>> Regards,
>> Jürgen
>>
>> --
>> Sometimes I think the surest sign that intelligent life exists elsewhere
>> in the universe is that none of it has tried to contact us. (Calvin)
>>
>> --
>> 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
>>
>>
>
>

--
View this message in context: http://old.nabble.com/Syntax-Highlighting-Minor-Groups-tp28702384p28703822.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

Re: Syntax Highlighting Minor Groups

Jürgen,

Thanks! It works! But, for some reason, I am unable to get the Operator
minor group highlighting to work.

For example,

hi Operator gui=none guifg=Red

Doesn't work for some reason...


Jürgen Krämer-4 wrote:
>
>
> Hi,
>
> airforceone schrieb:
>>
>> I'm trying to figure out how to highlight specific portions of the
>> syntax.
>> Take a look at this (taken from the vim documentation):
>>
>> *Statement any statement
>> Conditional if, then, else, endif, switch, etc.
>> Repeat for, do, while, etc.
>> Label case, default, etc.
>> Operator "sizeof", "+", "*", etc.
>> Keyword any other keyword
>> Exception try, catch, throw
>>
>> We can do syntax highlighting for the Statement syntax by doing the
>> following in vimrc:
>>
>> hi Statement gui=none guifg=Red
>>
>> That command will apply highlighting to all the minor groups as well
>> (conditional, repeat, etc.)
>>
>> Is it possible to apply highlighting to a specific group (conditional,
>> repeat, label, etc), rather than the major group (statement)?
>>
>> I tried doing pattern matching but that takes way too much work...
>
> have you tried
>
> hi Conditional guifg=Red
>
> ?
>
> This worked for me.
>
> Regards,
> Jürgen
>
> --
> Sometimes I think the surest sign that intelligent life exists elsewhere
> in the universe is that none of it has tried to contact us. (Calvin)
>
> --
> 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
>
>

--
View this message in context: http://old.nabble.com/Syntax-Highlighting-Minor-Groups-tp28702384p28703750.html
Sent from the Vim - General mailing list archive at Nabble.com.

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

Thursday, May 27, 2010

Re: How to recover files after vim crash?

On Fri, May 28, 2010 7:36 am, robert song wrote:
> Sometimes vim freezes by some mis-operation, and I should kill it.

That really shouldn't happen. In what context does this happen to you?

> In this way, all the opened file are lost, Is it able to reload the
> files once again after I open the vim just like the session-manager in
> firefox?

Not sure. You can probably script something like this. May be, it works
already when including the % in your viminfo file.

regards,
Christian

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