groenewege/vim-less

Highlighting doesn't work

alexkravets opened this issue · 18 comments

Is there any reason, why this plugin may not work? I'm using MacVim 7.3.315 with Solarized theme, plugin is installed using pathogen.

Here is a list of plugins I'm having installed:

delimitMate
vim-coffee-script
vim-haskell
vim-ragtag
vimroom
nerdtree
vim-colors-solarized
vim-indexed-search
vim-rails
syntastic
vim-endwise
vim-less
vim-surround
tabular
vim-fugitive
vim-markdown
vim-unimpaired

Thanks.
Alex

Can you check if the LESS file type is correctly detected? What is the output of :echo &ft?

It says "conf", what can be the reason of that?

What exactly is the name of the file you are opening?

It's /Users/alex/dev/Mena Loans/css/elements.less

Does the highlighting work when you set the filetype manually? :set filetype=less

No, it doesn't.

So, the file type detection and the actual highlighting doesn't work. This leads me to believe that the plugin isn't correctly installed or loaded.

Can you have a look through the output of :scriptnames and check that vim-less/{ftplugin|indent|syntax}/less.vim are there?

Sorry, manual :set filetype=less command works.

So it is the filetype detection then. My suspicion is that another plugin somehow sets the filetype to 'conf' before vim-less is being run. Can you grep for the string 'less' in your vimrc and in .vim/* and see if it is used anywhere else?

In these plugins less file extension is mentioned:

syntastic
vim-rails

Tried to remove both but no luck.

I've tried to remove all plugins except vim-less, with this vimrc:

"Use Vim settings, rather then Vi settings (much better!).
"This must be first, because it changes other options as a side effect.
set nocompatible

"Custom
syntax enable
set background=dark
let g:solarized_termcolors=256
colorscheme solarized





if has("gui_running")
  set guioptions=-t
endif

"activate pathogen
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()

Same issue. Is there any other ideas or something that I can try?

Ist vim-less/ftplugin/less.vim in :scriptnames?

 ~/.vim/bundle/vim-less/ftplugin/less.vim
 52: ~/.vim/bundle/vim-less/indent/less.vim
 53: /usr/local/Cellar/macvim/7.3-62/MacVim.app/Contents/Resources/vim/runtime/indent/css.vim
 54: ~/.vim/bundle/vim-less/syntax/less.vim

I made a mistake. The file that detects and sets the file type is vim-less/ftdetect/less.vim. Is that file in your .vim directory?

If yes, what is its content?

Here is the file on Github: https://github.com/groenewege/vim-less/blob/master/ftdetect/less.vim

Yes, here you go:

autocmd BufNewFile,BufRead *.less setf less

Found the solution here: http://stackoverflow.com/questions/5602767/why-is-vim-not-detecting-my-coffescript-filetype

In config after syntax on had to add these lines:

filetype off
filetype on

@alexkravets Thanks had the same problem 👍 :)