Skip to content

Adding support for css hacks #16

merged 2 commits into from Aug 3, 2013

3 participants

amadeus commented Jul 31, 2013

This commit may be somewhat controversial but I find it very useful in my day to day.

It essentially styles known css hacks like (* and _) as if they were vendor prefixes (linked to the
Comment group).

amadeus commented Aug 1, 2013

So yeah, here's the thing. Yes they are old fixes, and yes, in time they will probably be gone, however, I do often use other people's CSS files, or sometimes I work on projects that require me support older versions of IE, so it's nice to at least have these hacks 'fit in' with the overall theme.


Ok, pls add more comments to tell us these css hacks is only for IE7 or below, so that when older versions of IE are totally obsoleted, someone could know that it is safe to remove them from the syntax file.

amadeus commented Aug 1, 2013

Not a problem, I have to run for a bit, but I'll look into it in the next day or so to better comment this.

amadeus added some commits Jul 31, 2013
@amadeus amadeus Adding support for css hacks
This commit may be somewhat controversial. It essentially styles known
css hacks like (* and _) as if they were vendor prefixes (linked to the
Comment group).
@amadeus amadeus More descriptive comments for cssHacks group 414c759
amadeus commented Aug 2, 2013

I went ahead and rebased this branch against recent changes to avoid merge conflicts. I also added a far more descriptive comment with a link for more details.

Does this work?

@JulesWang JulesWang merged commit 8e9e529 into JulesWang:master Aug 3, 2013

it works well.

@amadeus amadeus deleted the amadeus:css-hacks branch Aug 3, 2013

This now has hit the vim runtime files

And it breaks syntax higlighting for php, rails, and maybe more

the offending lines are:

" Required for cssHacks
setlocal iskeyword-=_
amadeus commented Sep 23, 2013

@BlackIkeEagle thanks for the report, I've posted on the vim_dev thread regarding this. Awaiting Braam's response on how to proceed.


is there a way to do this cssHacks thing without "setlocal iskeyword-=_" ?

do you have any css files where the working of the cssHacks is visible ?

i tried some but found no difference when the cssHacks were there or removed
i'm not a css expert at all


That's terrible, I have sent a copy of css.vim to Bram.
@BlackIkeEagle , would you pls paste the php or rails code with broken syntax highlighting ?




$array = array('one', 'two', 'three');
$flag = in_array('one', $array);

in the above example in_ is no longer detected as part of the in_array function


The code "setlocal iskeyword-=_ " breaks syntax highlighting of other languages, this change will be reverted with no doubt.

@JulesWang JulesWang added a commit that referenced this pull request Sep 24, 2013
@JulesWang remove the offending line. #16 999ddfd
@graywh graywh referenced this pull request in tpope/vim-rails Sep 26, 2013

iskeyword improperly set when vim-rails is installed #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.