A small vim plugin to (un)minify your javascript and css code directly and fast in vim.
This plugin uses the API from javascript-minifier.com and cssminifier.com by Andrew Chilton.
- Minifying complete css or javascript files or line-based minifying
- writes a file.min.extension file in the directory of the file (e.g. site.min.js in folder where site.js is)
- functions occurs only in JavaScript, CSS, HTML and PHP files
- uses well-working minifier API
- curl
- internet connection
:MinifyJS
minifies your javascript code to filename.min.js:UnMinifyJS
reformat to be human readable
:MinifyCSS
minifies your css code to filename.min.css:UnMinifyCSS
reformat to be human readable
:1,5Minjs
minifies (embedded) javascript code (line 1 to 5):1,5Mincss
minifies (embedded) css code (line 1 to 5)
E.g. install plugin with vim-plug:
- In .vimrc:
Plug 'Shadowsith/vim-minify'
- Open vim and execute
:PlugInstall
Or put it in your .vim/bundle folder if you are using pathogen or vundle
- XML-fast.vim, vim-xml-minifier