config files systemized
This commit is contained in:
parent
84b9467a3d
commit
898c6e4ac7
8
ftplugin/css.vim
Normal file
8
ftplugin/css.vim
Normal 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
8
ftplugin/html.vim
Normal 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
8
ftplugin/javascript.vim
Normal 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
2
ftplugin/php.vim
Normal 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"
|
||||
|
@ -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
22
tests/-
Normal file
@ -0,0 +1,22 @@
|
||||
[?1049h[?1h=[1;24r[?12;25h[?12l[?25h[27m[m[H[2J[?25l[24;1H"html2.htm" 14L, 851C
|
||||
Error detected while processing /home/chiel/.vim/bundle/vim-autoformat/ftplugin
|
||||
[23;80H/[24;1Hhtml.vim:
|
||||
line 3:
|
||||
E121: Undefined variable: s:bundle
|
||||
E116: Invalid arguments for function fnameescape(s:bundle."/js-beautify/beautif
|
||||
[23;80Hy[24;1H-html.js")
|
||||
E15: Invalid expression: fnameescape(s:bundle."/js-beautify/beautify-html.js")[1;1H[7L[1;1Hnode.js:201[2;8H throw e; // process.nextTick error, or 'error' event on first tick[3;14H ^
|
||||
Error: ENOENT, no such file or directory '/home/chiel/.vim/bundle/vim-autoformatt[5;1H/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.[36m<[manonymous[36m>[m (/home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautiff[12;1Hy.min.js:1:1283)
|
||||
at Object.[36m<[manonymous[36m>[m (/home/chiel/.vim/bundle/vim-jsbeautify/plugin/beautiff[14;1Hy.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)
|
||||
[1m[34m~ [19;1H~ [20;1H~ [21;1H~ [22;1H~ [23;1H~ [m[24;1H[K[24;63H1,1[11CAll]2;html2.htm (~/.vim/bundle/vim-autoformat/tests) - VIM]1;html2.htm[1;1H[?12l[?25h[?25l[24;63H2,9[2;9H[?12l[?25h[?25l[24;63H3,15[3;15H[?12l[?25h[?25l[24;63H4,1 [4;1H[?12l[?25h[?25l[24;1HType :quit<Enter> to exit Vim[24;63H[K[24;63H4,1[11CAll[4;1H[?12l[?25h[24;1H[?1l>[?1049lVim: Caught deadly signal HUP
|
||||
Vim: Finished.
|
||||
[24;1H]2;chiel@ENIAC: ~/.vim/bundle/vim-autoformat/tests]1;chiel@ENIAC: ~/.vim/bundle/vim-autoformat/tests
|
@ -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">新 闻</a>
|
||||
<b>网 页</b>
|
||||
<a href="http://tieba.baidu.com">贴 吧</a>
|
||||
<a href="http://zhidao.baidu.com">知 道</a>
|
||||
<a href="http://mp3.baidu.com">MP3</a>
|
||||
<a href="http://image.baidu.com">图 片</a>
|
||||
<a href="http://video.baidu.com">视 频</a>
|
||||
<a href="http://map.baidu.com">地 图</a>
|
||||
<p id="nv"> <a href="http://news.baidu.com">新 闻</a> <b>网 页</b> <a href="http://tieba.baidu.com">贴 吧</a>
|
||||
<a
|
||||
href="http://zhidao.baidu.com">知 道</a> <a href="http://mp3.baidu.com">MP3</a> <a href="http://image.baidu.com">图 片</a>
|
||||
<a
|
||||
href="http://video.baidu.com">视 频</a> <a href="http://map.baidu.com">地 图</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/">更多>></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/">更多>></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">©2012 Baidu
|
||||
<a href="/duty/">使用百度前必读</a>
|
||||
<a href="http://www.miibeian.gov.cn" target="_blank">京ICP证030173号</a>
|
||||
<p id="cp">©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
14830
tests/js.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user