Janghou
Janghou

Reputation: 1843

Enable VIM to CSS autocomplete for background-color: hsla and rgba

I use VIM to edit CSS files. offers language-specific keywords auto completion. For CSS background-color this list is offered:

transparent
rgb(
#

I mostly use hsla( and rgba(, how do I add these to the list? Can I edit the css.vim file for this?

Upvotes: 0

Views: 170

Answers (1)

romainl
romainl

Reputation: 196576

  1. Open the default completion script:

    :e $VIMRUNTIME/autoload/csscomplete.vim
    
  2. Save and edit a local copy:

    :saveas ~/.vim/autoload/csscomplete.vim
    
  3. Search for transparent:

    /transp<CR>
    
  4. Append the desired values:

    $i, "rgba(", "hsla("<Esc>
    
  5. Repeat until you have edited all the relevant lines.

  6. Write the file and quit:

    :x
    
  7. Try it in a new session:

    $ vim foo.css
    

Upvotes: 1

Related Questions