config files systemized

This commit is contained in:
Chiel92 2012-10-10 01:04:23 +02:00
parent 84b9467a3d
commit 898c6e4ac7
9 changed files with 10253 additions and 4794 deletions

8
ftplugin/css.vim Normal file
View File

@ -0,0 +1,8 @@
let &formatexpr="CSSBeautify()"
let s:bundleDir = fnamemodify(expand("<sfile>"), ":h:h:h")
let g:cssbeautify_file = fnameescape(s:bundleDir."/js-beautify/beautify-css.js")
let g:cssbeautify = {'indent_size': 4, 'indent_char': ' '}
set expandtab
set tabstop=4
set shiftwidth=4

8
ftplugin/html.vim Normal file
View File

@ -0,0 +1,8 @@
let &formatexpr="HtmlBeautify()"
let s:bundleDir = fnamemodify(expand("<sfile>"), ":h:h:h")
let g:htmlbeautify_file = fnameescape(s:bundleDir."/js-beautify/beautify-html.js")
let g:htmlbeautify = {'indent_size': 2, 'indent_char': ' ', 'max_char': 78, 'brace_style': 'expand', 'unformatted': ['a', 'sub', 'sup', 'b', 'i', 'u']}
set expandtab
set tabstop=2
set shiftwidth=2

8
ftplugin/javascript.vim Normal file
View File

@ -0,0 +1,8 @@
let &formatexpr="JsBeautify()"
let s:bundleDir = fnamemodify(expand("<sfile>"), ":h:h:h")
let g:jsbeautify_file = fnameescape(s:bundleDir."/js-beautify/beautify.js")
let g:jsbeautify = {'indent_size': 4, 'indent_char': ' '}
set expandtab
set tabstop=4
set shiftwidth=4

2
ftplugin/php.vim Normal file
View File

@ -0,0 +1,2 @@
let &formatprg="phpCB --space-after-if --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --one-true-brace-function-declaration --glue-amperscore --change-shell-comment-to-double-slashes-comment --force-large-php-code-tag --force-true-false-null-contant-lowercase --align-equal-statements --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 4"

View File

@ -1,11 +1,5 @@
"Set the format programs for the right filetypes
au filetype javascript let &formatexpr="JsBeautify()"
au filetype html let &formatexpr="HtmlBeautify()"
au filetype css let &formatexpr="CSSBeautify()"
au filetype php let &formatprg="phpCB --space-after-if --space-after-switch --space-after-while --space-before-start-angle-bracket --space-after-end-angle-bracket --one-true-brace-function-declaration --glue-amperscore --change-shell-comment-to-double-slashes-comment --force-large-php-code-tag --force-true-false-null-contant-lowercase --align-equal-statements --comment-rendering-style PEAR --equal-align-position 50 --padding-char-count 4"
"Function for formatting the entire buffer
function g:VimAutoformat()
function! g:Autoformat()
"Save window state
let winview=winsaveview()
"Autoformat code
@ -13,4 +7,3 @@ function g:VimAutoformat()
"Recall window state
call winrestview(winview)
endfunction

22
tests/- Normal file
View File

