• This repository has been archived on 22/Apr/2022
  • Stars
    star
    333
  • Rank 126,599 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created almost 6 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

tailwindcss class name completion for (neo)vim

Tailwind CSS IntelliSense

fork from vscode-tailwindcss v0.2.0

Tailwind CSS class name completion for coc.nvim

image

Install

CocInstall coc-tailwindcss

or with vim-plug, in your .vimrc/init.vim inside the plug#begin/end block:

Plug 'iamcco/coc-tailwindcss',  {'do': 'yarn install --frozen-lockfile && yarn run build'}

Create tailwindCSS configuration in your project

this extension need the configuration exists in your project

tailwind init

Settings

  • tailwindCSS.trace.server Trace level of tailwindCSS language server, default: off

  • tailwindCSS.emmetCompletions Enable class name completions for Emmet-style syntax, default: false

  • tailwindCSS.cssLanguages css languages completion support, default:

    [ "css", "less", "postcss", "sass", "scss", "stylus", "vue" ]
  • tailwindCSS.jsLanguages javascript languages completion support, default:

    [ "javascript", "javascriptreact", "reason", "typescriptreact" ]
  • tailwindCSS.htmlLanguages html languages completion support, default:

    [ "blade", "edge", "eelixir", "ejs", "elixir", "elm", "erb", "eruby", "haml", "handlebars", "htmldjango", "html", "HTML (EEx)", "HTML (Eex)", "html.twig", "jade", "leaf", "markdown", "njk", "nunjucks", "php", "razor", "slim", "svelte", "twig", "vue" ]

Features

Tailwind CSS IntelliSense uses your projects Tailwind installation and configuration to provide suggestions as you type.

HTML (including Vue, JSX, PHP etc.)

  • Class name suggestions
    • Suggestions include color previews where applicable, for example for text and background colors
    • They also include a preview of the actual CSS for that class name
  • CSS preview when hovering over class names

CSS

  • Suggestions when using @apply and config()
  • Suggestions when using the @screen directive
  • Improves syntax highlighting when using @apply and config()

Headwind

fork from headwind

Headwind is an opinionated Tailwind CSS class sorter for coc.nvim. It enforces consistent ordering of classes by parsing your code and reprinting class tags to follow a given order.

Headwind runs on save, will remove duplicate classes and can even sort entire workspaces.

Usage

You can trigger Headwind by:

Commands

  • tailwindCSS.headwind.sortTailwindClasses Sort Tailwind CSS Classes
  • tailwindCSS.headwind.sortTailwindClassesOnWorkspace Sort Tailwind CSS Classes on Entire Workspace

Headwind can sort individual files by running tailwindCSS.headwind.sortTailwindClasses via the Command Palette. Workspaces can also be sorted by running tailwindCSS.headwind.sortTailwindClassesOnWorkspace.

Any breakpoints or unknown classes will be moved to the end of the class list, whilst duplicate classes will be removed.

Customisation

Headwind ships with a default class order (located in package.json). You can edit this (and other settings) to your liking on the extension settings page.

tailwindCSS.headwind.classRegex:

An object with language IDs as keys and their values determining the regex to search for Tailwind CSS classes. The default is located in package.json but this can be customized to suit your needs.

There can be multiple capturing groups, that should only contain a string with Tailwind CSS classes (without any apostrophies etc.). If a new group, which doesn't contain the class string, is created, ensure that it is non-capturing by using (?:).

Example from package.json:

"tailwindCSS.headwind.classRegex": {
		"html": "\\bclass\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\']",
		"javascriptreact": "(?:\\bclassName\\s*=\\s*[\\\"\\']([_a-zA-Z0-9\\s\\-\\:\\/]+)[\\\"\\'])|(?:\\btw\\s*`([_a-zA-Z0-9\\s\\-\\:\\/]*)`)"
}

tailwindCSS.headwind.sortTailwindClasses:

An array that determines Headwind's default sort order.

tailwindCSS.headwind.removeDuplicates:

Headwind will remove duplicate class names by default. This can be toggled on or off.

"tailwindCSS.headwind.removeDuplicates": false

tailwindCSS.headwind.runOnSave:

Headwind will run on save by default (if a tailwind.config.js file is present within your working directory). This can be toggled on or off.

"tailwindCSS.headwind.runOnSave": false

More Repositories

1

markdown-preview.nvim

markdown preview plugin for (neo)vim
JavaScript
6,530
star
2

markdown-preview.vim

⚠️ PLEASE USE https://github.com/iamcco/markdown-preview.nvim INSTEAD
CSS
793
star
3

vim-language-server

VImScript language server, LSP for vim script
JavaScript
496
star
4

coc-flutter

