GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — eruby html syntax highlighting · Issue #363 · vim-ruby/vim-ruby

eruby html syntax highlighting  #363

New issue
Copy link
New issue
Copy link
Open
Open
eruby html syntax highlighting #363
Copy link
Labels
syntax

Description

@amerov
amerov
opened on Mar 23, 2018
Issue body actions

I use https://github.com/othree/html5.vim for html.
.erb highlighting is strange
screenshot from 2018-03-24 00-25-00

Activity

  1. AndrewRadev commented on Mar 24, 2018

    @AndrewRadev
    AndrewRadev
    on Mar 24, 2018
    Member
    More actions

    Oddly enough, for me it's the other way around, sort of. With the plugin you link to, the "data-user" renders correctly, both in erb and html, as htmlArg. Without it, the -user part highlights as htmlTag instead.

    One thing to check is your iskeyword and syn iskeyword settings. Try these commands in an eruby and html buffer:

    :set iskeyword
    :syn iskeyword

    You could also try installing this plugin: https://github.com/vim-scripts/SyntaxAttr.vim. With it, calling :call SyntaxAttr() will give you information about the syntax group under the cursor.

    Even with that, I'm not sure if we'll be able to fix the issue, but it's a start to at least maybe figure out what might be wrong.

  2. amerov commented on Mar 24, 2018

    @amerov
    amerov
    on Mar 24, 2018
    Author
    More actions

    fixed it by adding autocmd BufRead,BufNewFile *.html.erb set filetype=eruby.html

    Reacted by Dani Patiño
    Reacted by Dani Patiño
  3. AndrewRadev commented on Mar 24, 2018

    @AndrewRadev
    AndrewRadev
    on Mar 24, 2018
    Member
    More actions

    Hm, that's interesting. I wonder if that doesn't override eruby syntax somehow. Well, either way, does that mean this issue can be closed?

  4. tpope commented on Mar 24, 2018

    @tpope
    tpope
    on Mar 24, 2018
    Member
    More actions

    First things first, one problem is that https://github.com/othree/html5.vim adds hyphen to 'iskeyword'. This is fundamentally incompatible with not just Ruby (and thus ERB) but also embedded JavaScript, and possibly CSS too. Thus, I'd argue that this HTML syntax file has a fundamental design flaw.

    But I'm not even sure that's the actual problem. While I can reproduce your ERB example, I can't reproduce your success with the plain HTML filetype. I can also produce a match with datafoo-bar=, which is invalid as I understand the HTML spec. Clearly, this particular HTML syntax file has issues.

  5. dkearns
    added
    syntax
    on Dec 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    syntax

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.