@ -0,0 +1,22 @@
[?1049h[?1h=[?12;25h[?12l[?25h[?25l"html2.htm" 14L, 851C
Error detected while processing /home/chiel/.vim/bundle/vim-autoformat/ftplugin
/html.vim:
line 3:
E121: Undefined variable: s:bundle
E116: Invalid arguments for function fnameescape(s:bundle."/js-beautify/beautif
y-html.js")
E15: Invalid expression: fnameescape(s:bundle."/js-beautify/beautify-html.js")node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^
Error: ENOENT, no such file or directory '/home/chiel/.vim/bundle/vim-autoformatt/config/.vim/bundle/js-beautify/beautify-html.js'
at Object.openSync (fs.js:230:18)
at Object.readFileSync (fs.js:120:15)
at /home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1058
at /home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautify.min.js:1:928
at /home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautify.min.js:1:1172
at Object.<anonymous> (/home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautiffy.min.js:1:1283)
at Object.<anonymous> (/home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautiffy.min.js:1:1312)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:32)
~ ~ ~ ~ ~ ~ 1,1All]2;html2.htm (~/.vim/bundle/vim-autoformat/tests) - VIM]1;html2.htm[?12l[?25h[?25l2,9[?12l[?25h[?25l3,15[?12l[?25h[?25l4,1 [?12l[?25h[?25lType :quit<Enter> to exit Vim4,1All[?12l[?25h[?1l>[?1049lVim: Caught deadly signal HUP
Vim: Finished.
]2;chiel@ENIAC: ~/.vim/bundle/vim-autoformat/tests]1;chiel@ENIAC: ~/.vim/bundle/vim-autoformat/tests

View File

@ -212,31 +212,28 @@
</head>
<body>
<div id="u">
<a href="http://www.baidu.com/gaoji/preferences.html" name="tj_setting">搜索设置</a>|
<a href="https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F"
name="tj_login">登录</a>
<a href="https://passport.baidu.com/v2/?reg&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F"
target="_blank" name="tj_reg" class="reg">注册</a>
<div id="u"> <a href="http://www.baidu.com/gaoji/preferences.html" name="tj_setting">搜索设置</a>|
<a
href="https://passport.baidu.com/v2/?login&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F"
name="tj_login">登录</a> <a href="https://passport.baidu.com/v2/?reg&tpl=mn&u=http%3A%2F%2Fwww.baidu.com%2F"
target="_blank" name="tj_reg" class="reg">注册</a>
</div>
<div id="m">
<p id="lg">
<img src="http://www.baidu.com/img/baidu_sylogo1.gif" width="270" height="129"
usemap="#mp">
<map name="mp">
<area shape="rect" coords="40,25,230,95" href="http://hi.baidu.com/baidu/"
target="_blank" title="点此进入 百度的空间">
<area shape="rect" coords="40,25,230,95" href="http://hi.baidu.com/baidu/" target="_blank"
title="点此进入 百度的空间">
</map>
</p>
<p id="nv">
<a href="http://news.baidu.com">&nbsp;</a> 
<b>&nbsp;</b> 
<a href="http://tieba.baidu.com">&nbsp;</a> 
<a href="http://zhidao.baidu.com">&nbsp;</a> 
<a href="http://mp3.baidu.com">MP3</a> 
<a href="http://image.baidu.com">&nbsp;</a> 
<a href="http://video.baidu.com">&nbsp;</a> 
<a href="http://map.baidu.com">&nbsp;</a>
<p id="nv"> <a href="http://news.baidu.com">&nbsp;</a>  <b>&nbsp;</b>  <a href="http://tieba.baidu.com">&nbsp;</a> 
<a
href="http://zhidao.baidu.com">知&nbsp;</a>  <a href="http://mp3.baidu.com">MP3</a>  <a href="http://image.baidu.com">&nbsp;</a> 
<a
href="http://video.baidu.com">视&nbsp;</a>  <a href="http://map.baidu.com">&nbsp;</a>
</p>
<div id="fm">
<form name="f" action="/s">
@ -258,44 +255,44 @@
</span>
</span>
<ul id="mMenu">
<li>
<a href="#" name="ime_hw">手写</a>
<li> <a href="#" name="ime_hw">手写</a>
</li>
<li>
<a href="#" name="ime_py">拼音</a>
<li> <a href="#" name="ime_py">拼音</a>
</li>
<li class="ln"></li>
<li>
<a href="#" name="ime_cl">关闭</a>
<li> <a href="#" name="ime_cl">关闭</a>
</li>
</ul>
</div>
<p id="lk">
<a href="http://hi.baidu.com">空间</a> 
<a href="http://baike.baidu.com">百科</a> 
<a href="http://www.hao123.com">hao123</a>
<span>|
<a href="/more/">更多&gt;&gt;</a>
</span>
<p id="lk"> <a href="http://hi.baidu.com">空间</a>  <a href="http://baike.baidu.com">百科</a> 
<a
href="http://www.hao123.com">hao123</a>
<span>| <a href="/more/">更多&gt;&gt;</a>
</span>
</p>
<p id="lm"></p>
<p>
<a id="seth" onClick="h(this)" href="http://utility.baidu.com/traf/click.php?id=215&url=http://www.baidu.com"
<p> <a id="seth" onClick="h(this)" href="http://utility.baidu.com/traf/click.php?id=215&url=http://www.baidu.com"
onmousedown="return
ns_c({'fm':'behs','tab':'homepage','pos':0})">把百度设为主页</a>
<a id="setf" onClick="fa(this)" href="javascript:void(0)" onmousedown="return
<a id="setf"
onClick="fa(this)" href="javascript:void(0)" onmousedown="return
ns_c({'fm':'behs','tab':'favorites','pos':0})">把百度加入收藏夹</a>
</span>
</p>
<p id="lh">
<a href="http://e.baidu.com/?refer=888">加入百度推广</a>|
<a href="http://top.baidu.com">搜索风云榜</a>|
<a href="http://home.baidu.com">关于百度</a>|
<a href="http://ir.baidu.com">About Baidu</a>
<p id="lh"> <a href="http://e.baidu.com/?refer=888">加入百度推广</a>| <a href="http://top.baidu.com">搜索风云榜</a>|
<a
href="http://home.baidu.com">关于百度</a>| <a href="http://ir.baidu.com">About Baidu</a>
</p>
<p id="cp">&copy;2012 Baidu
<a href="/duty/">使用百度前必读</a>
<a href="http://www.miibeian.gov.cn" target="_blank">京ICP证030173号</a>
<p id="cp">&copy;2012 Baidu <a href="/duty/">使用百度前必读</a>
<a href="http://www.miibeian.gov.cn"
target="_blank">京ICP证030173号</a>
<img src="http://www.baidu.com/cache/global/img/gs.gif">
</p>
</div>
@ -415,4 +412,3 @@
</html>
<script type="text/javascript" src="http://s1.bdstatic.com/r/www/cache/hps/js/hps-1.5.js"></script>
<!--5f027294b67998b5-->

File diff suppressed because one or more lines are too long

14830
tests/js.js

File diff suppressed because it is too large Load Diff