search

Home  >  Q&A  >  body text

There is no way to automatically complete CSS attribute values ​​using vim

Use Vim to write the front-end code. YouCompleteMe and tern_for_vim are used for automatic completion. The js code can be incomplete normally, but when writing css, the attributes can be automatically completed, but the value of the attribute cannot be automatically completed.
The current css configuration is as follows:

autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS

Attribute completion is as shown below:

Attribute values ​​cannot be incomplete as shown below:

世界只因有你世界只因有你2774 days ago697

reply all(1)I'll reply

  • 阿神

    阿神2017-05-16 16:39:53

    If you use YCM, this sentence should be unnecessary, if your YCM is configured to trigger css completion.

    'css': [ 're!^\s{2,4}', 're!:\s+' ],

    In this way, after you enter the attribute name and colon, and then space, the completion will be triggered, for example:
    vertical-align:_

    reply
    0
  • Cancelreply