Skip to content

Small vim-plugin to minifying javascript and css files.

License

Notifications You must be signed in to change notification settings

Shadowsith/vim-minify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-minify

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.

Features

  • 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

Requriements

  • curl
  • internet connection

Usage

In JavaScript files

  • :MinifyJS minifies your javascript code to filename.min.js
  • :UnMinifyJS reformat to be human readable

In CSS files

  • :MinifyCSS minifies your css code to filename.min.css
  • :UnMinifyCSS reformat to be human readable

In JavaScript, CSS, HTML and PHP files

  • :1,5Minjs minifies (embedded) javascript code (line 1 to 5)
  • :1,5Mincss minifies (embedded) css code (line 1 to 5)

Installation

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

Examples

Javascript

CSS

See also

Releases

No releases published

Packages

No packages published