Skip to content

Instantly share code, notes, and snippets.

@edom18
Created May 15, 2011 01:23
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save edom18/972806 to your computer and use it in GitHub Desktop.
Save edom18/972806 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 @@ = webkit . moz . ms . o
normal ""P
let @@ = reg_save
endfunction
nnoremap ,3 :<C-u>call CSS3PropertyDuplicate()<CR>
@Takazudo
Copy link

さすがえどさんや・・・!

@neotag
Copy link

neotag commented May 15, 2011

さすがえどさんや・・・!

@mattari-panda
Copy link

さすがえどさんや・・・!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment