https://github.com/albertito/css3fmt
css3fmt is an auto-formatter for CSS files
https://github.com/albertito/css3fmt
autoformat css css3 formatter golang-application
Last synced: 11 months ago
JSON representation
css3fmt is an auto-formatter for CSS files
- Host: GitHub
- URL: https://github.com/albertito/css3fmt
- Owner: albertito
- License: other
- Created: 2020-06-04T20:55:54.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T21:08:21.000Z (over 5 years ago)
- Last Synced: 2025-01-30T18:33:21.854Z (about 1 year ago)
- Topics: autoformat, css, css3, formatter, golang-application
- Language: Go
- Homepage: https://blitiri.com.ar/git/r/css3fmt/
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css3fmt
[css3fmt](https://blitiri.com.ar/git/r/css3fmt) is an auto-formatter for
[CSS](https://en.wikipedia.org/wiki/Cascading_Style_Sheets) files.
It is not particularly fancy or smart, but it is simple and can automatically
format most CSS files.
## Install
css3fmt is written in Go.
```sh
go get blitiri.com.ar/go/css3fmt
```
## Editor integration
### vim
Put the following into your `.vimrc` file to auto-indent on save:
```vim
function! CSSFormatBuffer()
let l:curw = winsaveview()
let l:tmpname = tempname()
call writefile(getline(1,'$'), l:tmpname)
let l:out = system("css3fmt " . l:tmpname)
call delete(l:tmpname)
if v:shell_error == 0
try | silent undojoin | catch | endtry
silent %!css3fmt
else
echoerr l:out
endif
call winrestview(l:curw)
return v:shell_error == 0
endfunction
autocmd filetype css
\ autocmd bufwritepre call CSSFormatBuffer()
```
## Contact
If you have any questions, comments or patches please send them to
albertito@blitiri.com.ar.