On 20/09/09 17:41, [email protected] wrote:
>> For my edification, is there a way to detect if cscope is already
>> loaded,  I know you can run cs show to see if there is one running,
>> but how do code in vim?  Thanks.
>
> This will do it using Vim7.
>
> redir =>  cs_conns
> silent! exec 'cs show'
> redir END
>
> if cs_conns == 'no cscope connections'
> endif
>
> HTH,
> Dave
>
> Sent from my BlackBerry device on the Rogers Wireless Network

Doesn't work for me (there are linefeeds before and after) but it does 
if you replace the == operator ("is equal to") by the =~ operator 
("matches the pattern").

Or it would work for me as follows:

        if cs_conns == "\nno cscope connections\n\n"
                " do something
        endif

FWIW, I'm on gvim 7.2.266 (Huge GTK2/Gnome2) on openSUSE Linux.


Best regards,
Tony.
-- 
Canonical, adj.:
        The usual or standard state or manner of something.  A true
story:  One Bob Sjoberg, new at the MIT AI Lab, expressed some
annoyance at the use of jargon.  Over his loud objections, we made a
point of using jargon as much as possible in his presence, and
eventually it began to sink in.  Finally, in one conversation, he used
the word "canonical" in jargon-like fashion without thinking.
        Steele: "Aha!  We've finally got you talking jargon too!"
        Stallman: "What did he say?"
        Steele: "He just used `canonical' in the canonical way."

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to