sponsor Vim development Vim logo Vim Book Ad

CSS one-line / multi-line folding : Folded text is compressed on one line

 script karma  Rating 176/52, Downloaded by 756  Comments, bugs, improvements  Vim wiki

created by
Michael W
 
script type
ftplugin
 
description
/* one-line CSS (see http://neutroncreations.com/blog/single-line-vs-multi-line-css-plus-textmate-tips/) */
header h1 { float: left;  width: 155px; height: 50px;  }

/* Multiline CSS */
header h1 {
  float: left;
  width: 155px;
  height: 50px;
}

Which to choose? One line CSS is easier to scan through and saves space, but multi-line CSS is easier to grep and edit.

This script sets you up so you edit and save multi-line CSS, but when you turn folding on, everything´s compressed on one line so you can scan through it easier.

Controls are vim´s standard for text folding:
zo and zc: Open and Close fold (set multiline, set oneline)
zR and zM: Reopen and Close all (globally set multiline, globally set oneline)
zj, zk: go down and up a fold (CSS block).
 
install details
Copy to ~/.vim/ftplugin/css_folding.vim
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
css_folding.vim 0.' 2010-07-17 7.2 Michael W Initial upload
ip used for rating: 3.236.55.137

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github