oops. :set ff=unix

This commit is contained in:
mattn
2011-09-22 17:18:30 +09:00
parent 775dfb99e2
commit 44619b2584
2 changed files with 2218 additions and 2218 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,137 +1,137 @@
"============================================================================= "=============================================================================
" File: zencoding.vim " File: zencoding.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com> " Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
" Last Change: 22-Sep-2011. " Last Change: 22-Sep-2011.
" Version: 0.54 " Version: 0.54
" WebPage: http://github.com/mattn/zencoding-vim " WebPage: http://github.com/mattn/zencoding-vim
" Description: vim plugins for HTML and CSS hi-speed coding. " Description: vim plugins for HTML and CSS hi-speed coding.
" SeeAlso: http://code.google.com/p/zen-coding/ " SeeAlso: http://code.google.com/p/zen-coding/
" Usage: " Usage:
" "
" This is vim script support expanding abbreviation like zen-coding. " This is vim script support expanding abbreviation like zen-coding.
" ref: http://code.google.com/p/zen-coding/ " ref: http://code.google.com/p/zen-coding/
" "
" Type abbreviation " Type abbreviation
" +------------------------------------- " +-------------------------------------
" | html:5_ " | html:5_
" +------------------------------------- " +-------------------------------------
" "_" is a cursor position. and type "<c-y>," (Ctrl+y and Comma) " "_" is a cursor position. and type "<c-y>," (Ctrl+y and Comma)
" NOTE: Don't worry about key map. you can change it easily. " NOTE: Don't worry about key map. you can change it easily.
" +------------------------------------- " +-------------------------------------
" | <!DOCTYPE HTML> " | <!DOCTYPE HTML>
" | <html lang="en"> " | <html lang="en">
" | <head> " | <head>
" | <title></title> " | <title></title>
" | <meta charset="UTF-8"> " | <meta charset="UTF-8">
" | </head> " | </head>
" | <body> " | <body>
" | _ " | _
" | </body> " | </body>
" | </html> " | </html>
" +------------------------------------- " +-------------------------------------
" Type following " Type following
" +------------------------------------- " +-------------------------------------
" | div#foo$*2>div.bar " | div#foo$*2>div.bar
" +------------------------------------- " +-------------------------------------
" And type "<c-y>," " And type "<c-y>,"
" +------------------------------------- " +-------------------------------------
" |<div id="foo1"> " |<div id="foo1">
" | <div class="bar">_</div> " | <div class="bar">_</div>
" |</div> " |</div>
" |<div id="foo2"> " |<div id="foo2">
" | <div class="bar"></div> " | <div class="bar"></div>
" |</div> " |</div>
" +------------------------------------- " +-------------------------------------
" "
" Tips: " Tips:
" "
" You can customize behavior of expanding with overriding config. " You can customize behavior of expanding with overriding config.
" This configuration will be marged at loading plugin. " This configuration will be marged at loading plugin.
" "
" let g:user_zen_settings = { " let g:user_zen_settings = {
" \ 'indentation' : ' ', " \ 'indentation' : ' ',
" \ 'perl' : { " \ 'perl' : {
" \ 'aliases' : { " \ 'aliases' : {
" \ 'req' : 'require ' " \ 'req' : 'require '
" \ }, " \ },
" \ 'snippets' : { " \ 'snippets' : {
" \ 'use' : "use strict\nuse warnings\n\n", " \ 'use' : "use strict\nuse warnings\n\n",
" \ 'warn' : "warn \"|\";", " \ 'warn' : "warn \"|\";",
" \ } " \ }
" \ } " \ }
" \} " \}
" "
" You can set language attribute in html using 'zen_settings.lang'. " You can set language attribute in html using 'zen_settings.lang'.
" "
" GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim " GetLatestVimScripts: 2981 1 :AutoInstall: zencoding.vim
" script type: plugin " script type: plugin
if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim) if &cp || (exists('g:loaded_zencoding_vim') && g:loaded_zencoding_vim)
finish finish
endif endif
let g:loaded_zencoding_vim = 1 let g:loaded_zencoding_vim = 1
let s:save_cpo = &cpo let s:save_cpo = &cpo
set cpo&vim set cpo&vim
if !exists('g:zencoding_debug') if !exists('g:zencoding_debug')
let g:zencoding_debug = 0 let g:zencoding_debug = 0
endif endif
if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag if exists('g:use_zen_complete_tag') && g:use_zen_complete_tag
setlocal omnifunc=zencoding#CompleteTag setlocal omnifunc=zencoding#CompleteTag
endif endif
if !exists('g:user_zen_leader_key') if !exists('g:user_zen_leader_key')
let g:user_zen_leader_key = '<c-y>' let g:user_zen_leader_key = '<c-y>'
endif endif
function! s:install_plugin() function! s:install_plugin()
for item in [ for item in [
\ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(0)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandAbbr', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(0)<cr>a'},
\ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2)<cr>'}, \ {'mode': 'v', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandVisual', 'func': ':call zencoding#expandAbbr(2)<cr>'},
\ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zencoding#expandAbbr(3)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_expandabbr_key', 'key': ',', 'plug': 'ZenCodingExpandNormal', 'func': ':call zencoding#expandAbbr(3)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': ';', 'plug': 'ZenCodingExpandWord', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(1)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_expandword_key', 'key': ';', 'plug': 'ZenCodingExpandWord', 'func': '<c-g>u<esc>:call zencoding#expandAbbr(1)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_expandword_key', 'key': ',', 'plug': 'ZenCodingExpandWord', 'func': ':call zencoding#expandAbbr(1)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_expandword_key', 'key': ',', 'plug': 'ZenCodingExpandWord', 'func': ':call zencoding#expandAbbr(1)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardInsert', 'func': '<esc>:call zencoding#balanceTag(1)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardInsert', 'func': '<esc>:call zencoding#balanceTag(1)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardNormal', 'func': ':call zencoding#balanceTag(1)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardNormal', 'func': ':call zencoding#balanceTag(1)<cr>'},
\ {'mode': 'v', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardVisual', 'func': ':call zencoding#balanceTag(2)<cr>'}, \ {'mode': 'v', 'var': 'user_zen_balancetaginward_key', 'key': 'd', 'plug': 'ZenCodingBalanceTagInwardVisual', 'func': ':call zencoding#balanceTag(2)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardInsert', 'func': '<esc>:call zencoding#balanceTag(-1)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardInsert', 'func': '<esc>:call zencoding#balanceTag(-1)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardNormal', 'func': ':call zencoding#balanceTag(-1)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardNormal', 'func': ':call zencoding#balanceTag(-1)<cr>'},
\ {'mode': 'v', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardVisual', 'func': ':call zencoding#balanceTag(-2)<cr>'}, \ {'mode': 'v', 'var': 'user_zen_balancetagoutward_key', 'key': 'D', 'plug': 'ZenCodingBalanceTagOutwardVisual', 'func': ':call zencoding#balanceTag(-2)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': '<esc>:call zencoding#moveNextPrev(0)<cr>'}, \ {'mode': 'i', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': '<esc>:call zencoding#moveNextPrev(0)<cr>'},
\ {'mode': 'n', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call zencoding#moveNextPrev(0)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_next_key', 'key': 'n', 'plug': 'ZenCodingNext', 'func': ':call zencoding#moveNextPrev(0)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': '<esc>:call zencoding#moveNextPrev(1)<cr>'}, \ {'mode': 'i', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': '<esc>:call zencoding#moveNextPrev(1)<cr>'},
\ {'mode': 'n', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call zencoding#moveNextPrev(1)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_prev_key', 'key': 'N', 'plug': 'ZenCodingPrev', 'func': ':call zencoding#moveNextPrev(1)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': '<esc>:call zencoding#imageSize()<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': '<esc>:call zencoding#imageSize()<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call zencoding#imageSize()<cr>'}, \ {'mode': 'n', 'var': 'user_zen_imagesize_key', 'key': 'i', 'plug': 'ZenCodingImageSize', 'func': ':call zencoding#imageSize()<cr>'},
\ {'mode': 'i', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': '<esc>:call zencoding#toggleComment()<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': '<esc>:call zencoding#toggleComment()<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call zencoding#toggleComment()<cr>'}, \ {'mode': 'n', 'var': 'user_zen_togglecomment_key', 'key': '/', 'plug': 'ZenCodingToggleComment', 'func': ':call zencoding#toggleComment()<cr>'},
\ {'mode': 'i', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagInsert', 'func': '<esc>:call zencoding#splitJoinTag()<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagInsert', 'func': '<esc>:call zencoding#splitJoinTag()<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagNormal', 'func': ':call zencoding#splitJoinTag()<cr>'}, \ {'mode': 'n', 'var': 'user_zen_splitjointag_key', 'key': 'j', 'plug': 'ZenCodingSplitJoinTagNormal', 'func': ':call zencoding#splitJoinTag()<cr>'},
\ {'mode': 'i', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': '<esc>:call zencoding#removeTag()<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': '<esc>:call zencoding#removeTag()<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call zencoding#removeTag()<cr>'}, \ {'mode': 'n', 'var': 'user_zen_removetag_key', 'key': 'k', 'plug': 'ZenCodingRemoveTag', 'func': ':call zencoding#removeTag()<cr>'},
\ {'mode': 'i', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': '<esc>:call zencoding#anchorizeURL(0)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': '<esc>:call zencoding#anchorizeURL(0)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call zencoding#anchorizeURL(0)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_anchorizeurl_key', 'key': 'a', 'plug': 'ZenCodingAnchorizeURL', 'func': ':call zencoding#anchorizeURL(0)<cr>'},
\ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call zencoding#anchorizeURL(1)<cr>a'}, \ {'mode': 'i', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': '<esc>:call zencoding#anchorizeURL(1)<cr>a'},
\ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call zencoding#anchorizeURL(1)<cr>'}, \ {'mode': 'n', 'var': 'user_zen_anchorizesummary_key', 'key': 'A', 'plug': 'ZenCodingAnchorizeSummary', 'func': ':call zencoding#anchorizeURL(1)<cr>'},
\] \]
if !hasmapto('<plug>'.item.plug, item.mode) if !hasmapto('<plug>'.item.plug, item.mode)
exe item.mode . 'noremap <plug>' . item.plug . ' ' . item.func exe item.mode . 'noremap <plug>' . item.plug . ' ' . item.func
endif endif
if !exists('g:' . item.var) if !exists('g:' . item.var)
exe 'let g:' . item.var . " = '" . g:user_zen_leader_key . item.key . "'" exe 'let g:' . item.var . " = '" . g:user_zen_leader_key . item.key . "'"
endif endif
if len(maparg(eval('g:' . item.var), item.mode)) == 0 if len(maparg(eval('g:' . item.var), item.mode)) == 0
exe item.mode . 'map <unique> ' . eval('g:' . item.var) . ' <plug>' . item.plug exe item.mode . 'map <unique> ' . eval('g:' . item.var) . ' <plug>' . item.plug
endif endif
endfor endfor
endfunction endfunction
call s:install_plugin() call s:install_plugin()
delfunction s:install_plugin delfunction s:install_plugin
let &cpo = s:save_cpo let &cpo = s:save_cpo
unlet s:save_cpo unlet s:save_cpo
" vim:set et: " vim:set et: