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
The ftdetect/potion.vim file has the following code:
echomsg "Hello world"
au BufNewFile,BufRead *.pn set filetype=potion
When I call :PluginUpdate in my .vimrc, the files get downloaded from Git to my local system OK. When I vim a .pn file I can load a colorscheme "potion" OK, so that part works, but the autocommand is not setting the filetype to "potion" correctly and the "Hello world" message never displays. Why is ftdetect/potion.vim not getting run?
EDIT
The full path of the potion directory is ~/.vim/bundle/Vundle.vim/potion/.
The full path of the autoread file is: ~/.vim/bundle/Vundle.vim/potion/ftdetect/potion.vim
The full content of my .vimrc is as follows:
set nocompatible
filetype off " required
filetype plugin on
let g:vundle_path = "~/.vim/bundle/Vundle.vim/"
set rtp+=~/.vim/bundle/Vundle.vim/
if !isdirectory(expand(g:vundle_path))
echomsg "ERROR: Vundle path '" . g:vundle_path . "' does not exist."
finish
endif
try
call vundle#begin(g:vundle_path)
catch
echomsg "ERROR: Could not call Vundle#begin(). Exception: " . v:exception
finish
endtry
Plugin 'adelarsq/vim-matchit'
Plugin 'MisterSnrub/potion'
call vundle#end() " required!
filetype plugin indent on " required
I am using Vim 7.4 because that's what's on our system. Nothing I can do about that, sorry.
potiondirectory? Can we see your fullvimrc? Also, why 7.4? Current version is 9.1.cp ~/.vim/bundle/potion/ftdetect/potion.vim ~/.vim/ftdetect/.and then vim a file factorial.pn it will echo the hello world message (twice for some reason) and set the filetype as a potion file.