Skip to content

Instantly share code, notes, and snippets.

@Takazudo
Forked from edom18/css3-property-duplicate
Created February 24, 2012 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Takazudo/1900591 to your computer and use it in GitHub Desktop.
Save Takazudo/1900591 to your computer and use it in GitHub Desktop.
CSSのプロパティを、ベンダープレフィクス付きで複製するスクリプト。(インデントも引き継ぐよう修正)
function! CSS3PropertyDuplicate()
let reg_save = @@
silent normal Y
let css3 = @@
let ind = matchlist(css3, '\v(\s*)(.*)')
let webkit = ind[1] . "-webkit-" . ind[2]
let moz = ind[1] . "-moz-" . ind[2]
let ms = ind[1] . "-ms-" . ind[2]
let o = ind[1] . "-o-" . ind[2]
let @m = webkit . moz . ms . o
normal "mP
endfunction
nnoremap ,3 :<C-u>call CSS3PropertyDuplicate()<CR>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment