Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[support] filetype off #176

Closed
comboy opened this issue May 15, 2012 · 15 comments
Closed

[support] filetype off #176

comboy opened this issue May 15, 2012 · 15 comments
Labels
Milestone

Comments

@comboy
Copy link

comboy commented May 15, 2012

May I ask what's the reason for this "filetype off" before calling vundle?

I have a problem that when it is called, then even though there is "filetype plugin indent on" at the end of file, it still won't load my system syntax files (e.g. gitcommit.vim).

But when I remove this "filetype off" before vundle then vim-coffee-script is not recognizing files properly.

I use workaround with autocmd for *.coffee, but it's all a bit mysterious to me why are these things happening. Any help would be very appreciated.

@jdevera
Copy link
Contributor

jdevera commented Jun 11, 2012

There was a bug in Vim's file detection that used to cause this weird behaviour, it has been fixed in Vim 7.3.430. I your version is newer, please disregard this comment.

@jasonkuhrt
Copy link

@jdevera How does one check their vesion of vim (I know of :version etc. but that only states 7.3).

And if > 7.3.430 is an edge build how do I attain it?

Cheers

@johannish
Copy link

@jasonkuhrt (And for future readers) The final number is the "patch version" visible on the second line of the :version output:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled May 4 2012 04:21:49)
Included patches: 1-429

So my version is 7.3.429

@sudar
Copy link

sudar commented Jan 13, 2013

So if we have vim version > 7.3.430 can we remove filetype off from the first line of .vimrc file and replace it with filetype on?

@jdevera
Copy link
Contributor

jdevera commented Feb 1, 2013

The answer is no, as I just found out from my little experiment. However, what seemed to work was to do

filetype off
filetype plugin indent on

After the bundles block. File type detection must be enabled after the Bundles block because the runtime path is updated by every Bundle command and that could potentially bring new file types or more plugins for specific file types. It also appears that turning it on, when it's on, does nothing, so it must be turned off before.

If you are reluctant to turn it off because it affects some file type detection, please try a newer vim version, with the 430th patch (quite unluckily, Ubuntu picked up only up to the patch right before that one.)

@sudar
Copy link

sudar commented Feb 1, 2013

@jdevera Thanks for the reply.

I will try to update my vim to > 7.3.430

@bor
Copy link

bor commented Feb 26, 2013

thanks guys, the topic is helpful

@sheerun
Copy link

sheerun commented Sep 13, 2013

That's the answer I needed :)

@ackalker
Copy link

@jdevera @gmarik
Could one of you please update the comment after filetype off in the example .vimrc in https://github.com/gmarik/vundle/blob/master/README.md with documentation as to when and where it applies?
This will spare a lot of users a spelunking trip to the issues section or the Git history to find out whether or not they need to apply it.
Even after reading all the comments in this issue, I'm not sure if I need to put filetype off (I'd rather not :-) ), and if so, if and where I can safely re-enable it.
I'm a relatively new (>2 years) Vim user, using vim 7.4.135 package on Arch Linux.

Thanks!

@lucc
Copy link
Contributor

lucc commented Jan 28, 2014

@ackalker
looking at the last message from @jdevera above I would say it always applies. You have vim 7.4 so all this version details do not apply for you (they only apply for 7.3). This means you can put

filetype off
filetype on

after loading your last Bundle.

I think the comment should stay in the README file a little longer as many people still might have a version <7.3.430 (the relatively new OSX Maverics ships with vim 7.3 and no patches as far as I can tell)

@ackalker
Copy link

Thanks for your quick reply :-)
I've added this to my .vimrc as you suggested and it works well.

@Shougo
Copy link
Contributor

Shougo commented Feb 6, 2014

It is not bug. It is Vim's feature.
Vim makes cache for filetype plugins from runtimepath. So if vundle changes runtimepath, it must reset before calling.
But Vundle can reset filetype by :filetype off internally. It is policy problem. neobundle does it.

@ackalker
Copy link

ackalker commented Feb 7, 2014

Ah I see. Thanks for pointing this out.
I've added the off / on switches before and after my Bundle definitions, and all is working well (except for one plugin, but that's a problem with that plugin, not Vundle :-) )

@Shougo
Copy link
Contributor

Shougo commented Feb 10, 2014

I think this issue should be closed.

@starcraftman
Copy link
Contributor

This probably should have been closed a while ago. Maybe we'll revisit if NeoVim makes nice changes and becomes stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests