Loading ...
Sorry, an error occurred while loading the content.

Re: Programmatically detecting whether plugin scripts loaded?

Expand Messages
  • lith
    ... Then: many plugins define a variable g:loaded_PLUGIN_NAME that is used by the plugin to make sure the file is sourced only once. You could query that
    Message 1 of 6 , Jul 10 10:39 AM
    • 0 Attachment
      > set rtp+=~/y/plugin/y.vim
      >
      > part was a typo

      Then: many plugins define a variable g:loaded_PLUGIN_NAME that is used by the plugin to make sure the file is sourced only once. You could query that variable with exists('g:loaded_PLUGIN_NAME').

      Otherwise you can redirect (:h :redir) the output of scriptnames (:h :scriptnames) as suggested by ZyX and then match that string against the filename of the plugin.

      It depends on why you want to check if the plugin was loaded.

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

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.