Explicit execution of settings files under .vim/plugin/ unnecessary #118

Closed
cwinebrinner opened this Issue Jul 4, 2012 · 1 comment

Projects

None yet

2 participants

@cwinebrinner

It is not necessary to explicitly execute the Vim files in ~/.vim/plugin/settings/, at least with Vim v7.3.429. Explicitly executing them causes each of them to run twice.

See ":help plugin". An excerpt:

When you start Vim, it will automatically load a number of global plugins.
You don't have to do anything for this.

[...]

You can add a global plugin to add functionality that will always be present
when you use Vim. There are only two steps for adding a global plugin:

  1. Get a copy of the plugin.
  2. Drop it in the right directory.

[...]

Instead of putting plugins directly into the plugin/ directory, you may
better organize them by putting them into subdirectories under plugin/.
As an example, consider using "~/.vim/plugin/perl/*.vim" for all your Perl
plugins.

Test it with a clean .vim and .vimrc:

mkdir -p ~/.vim/plugin/test
echo 'echo "test"' > ~/.vim/plugin/test/test.vim
echo 'execute "source" $HOME."/.vim/plugin/test/test.vim"' >> ~/.vimrc
vim

Output:

test
test
@skwp
Owner
skwp commented Jul 9, 2012

You're right about this. I think the original reason was I had some solarized plugin overriding issues that may no longer be relevant. I'll take a look soon thanks

Yan

On Jul 4, 2012, at 1:18 PM, Charles Winebrinner wrote:

It is not necessary to explicitly execute the Vim files in ~/.vim/plugin/settings/, at least with Vim v7.3.429. Explicitly executing them causes each of them to run twice.

See ":help plugin". An excerpt:

When you start Vim, it will automatically load a number of global plugins.
You don't have to do anything for this.

[...]

You can add a global plugin to add functionality that will always be present
when you use Vim. There are only two steps for adding a global plugin:

  1. Get a copy of the plugin.
  2. Drop it in the right directory.

[...]

Instead of putting plugins directly into the plugin/ directory, you may
better organize them by putting them into subdirectories under plugin/.
As an example, consider using "~/.vim/plugin/perl/*.vim" for all your Perl
plugins.

Test it with a clean .vim and .vimrc:

mkdir -p ~/.vim/plugin/test
echo 'echo "test"' > ~/.vim/plugin/test/test.vim
echo 'execute "source" $HOME."/.vim/plugin/test/test.vim"' >> ~/.vimrc
vim

Output:

test
test


Reply to this email directly or view it on GitHub:
#118

@skwp skwp closed this in d200995 Jul 10, 2012
@taybin taybin added a commit to taybin/dotfiles-skwp that referenced this issue Jul 23, 2012
@taybin taybin Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Remove bogus unmap
  Resolve #122 unmap yankring @ in after file.
  Upgraded plugins
  Added SearchComplete tab completion when searching with /
  Marky the markdownifier
  Don't explicitly load plugins [Close #118]
  Change ,bf mapping conflicting with buffer list ,b
  Add back Rails2-compatible console alias 'co'
5ba565c
@cantoraz cantoraz added a commit to cantoraz/yadr that referenced this issue Jul 25, 2012
@cantoraz cantoraz Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Remove bogus unmap
  Resolve #122 unmap yankring @ in after file.
  Upgraded plugins
  Added SearchComplete tab completion when searching with /
  Marky the markdownifier
  Don't explicitly load plugins [Close #118]
  Change ,bf mapping conflicting with buffer list ,b
  Add back Rails2-compatible console alias 'co'
5a6ce2a
@ygoldshtrakh ygoldshtrakh added a commit to ygoldshtrakh/dotfiles that referenced this issue Sep 5, 2012
@ygoldshtrakh ygoldshtrakh Merge branch 'master' of https://github.com/skwp/dotfiles
* 'master' of https://github.com/skwp/dotfiles: (26 commits)
  Added vimrc.after to gitignore
  Updated README
  Added original implementation for janus overrides
  Uses vim/after directory instead of root for custom vimrc.after
  Remove git.zsh, it is not useful [Close #135]
  Handle systems without rvm [Close #130]
  Updated reference to prezto (omz sorin)
  enabling theme changes when using prezto through zsh before (cherry picked from commit 1cccb0e)
  Update link to @sorin-ionescu Oh My Zsh
  Update homebrew install script url
  Ctags file for better parsing of ruby,js
  Remove bogus unmap
  Resolve #122 unmap yankring @ in after file.
  Upgraded plugins
  Added SearchComplete tab completion when searching with /
  Marky the markdownifier
  Don't explicitly load plugins [Close #118]
  Change ,bf mapping conflicting with buffer list ,b
  Add back Rails2-compatible console alias 'co'
  Remove duplication in readme
  ...
ecd370b
@chrisnankervis chrisnankervis pushed a commit to chrisnankervis/dotfiles that referenced this issue Oct 5, 2014
@skwp Don't explicitly load plugins [Close #118] ec690b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment