VundleVim / Vundle.vim

Vundle, the plug-in manager for Vim
http://github.com/VundleVim/Vundle.Vim
MIT License
23.89k stars 2.57k forks source link

Cannot run ftdetect in Vundle #976

Open MisterSnrub opened 1 month ago

MisterSnrub commented 1 month ago

I am using Vim 7.4 on Linux with Vundle and Git. I am writing my own plugin called potion (following an example in the book LEARN VIMSCRIPT THE HARD WAY by Steve Losh) that is stored in my GitHub repository.

The potion folder structure looks like the following:

potion
+ README
+ LICENSE
- colors/
   + potion.vim
- doc/
   + potion.txt
- ftdetect/
   + potion.vim

Using a brand new environment, I copy the Vundle repo:

git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

I have the following as my minimalist .vimrc file:

set nocompatible

filetype off                   " required
filetype plugin on

set rtp+=~/.vim/bundle/Vundle.vim/

call vundle#begin()

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" Load my plugin.
Plugin 'MisterSnrub/potion'

call vundle#end() " required!

filetype plugin indent on     " required

After loading my potion plugin, I create a new file ~/factorial.vim. The ftdetect/potion.vim file should be run and a "Hello world" message should be output. And if we type "set ft?" in factorial.pn, it still does not recognize the potion filetype.

However, if I copy-and-paste the file ~/.vim/bundle/potion/ftdetect/potion.vim file to ~/.vim/ftdetect/potion.vim (so that it is run outside of the Vundle process), I do get the "Hello world" output, and "set ft?" returns "filetype=potion", as expected.

Tested in Vim 7.4

MisterSnrub commented 4 weeks ago

Also tested in gVim version 9.1 using "~/vimfiles/bundle" as my Vundle folder.