河南 网站备案重庆渝北做网站哪里便宜
河南 网站备案,重庆渝北做网站哪里便宜,怎么弄一个自己的链接,wordpress 早期文章问题#xff1a;vim下怎样在php文件中通过 命令自动缩排html代码#xff1f;解决#xff1a;1、先说下html自动缩排
我的vim是7.4版本#xff0c;已经包含了html.vim之类的缩排插件#xff0c;但是缩排的时候body head 没有进行缩排
在.vimrc中加入如下代… 问题vim下怎样在php文件中通过 命令自动缩排html代码解决1、先说下html自动缩排
我的vim是7.4版本已经包含了html.vim之类的缩排插件但是缩排的时候body head 没有进行缩排
在.vimrc中加入如下代码即可对 body head 也进行缩排 html indent
filetype indent on
let g:html_indent_inctags body,head,tbody 缩进body headlet g:html_indent_script1 inc 缩进script标签let g:html_indent_style1 inc 缩进style标签2、解决php文件中html代码缩进创建 ~/.vim/indent/php.vim 文件如果没有indent目录就先创建indent目录
然后在 php.vim 文件中粘贴如下代码并保存 Better indent support for PHP by making it possible to indent HTML sectionsas well.
if exists(b:did_indent)finish
endifThis script pulls in the default indent/php.vim with the :runtime commandwhich could re-run this script recursively unless we catch that:
if exists(s:doing_indent_inits)finish
endif
let s:doing_indent_inits 1
runtime! indent/html.vim
unlet b:did_indent
runtime! indent/php.vim
unlet s:doing_indent_inits
function! GetPhpHtmlIndent(lnum)if exists(*HtmlIndent)let html_ind HtmlIndent()elselet html_ind HtmlIndentGet(a:lnum)endiflet php_ind GetPhpIndent() priority one for php indent scriptif php_ind -1return php_indendifif html_ind -1if getline(a:num) ~ ^? (0 searchpair(?, , ?, nWb)\ || 0 searchpair(?, , ?, nW))return -1endifreturn html_indendifreturn -1
endfunction
setlocal indentexprGetPhpHtmlIndent(v:lnum)
setlocal indentkeys3、在 .vimrc 中还需要添加 filetype indent on 打开根据文件类型自动缩进
在vim命令模式下中输入 ggG 即可完成自动缩排参考
http://www.vim.org/scripts/script.php?script_id2075
http://blog.longwin.com.tw/2009/01/vim-indent-for-php-html-2009/
http://cache.baiducontent.com/c?m9d78d513d9871af04fede53c5754c066680ec63c62c0d0642488c51fcf224f060738ece161645213d2b6617a45f4164bea8773296e5873a09bbfd91782a6d77376d33a44275ac01652c41edb901a73967cd64deedb58a0f8b26fd3e8c5d4ab000e8a44020ec2aac94d07608f34b64e26e4d2c30e4a01pc06ccc04969d12a05abd9b7e0b1791newp9370c64ad48703fa08e294780c4dcf231610db2151d6d7143b96c6userbaidufmscqueryvimphphtmlindentqida72951080000046dp12转载于:https://www.cnblogs.com/zcube/p/4222410.html
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/89056.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!