Skip to content

Instantly share code, notes, and snippets.

@robbles
Created April 3, 2011 01:15
Show Gist options
  • Save robbles/900075 to your computer and use it in GitHub Desktop.
Save robbles/900075 to your computer and use it in GitHub Desktop.
Fixes an annoying bug where Vim searches through the runtime path for ages for HTML syntax files
" Fixes runtimepath issues for html files
" Language: HTML
" Author: Rob O'Dwyer
" Last Change: April 2, 2011
" Filenames: *.html, *.htm
" Quit when a syntax file was already loaded
if exists("b:current_syntax")
echo "Warning: html syntax has been overridden!"
finish
endif
" Deactivate extra stuff on runtimepath
let s:oldrtp=&runtimepath
set runtimepath=$VIMRUNTIME
" Source default html syntax file
runtime syntax/html.vim
" Restore runtimepath
let &runtimepath=s:oldrtp
" Prevent other syntax files from loading
let b:current_syntax='html'
@EspadaV8
Copy link

Thanks for this. It seems to be working for my HTML files now, but I'm getting the same problems with other file types (CSS, JS, phtml...).

@robbles
Copy link
Author

robbles commented Jun 28, 2011

are you using the css_color plugin? I found that was another source of slow loading for my setup, so I removed it.

@EspadaV8
Copy link

yes, i was, I've switched to a newer fork of it though and it's a lot faster. https://github.com/ap/vim-css-color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment