✔️ tachyons-css classes in vim autocompletion
It's a simple plugin that add to the autocompletion system of Vim, the classes of tachyons-css.
If you use tachyons-css, you have to remember a lot of cryptic names that are responsible to add the relative styles, like pa1
, that stands for padding all 1rem
, which is translated to padding: 1rem;
.
With this plugin you can simply start typing pa
and then C-n
or C-p
and you will be supplied with the list of the matching classes from tachyons stylesheet.
It just creates a dictionary with the name of the classes, and then adds it to the completion sources.
It's very useful in react and JSX
contexts, but it could be useful also in plain HTML
and also in CSS
files, if you want to overwrite some classes.
By default it works in all this three filetypes, but one can easily decide which switch off simply setting the relative variable to 0
:
Variable Name | Filetype | Default |
---|---|---|
g:tachyons_vim_jsx | JSX | 1 |
g:tachyons_vim_html | HTML | 1 |
g:tachyons_vim_css | CSS | 1 |
For vim-plug, just add this line to your ~/.vimrc
:
Plug 'tachyons-toolbox/tachyons.vim', {'do' : 'sh install.sh' }
sh install.sh
inside the directory of the plugin, because otherwise you won't have the dictionary linked in your file system.
I create this plugin adapting the idea suggested in this thread.
More details on tachyons-css here.
If you think that something could be do in a better way, please open an issue explaining what and how could be improved.
Copyright (c) Gabriele Lippi. Distributed under the same terms as Vim itself. See :help license
.