search

Home  >  Q&A  >  body text

vim - How does YouCompleteMe automatically complete css attributes and attribute values?

After installing YCM, no other configurations are added to .vimrc.
Now JavaScript can be automatically completed (for example, if you enter Obj, a popup will automatically appear to let you choose the required completion), but css needs to be completed with omnicomplete by pressing [c-x] [c-o]. How can the css file be used? Autocomplete like JavaScript?

给我你的怀抱给我你的怀抱2778 days ago651

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-16 16:39:17

    Put this code into your .vimrc and change the number 4 to your indentation setting

    let g:ycm_semantic_triggers = {
       \   'css': [ 're!^\s{4}', 're!:\s+' ],
       \ }

    Reference link: YCM will not use omnicompletion results in .css files · Issue #413 · Valloric/YouCompleteMe

    reply
    0
  • Cancelreply