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

rtp hacks, sourcing after/*

Expand Messages
  • Marc Weber
    Eg vim does not load after/* files when looking at rtp on startup. Is this good or bad? VAM works around it - because there are some plugins using after/*
    Message 1 of 9 , May 27, 2013
    • 0 Attachment
      Eg vim does not load after/* files when looking at rtp on startup.

      Is this good or bad? VAM works around it - because there are some
      plugins using after/* files. I'm not sure whether plugins or Vim
      should be fixed.

      If we are about creating a new major release there are two choices:
      - feel proud that VAM works around it
      - also allow minimal solutions to work, patch Vim

      Is this something we want to be fixed?

      Marc Weber

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... Would you please explain this problem more fully? I don t observe it. Vim always loads the plugins in my ~/.vim/after directories. Regards, Gary -- --
      Message 2 of 9 , May 27, 2013
      • 0 Attachment
        On 2013-05-27, Marc Weber wrote:
        > Eg vim does not load after/* files when looking at rtp on startup.

        Would you please explain this problem more fully? I don't observe
        it. Vim always loads the plugins in my ~/.vim/after directories.

        Regards,
        Gary

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • ZyX
        ... Vim does not source ~/.vim/after files either: it is just a default setting of &runtimepath. Aside from what you think, there is *no* after/ special
        Message 3 of 9 , May 27, 2013
        • 0 Attachment
          понедельник, 27 мая 2013 г., 23:27:20 UTC+4 пользователь MarcWeber написал:
          > Eg vim does not load after/* files when looking at rtp on startup.
          >
          > Is this good or bad? VAM works around it - because there are some
          > plugins using after/* files. I'm not sure whether plugins or Vim
          > should be fixed.
          >
          > If we are about creating a new major release there are two choices:
          > - feel proud that VAM works around it
          > - also allow minimal solutions to work, patch Vim
          >
          > Is this something we want to be fixed?

          Vim does not source ~/.vim/after files either: it is just a default setting of &runtimepath. Aside from what you think, there is *no* after/ special directory, vim itself is using the same hack. Thus I do not think there is anything to fix here: `:h after-directory` lists these directories in one list with system-wide and user configuration directories.

          --
          --
          You received this message from the "vim_dev" 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_dev" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        • Marc Weber
          ... vam, vundle, pathogen (and others) do no longer store plugins in ~/.vim because its hard to - select a subset of plugins to load conditionally - its hard
          Message 4 of 9 , May 27, 2013
          • 0 Attachment
            Excerpts from Gary Johnson's message of Mon May 27 21:47:26 +0200 2013:
            > Would you please explain this problem more fully? I don't observe
            > it. Vim always loads the plugins in my ~/.vim/after directories.

            vam, vundle, pathogen (and others) do no longer store plugins in ~/.vim
            because its hard to
            - select a subset of plugins to load conditionally
            - its hard to remove plugins (you have to keep track of files belonging
            to plugins)

            The solution:

            set rtp+=~/your-one-plugin-dir-1

            Then a lot of standard files don't work


            ==========================================
            test case (run in your shell, eventually )

            ##### backup:
            mkdir vim-your-setup
            mv .vim vim-your-setup
            mv .vimrc vim-your-setup


            #### prepare test case
            # now create files
            cat >> ~/.vimrc <<EOF
            set nocompatible
            set hidden
            filetype indent plugin on | syn on
            set rtp+=~/A"

            EOF


            write_files(){
            local T="$1"
            local ID="$2"

            mkdir -p $T/after/{ftplugin,plugin} $T/ftdetect
            echo "echoe 'ftplugin html $ID'" > $T/after/ftplugin/html.vim
            echo "echoe 'plugin $ID'" > $T/after/plugin/html.vim
            echo "echoe 'ftdetect $ID'" > $T/ftdetect/test.vim
            }

            write_files $HOME/A "test-plugin"
            write_files $HOME/.vim "standard"



            #### run case
            vim
            then :e test.html
            then :messages

            output:

            Error detected while processing /home/marc/.vim/ftdetect/test.vim:
            line 1:
            ftdetect standard
            Error detected while processing /home/marc/.vim/after/plugin/html.vim:
            line 1:
            plugin standard
            "test.html" 7L, 40C
            Error detected while processing /home/marc/.vim/after/ftplugin/html.vim:
            line 1:
            ftplugin html standard

            You'll notice that the ftdetect files and the after files from the
            plugin were not sourced.
            Otherwise you'd find messages with the id "test-plugin" in addition to
            "standard".

            VAM works around this by sourcing those on
            behalf of the user (except the after/ftplugin case, nobody reported this
            to be an issue yet)

            Marc Weber

            --
            --
            You received this message from the "vim_dev" 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_dev" group.
            To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
            For more options, visit https://groups.google.com/groups/opt_out.
          • Gary Johnson
            ... That was very thorough. Thank you. I did that and saw exactly the output that you posted. ... But I see them in the output of :scriptnames: 1: ~/.vimrc
            Message 5 of 9 , May 27, 2013
            • 0 Attachment
              On 2013-05-27, Marc Weber wrote:
              > Excerpts from Gary Johnson's message of Mon May 27 21:47:26 +0200 2013:
              > > Would you please explain this problem more fully? I don't observe
              > > it. Vim always loads the plugins in my ~/.vim/after directories.
              >
              > vam, vundle, pathogen (and others) do no longer store plugins in ~/.vim
              > because its hard to
              > - select a subset of plugins to load conditionally
              > - its hard to remove plugins (you have to keep track of files belonging
              > to plugins)
              >
              > The solution:
              >
              > set rtp+=~/your-one-plugin-dir-1
              >
              > Then a lot of standard files don't work
              >
              >
              > ==========================================
              > test case (run in your shell, eventually )
              >
              > ##### backup:
              > mkdir vim-your-setup
              > mv .vim vim-your-setup
              > mv .vimrc vim-your-setup
              >
              >
              > #### prepare test case
              > # now create files
              > cat >> ~/.vimrc <<EOF
              > set nocompatible
              > set hidden
              > filetype indent plugin on | syn on
              > set rtp+=~/A"
              >
              > EOF
              >
              >
              > write_files(){
              > local T="$1"
              > local ID="$2"
              >
              > mkdir -p $T/after/{ftplugin,plugin} $T/ftdetect
              > echo "echoe 'ftplugin html $ID'" > $T/after/ftplugin/html.vim
              > echo "echoe 'plugin $ID'" > $T/after/plugin/html.vim
              > echo "echoe 'ftdetect $ID'" > $T/ftdetect/test.vim
              > }
              >
              > write_files $HOME/A "test-plugin"
              > write_files $HOME/.vim "standard"
              >
              >
              >
              > #### run case
              > vim
              > then :e test.html
              > then :messages
              >
              > output:
              >
              > Error detected while processing /home/marc/.vim/ftdetect/test.vim:
              > line 1:
              > ftdetect standard
              > Error detected while processing /home/marc/.vim/after/plugin/html.vim:
              > line 1:
              > plugin standard
              > "test.html" 7L, 40C
              > Error detected while processing /home/marc/.vim/after/ftplugin/html.vim:
              > line 1:
              > ftplugin html standard

              That was very thorough. Thank you. I did that and saw exactly the
              output that you posted.

              > You'll notice that the ftdetect files and the after files from the
              > plugin were not sourced.
              > Otherwise you'd find messages with the id "test-plugin" in addition to
              > "standard".

              But I see them in the output of :scriptnames:

              1: ~/.vimrc
              2: /usr/local/share/vim/vim73/filetype.vim
              3: ~/.vim/ftdetect/test.vim
              4: /usr/local/share/vim/vim73/ftplugin.vim
              5: /usr/local/share/vim/vim73/indent.vim
              6: /usr/local/share/vim/vim73/syntax/syntax.vim
              7: /usr/local/share/vim/vim73/syntax/synload.vim
              8: /usr/local/share/vim/vim73/syntax/syncolor.vim
              9: /usr/local/share/vim/vim73/plugin/getscriptPlugin.vim
              10: /usr/local/share/vim/vim73/plugin/gzip.vim
              11: /usr/local/share/vim/vim73/plugin/matchparen.vim
              12: /usr/local/share/vim/vim73/plugin/netrwPlugin.vim
              13: /usr/local/share/vim/vim73/plugin/rrhelper.vim
              14: /usr/local/share/vim/vim73/plugin/spellfile.vim
              15: /usr/local/share/vim/vim73/plugin/tarPlugin.vim
              16: /usr/local/share/vim/vim73/plugin/tohtml.vim
              17: /usr/local/share/vim/vim73/plugin/vimballPlugin.vim
              18: /usr/local/share/vim/vim73/plugin/zipPlugin.vim
              19: ~/.vim/after/plugin/html.vim
              20: /usr/local/share/vim/vim73/ftplugin/html.vim
              21: ~/.vim/after/ftplugin/html.vim
              22: /usr/local/share/vim/vim73/indent/html.vim
              23: /usr/local/share/vim/vim73/syntax/html.vim
              24: /usr/local/share/vim/vim73/syntax/javascript.vim
              25: /usr/local/share/vim/vim73/syntax/vb.vim
              26: /usr/local/share/vim/vim73/syntax/css.vim

              > VAM works around this by sourcing those on
              > behalf of the user (except the after/ftplugin case, nobody reported this
              > to be an issue yet)

              I also adjust 'rtp' in my ~/.vimrc to put the files of certain
              plugin packages in their own directories, but only those that exceed
              a certain complexity. I put my own plugins in a ~/.vim/before
              directory structured the same as ~/.vim/after. Everything else goes
              into the standard ~/.vim hierarchy. I've had no problems so far.

              I have to run off and don't have time to understand the errors at
              the moment, but I will look at them more this evening.

              Regards,
              Gary

              --
              --
              You received this message from the "vim_dev" 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_dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
              For more options, visit https://groups.google.com/groups/opt_out.
            • Marc Weber
              Hi Gary, ... please try quoting only the important parts of a message. ... Let s keep it short and sipmle. Try this: mv .vim .other ... Now it should behave
              Message 6 of 9 , May 27, 2013
              • 0 Attachment
                Hi Gary,

                > [ many lines ]
                please try quoting only the important parts of a message.

                > > Otherwise you'd find messages with the id "test-plugin" in addition to
                > > "standard".
                >
                > But I see them in the output of :scriptnames:
                >
                > [..]
                > 19: ~/.vim/after/plugin/html.vim
                > 21: ~/.vim/after/ftplugin/html.vim

                Let's keep it short and sipmle. Try this:

                mv .vim .other

                then in your .vimrc add a early line like this:

                :set rtp=~/.other

                Now it should behave "normal", because you told Vim where your .vim
                directory is. Try it and report whether those after files can still be
                found in :scriptnames. Same applies to ftdetect

                Got it?

                Marc Weber

                --
                --
                You received this message from the "vim_dev" 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_dev" group.
                To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                For more options, visit https://groups.google.com/groups/opt_out.
              • Gary Johnson
                ... It depends what you mean by normal . It will look in ~/.other for a number of files and directories, but not for the after directory. If you want it to
                Message 7 of 9 , May 27, 2013
                • 0 Attachment
                  On 2013-05-27, Marc Weber wrote:

                  > Let's keep it short and sipmle. Try this:
                  >
                  > mv .vim .other
                  >
                  > then in your .vimrc add a early line like this:
                  >
                  > :set rtp=~/.other
                  >
                  > Now it should behave "normal", because you told Vim where your .vim
                  > directory is.

                  It depends what you mean by "normal". It will look in ~/.other for
                  a number of files and directories, but not for the after directory.
                  If you want it to look in ~/.other/after you'll have to include that
                  in 'rtp' as well.

                  :set rtp=~/.other,~/.other/after

                  That is how you tell Vim to look there _after_ it sources from the
                  directories ahead of the after files in 'rtp'.

                  I know you know all that, but it seems pretty clear to me that that
                  behavior is by design. I don't see the problem. Maybe you just
                  haven't made it short and simple enough for me.

                  > Try it and report whether those after files can still be
                  > found in :scriptnames. Same applies to ftdetect

                  Of course the after files are not there--you didn't include them in
                  'rtp'.

                  The ftdetect files are not there because they're sourced by
                  $VIMRUNTIME/filetype.vim. So if you included at least $VIMRUNTIME,
                  your 'rtp' would behave more as "normal", e.g.,

                  :set rtp=~/.other,$VIMRUNTIME,~/.other/after

                  With $VIMRUNTIME in your 'rtp', any files in <package>/ftdetect
                  should be sourced upon ":filetype on" as long as 'rtp' includes
                  <package>.

                  > Got it?

                  Apparently not. I guess there are other ways that Vim could manage
                  plugins, but I don't see a problem with the current method.

                  I'll re-read your earlier messages and see if I can possibly grasp
                  the less-simple example.

                  Regards,
                  Gary

                  --
                  --
                  You received this message from the "vim_dev" 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_dev" group.
                  To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                  For more options, visit https://groups.google.com/groups/opt_out.
                • Marc Weber
                  ... The problem was me - not vim - not you. Don t ask me why I thought after was magic, apparently its not. I should have known it - but didn t see it. Marc
                  Message 8 of 9 , May 27, 2013
                  • 0 Attachment
                    Excerpts from Gary Johnson's message of Tue May 28 02:21:24 +0200 2013:
                    > Apparently not. I guess there are other ways that Vim could manage
                    > plugins, but I don't see a problem with the current method.
                    The problem was me - not vim - not you.
                    Don't ask me why I thought "after" was magic, apparently its not.
                    I should have known it - but didn't see it.

                    Marc Weber

                    --
                    --
                    You received this message from the "vim_dev" 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_dev" group.
                    To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
                    For more options, visit https://groups.google.com/groups/opt_out.
                  • Gary Johnson
                    ... I would expect the ftdetect files from the plugin to not be sourced because the plugin wasn t added to rtp until after the sourcing was done by the
                    Message 9 of 9 , May 27, 2013
                    • 0 Attachment
                      On 2013-05-27, Marc Weber wrote:

                      > You'll notice that the ftdetect files and the after files from the
                      > plugin were not sourced.

                      I would expect the ftdetect files from the plugin to not be sourced
                      because the plugin wasn't added to 'rtp' until after the sourcing
                      was done by the :filetype command. That's an error in your ~/.vimrc
                      file that can easily be fixed by putting the 'rtp' setting ahead of
                      the :filetype command.

                      As I wrote in an earlier reply, the after files from the plugin
                      aren't sourced because you didn't include them in the 'rtp'. That's
                      easily fixed with

                      :set rtp+=~/A,~/A/after

                      Possibly better would be

                      :set rtp^=~/A
                      :set rtp+=~/A/after

                      in case a plugin file needed to take the place of a $VIMRUNTIME
                      file.

                      With those two issues understood, it should be pretty easy to get
                      your plugin manager thingy working.

                      Regards,
                      Gary

                      --
                      --
                      You received this message from the "vim_dev" 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_dev" group.
                      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+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.