【问题标题】:Vim CSS styles syntax highlight in .html or .vue files not working.html 或 .vue 文件中的 Vim CSS 样式语法高亮不工作
【发布时间】:2019-04-22 16:29:51
【问题描述】:

我试图突出显示 .html 和 .vue 文件中的 CSS 语法,但它不起作用,如屏幕截图所示:https://i.ibb.co/XDFKwTx/Screenshot-from-2019-04-22-18-13-46.png

我尝试使用插件https://github.com/posva/vim-vue,但结果与原生 HTML 插件相同。

我的 ~/.vimrc :

syntax on
set number
filetype on
filetype plugin on
filetype indent on
set autoread
set encoding=utf-8
set fileencoding=utf-8
set fileformat=unix
set fileformats=unix,dos

autocmd BufNewFile,BufRead *.vue,*.ts: set filetype=html

call plug#begin('~/.vim/plugged')
Plug 'sgur/vim-editorconfig'
call plug#end()

【问题讨论】:

    标签: html css vim syntax-highlighting nuxt.js


    【解决方案1】:

    它实际上是链接到<template></template> 标签中的 Nuxt.js 代码生成器。

    之前:

    <template>
      ...
      <a 
        href="https://github.com/nuxt/nuxt.js"
        target="_blank"
        class="button--grey"
        >GitHub<
      /a>
    
    </template>
    

    之后:

    <template>
      ...
      <a 
        href="https://github.com/nuxt/nuxt.js"
        target="_blank"
        class="button--grey"
       >
        GitHub
       </a>
    
    </template>
    

    【讨论】:

      猜你喜欢
      • 2019-07-11
      • 2021-03-03
      • 1970-01-01
      • 1970-01-01
      • 2013-11-14
      • 2013-08-18
      • 2012-08-16
      • 2011-04-20
      • 2011-06-03
      相关资源
      最近更新 更多