我得到一個CSS文件:如何按字母順序排列一個CSS文件中的Vim
div#header h1 {
z-index: 101;
color: #000;
position: relative;
line-height: 24px;
margin-right: 48px;
border-bottom: 1px solid #dedede;
font-size: 18px;
}
div#header h2 {
z-index: 101;
color: #000;
position: relative;
line-height: 24px;
margin-right: 48px;
border-bottom: 1px solid #dedede;
font-size: 18px;
}
我想按字母順序排列線之間{...}
div#header h1 {
border-bottom: 1px solid #dedede;
color: #000;
font-size: 18px;
line-height: 24px;
margin-right: 48px;
position: relative;
z-index: 101;
}
div#header h2 {
border-bottom: 1px solid #dedede;
color: #000;
font-size: 18px;
line-height: 24px;
margin-right: 48px;
position: relative;
z-index: 101;
}
我映射F7做它
nmap <F7> /{/+1<CR>vi{:sort<CR>
但我需要一遍又一遍地按F7才能完成工作。
如果CSS文件比較大,很容易就會很無聊。
我想獲取cmd管道。所以,我只按一次F7!
有什麼想法?謝謝!
這是如何準確題外話,拉近? – 2010-06-16 06:37:37
這真的很好,但這可能會導致很多新的CSS相關的錯誤,這些錯誤的屬性已經按照特定的順序定義了 – travis 2012-03-03 20:19:38