Giter VIP home page Giter VIP logo

vim-css3-syntax's Introduction

vim-css3-syntax

Add CSS3 syntax support to Vim's built-in syntax/css.vim.

INSTALLATION

I strongly recommend to install this plugin on Vim 7.4 or higher with default runtime files.

Manual Installation

Download from GitHub, extract vim-css3-syntax.tar.gz, and copy the contents to your ~/.vim directory.

Installing with Git and pathogen

$ cd ~/.vim/bundle
$ git clone https://github.com/hail2u/vim-css3-syntax.git

NOTES

Highlighting problems on: vertical-align, box-shadow, and others

Some properties do not highlight correctly by default. This is a limitation of Vim's highlight priority mechanism. To fix this problems, put following lines in your ~/.vim/after/css.vim:

setlocal iskeyword+=-

Or in your ~/.vimrc:

augroup VimCSS3Syntax
  autocmd!

  autocmd FileType css setlocal iskeyword+=-
augroup END

This setting have side effects. So, use it at your own risk.

Vendor Prefixes

I do not plan to support CSS3 properties (or functions) with vendor prefixes, such as -webkit- or -moz-, etc. These are hard to maintain because they are:

  • Added frequently
  • Changed unexpectedly
  • Removed silently

These must be supported by separate syntax plugins (Vim 7.4's default CSS syntax file supports this). If you want to highlight prefixed properties or functions manually, :highlight and :match would help:

:highlight VendorPrefix guifg=#00ffff gui=bold
:match VendorPrefix /-\(moz\|webkit\|o\|ms\)-[a-zA-Z-]\+/

These commands highlight vendor prefixed properties and functions instantly with cyan and bold (on gVim).

CSS Preprocessors: Sass, LESS, and Stylus

vim-css3-syntax supports Sass's SCSS syntax only. If you want to use this plugin with LESS, install VIM-LESS. Sass's indent syntax and Stylus are not supported.

Media Queries

I drop Media Queries Level 3 support in v0.12.0. There is no easy way to support Media Queries properly with after syntax plugin like this one, sorry. If you want to highlight Media Queries correctly, you must update Vim to 7.4+ or install JulesWang/css.vim.

AUTHOR

Kyo Nagashima [email protected] (https://kyonagashima.com/)

LICENSE

MIT: http://hail2u.mit-license.org/2011

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.