Being the language used in website designs, CSS is one of the languages supported by Vim's autocomplete feature.
Enter the following while in Vim's command mode to start using the feature.
:set omnifunc=csscomplete#CompleteCSS
That will enable CSS auto-completion in Vim. To use it, press Ctrl + x followed by Ctrl + o while partially typing CSS codes.
The following is a sample screenshot.
You can use the arrow key to navigate through the list to choose your desired auto-complete suggestion.
Automatically enable auto-complete for CSS files
To automatically enable CSS auto-complete every time opening a CSS file, add the following line to your ~/.vimrc;
autocmd FileType css set omnifunc=csscomplete#CompleteCSS

Author: Mohd Shakir Zakaria
Mohd Shakir Zakaria is a skilled cloud architect with a background in development, entrepreneurship, and open-source advocacy. As the founder of Simplified Guide, he helps others understand the complexities of computing, making tech concepts accessible to all.

Mohd Shakir Zakaria is a skilled cloud architect with a background in development, entrepreneurship, and open-source advocacy. As the founder of Simplified Guide, he helps others understand the complexities of computing, making tech concepts accessible to all.
Discuss the article:
Comment anonymously. Login not required.