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

RE: un :source?

Expand Messages
  • Keith Roberts
    ... Why would you have a script in a vim plugins directory that you don t want vim to load? Unless, of course, you want it used for gvim, but not for vim? I
    Message 1 of 3 , Dec 1, 2003
    • 0 Attachment
      >-----Original Message-----
      >From: ryan kulla [mailto:toxicpulse@...]
      >Sent: Monday, December 01, 2003 1:09 PM
      >To: vim@...
      >Subject: un :source?
      >
      >how do you turn off a plugin from inside vim. like if i have a script file
      >in my plugins dir and i dont want it to be interpreted by vim. without
      >having to take the script out of the plugins directory and reload vim

      Why would you have a script in a vim plugins directory that you don't want
      vim to load? Unless, of course, you want it used for gvim, but not for vim?

      I the latter case, IIUC you can condition its execution with something like
      if has("gui_running")
    • Antoine J. Mechelynck
      ... There are two kinds of plugins, filtetype plugins (in the ftplugin directory) and global plugins (in the plugin directory). (Syntax fand indent scripts can
      Message 2 of 3 , Dec 1, 2003
      • 0 Attachment
        ryan kulla <toxicpulse@...> wrote:
        > how do you turn off a plugin from inside vim. like if i have a script
        > file in my plugins dir and i dont want it to be interpreted by vim.
        > without having to take the script out of the plugins directory and
        > reload vim

        There are two kinds of plugins, filtetype plugins (in the ftplugin
        directory) and global plugins (in the plugin directory). (Syntax fand indent
        scripts can be regarded as still more kinds of plugins but "plugin" doesn't
        enter in their names.) I'll assume you are talking about a global plugin.

        The very reason to put a vim script in the plugin directory is in order to
        force vim to source it every time, after your vimrc but (if in GUI mode)
        before your gvimrc.

        Some plugins may define functions or commands to switch off their action,
        but that is entirely at the discretion of the plugin author. To see if your
        particular plugin is of that kind, you might either try the help (if any)
        for the plugin, or

        :view <dirname>/plugin/<filename>.vim

        where <dirname> is one of the directories in your 'runtimepath', and
        <filename>.vim is the name of the plugin script.

        If you want a particular script to run only on demand, and not every time
        (g)vim is started, then the plugin directory is not the right place for it.

        HTH,
        Tony.
      Your message has been successfully submitted and would be delivered to recipients shortly.