Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why isn't VimClojure setting filetype to "clojure"

I have setup vundle to handle my packages in MacVim. It correctly sets the filetype for all my other files, e.g. ruby, perl, etc.

However, it is not setting the filetype when I open a .clj file. When I run :set filetype? it returns empty. So, vim isn't recognizing clojure files. I can :set filetype=clojure and immediately get code completion and syntax highlighting; so I know VimClojure is working correctly.

What's the best way to "debug" this or find out where the issue lies?

  • MacVim v7.3
  • OS X 10.6

Thanks!

UPDATE

I already have filetype plugin indent on and it's working for other packages (vim-ruby, vim-rails, etc.) that vundle is managing. Just not VimClojure.

like image 203
Matthew Boston Avatar asked Feb 23 '23 18:02

Matthew Boston


2 Answers

In order to enable loading filetype plugins you might need to add this in your .vimrc:

filetype plugin on

like image 98
Tamas Kovacs Avatar answered Mar 06 '23 02:03

Tamas Kovacs


Make sure you're initializing Vundle and your bundles before the rest of your configuration in your vimrc. So, for example, you should have:

" =======================================================================
" Vundle setup and initialization. This needs to be done before any
" configuration so all plugins are loaded.

set nocompatible                    " required for Vundle
filetype off                        " required for Vundle, enabled later.

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'

" Powerline
Bundle 'Lokaltog/vim-powerline'
...

...where Powerline is just an example bundle. Then have the rest of your config...

" =======================================================================
" Actual vim configuration goes here.
" =======================================================================

syntax on                           "lots of syntax highlighting
set nocompatible                    "be iMproved
colorscheme mustang
filetype plugin indent on
...

Hope that helps...

like image 40
Dan Pilone Avatar answered Mar 06 '23 02:03

Dan Pilone