flutter support for (Neo)vim
TypeScript
472
star
5

diagnostic-languageserver

diagnostic language server integrate with linters
TypeScript
410
star
6

coc-spell-checker

A basic spell checker that works well with camelCase code for (Neo)vim
TypeScript
263
star
7

coc-diagnostic

diagnostic-languageserver extension for coc.nvim
TypeScript
246
star
8

coc-vimlsp

viml language server
TypeScript
211
star
9

coc-angular

Angular Language Service coc extension for (neo)vim
TypeScript
145
star
10

ds-pinyin-lsp

Dead Simple Pinyin Language Server
Rust
114
star
11

coc-actions

Actions menu for Neovim
TypeScript
102
star
12

coc-rainbow-fart

🌈 rainbow-fart for (neo)vim 一个在你编程时疯狂称赞你的 coc.nvim 扩展插件 | An coc.nvim extension that keeps giving you compliment while you are coding, it will checks the keywords of code to play suitable sounds.
TypeScript
84
star
13

dict.vim

vim简单的翻译工具
Python
74
star
14

markdown.css

markdown styles
CSS
60
star
15

coc-post

post extension for coc.nvim
TypeScript
55
star
16

dotfiles

my dotfiles
Vim Script
52
star
17

git-p.nvim

Git plus for (neo)vim
JavaScript
38
star
18

clock.nvim

A Big Clock For Neovim
JavaScript
33
star
19

coc-leetcode

leetcode 扩展
TypeScript
33
star
20

coc-svg

A Powerful SVG Language Support coc Extension for (neo)vim
TypeScript
31
star
21

async-await.lua

Write async function more like javascript async/await
Lua
28
star
22

coc-zi

look or google 10000 english for (neo)vim
TypeScript
28
star
23

coc-cspell-dicts

Ext spell dictionary extension for coc-spell-checker
TypeScript
21
star
24

coc-gitignore

gitignore extension for coc.nvim
TypeScript
20
star
25

mathjax-support-for-mkdp

mathjax support for markdown-preview.vim plugin
JavaScript
19
star
26

coc-project

project extension for coc.nvim
TypeScript
18
star
27

bg.workflow

追番,alfred3 workflow 查看每日新番
Python
10
star
28

Bencode

解析torrent文件
Python
9
star
29

coc-clock

clock for neovim
TypeScript
8
star
30

coc-webpack

Autocomplete support for webpack config
TypeScript
7
star
31

htom

convert html to markdown
JavaScript
4
star
32

iamcco.github.io

Too young Too simple Sometimes naive
HTML
3
star
33

manga-download

漫画下载
Python
3
star
34

sran.nvim

simple request and notification call for (neo)vim
JavaScript
3
star
35

denite-source.vim

denite source of denite sources
Python
3
star
36

gh-pages-webpack-plugin

gh-pages plugin for webpack
JavaScript
3
star
37

file-manager.vim

Denite source for file management
Python
3
star
38

statusline.vim

Vim Script
3
star
39

smartIM.nvim

smart IM for neovim
Python
2
star
40

yuuko

An hexo theme inspire by Time axis of Qzone
CSS
2
star
41

coc-bootstrap-classname

JavaScript
2
star
42

buzuo.vim

😱 buzuo(不做)list for vim/neovim
Vim Script
2
star
43

HomePage

My home page
JavaScript
2
star
44

next-theme

refind next theme dark
2
star
45

gitignore.vim

denite source for gitignore
Python
2
star
46

rxjs-operators

rxjs 操作符补完计划
TypeScript
2
star
47

go-to-file.vim

go to the file from require or import
Vim Script
2
star
48

md-it-mermaid

markdown-it plugin for mermaid
JavaScript
1
star
49

coc-action-source.nvim

CocAction source of coc.nvim
Python
1
star
50

nichijou

yuuko mio mai hakase nano sakamoto no monogatari
1
star
51

git-blame.vim

git blame
Vim Script
1
star
52

vimrc.backup

vimrc配置/字体等备份
Vim Script
1
star
53

BEND

JavaScript
1
star
54

exec-frequent

exec function frequent
JavaScript
1
star
55

redux-async-combine-reducers

Asynchronous add reducers
JavaScript
1
star
56

RotateGame

JavaScript
1
star
57

react-error-codes.vim

Denite sources for react error codes
Python
1
star
58

hello-dt

Using DevTerm as a print server
TypeScript
1
star
59

fzf-source.vim

denite source of fzf source for (neo)vim
Python
1
star
60

.github

1
star
61

float2

move the dot of float
JavaScript
1
star
62

rxh

RxJS hook for React with no magic
JavaScript
1
star
63

save-cloud-vita

PSVita 游戏存档云备份工具!
Rust
1
star