0

Okay so I am using the 'slate' color scheme in gvim and it is really great and I like it a lot except recently I have starting working with html and css files and for some reason, it starts highlighting random words and spaces in white for some reason and it is annoying. For example, in this code

<html>
    <head>
        {% load staticfiles %}
        <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/style.css" />
        <title>{% block title %}Name{% endblock %}</title>
    </head>

    <body>

        <div id="header">
            {% block headerBlock %}
            <h1 id="logo">Name</h1>
            {% endblock %}

the indents on the third, 4th, 5th and 6th line are highlighted in while along with the variable

{{ STATIC_URL }} 

and

headerBLOCK %} 

and a few other places. Note how the

{%

part in

{% headerBLOCK %}

is not highlighted. I find this really strange. Any idea on how to remove these white highlights? My .vimrc settings are below.

set nu
set shiftwidth=4
set softtabstop=4
autocmd FileType python set autoindent
set smarttab
set lines=44
set columns=195
filetype indent on
filetype on
filetype plugin on
colo slate

nnoremap ; -$
nnoremap ' +$
nnoremap , 0
nnoremap . $
nnoremap O o<Esc>

inoremap \ <Esc>

1 Answer 1

1

This is not pure HTML. It looks like a template.

  • For Jinja templates you'll need to install the htmljinja.vim syntax file that you can find on vim.org.
  • For Django templates you'll need django.vim (and possibly htmldjango.vim for vim <7.1), also on vim.org.

Vim 7.3 recognizes Django templates out of the box.

4
  • Oh, it's django / python. Should I still install htmljinja.vim? Oct 5, 2013 at 23:36
  • Also, I think it would be a lot easier if there is a way where I can just turn off the word highlighting in VIM, not the syntax coloring, the syntax coloring is perfect, how do I just change it so that vim never highlights anything? Oct 5, 2013 at 23:46
  • @user2719875: Answer updated for Django. Oct 6, 2013 at 9:20
  • @user2719875: You cannot separaty the syntax coloring from the highlighting, AFAIK. Oct 7, 2013 at 20:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .