diff --git a/.vimrc b/.vimrc index eb10dcba..8ace701d 100644 --- a/.vimrc +++ b/.vimrc @@ -2,6 +2,7 @@ set sw=4 set ts=4 set et set smarttab +set smartindent set lbr set fo+=mB set sm @@ -91,6 +92,7 @@ set iskeyword+=_,$,@,%,#,- "markdown配置 au BufRead,BufNewFile *.{md,mdown,mkd,mkdn,markdown,mdwn} set filetype=mkd au BufRead,BufNewFile *.{go} set filetype=go +au BufRead,BufNewFile *.{js} set filetype=javascript "rkdown to HTML nmap md :!~/.vim/markdown.pl % > %.html nmap fi :!firefox %.html & @@ -231,6 +233,7 @@ func FormartSrc() exec "!astyle --style=gnu --suffix=none %" else exec "normal gg=G" + return endif exec "e! %" endfunc @@ -311,7 +314,6 @@ set matchtime=1 " 光标移动到buffer的顶部和底部时保持3行距离 set scrolloff=3 " 为C程序提供自动缩进 -set smartindent "自动补全 "":inoremap ( ()i "":inoremap ) =ClosePair(')') @@ -440,9 +442,15 @@ Bundle 'Javascript-OmniCompletion-with-YUI-and-j' Bundle 'JavaScript-Indent' Bundle 'Better-Javascript-Indentation' Bundle 'jslint.vim' +Bundle "pangloss/vim-javascript" +Bundle 'Vim-Script-Updater' +Bundle 'jsbeautify' "Bundle 'FredKSchott/CoVim' "Bundle 'djangojump' " ... +let g:html_indent_inctags = "html,body,head,tbody" +let g:html_indent_script1 = "inc" +let g:html_indent_style1 = "inc" filetype plugin indent on " required! " diff --git a/bundle/Vim-Script-Updater b/bundle/Vim-Script-Updater new file mode 160000 index 00000000..f33f67ae --- /dev/null +++ b/bundle/Vim-Script-Updater @@ -0,0 +1 @@ +Subproject commit f33f67ae621dbea23aa1164903882a38f02a0e1f diff --git a/bundle/jsbeautify b/bundle/jsbeautify new file mode 160000 index 00000000..0a185607 --- /dev/null +++ b/bundle/jsbeautify @@ -0,0 +1 @@ +Subproject commit 0a185607de8ed3e115fc5a6e6ebe6c5403994f25 diff --git a/bundle/vim-javascript b/bundle/vim-javascript new file mode 160000 index 00000000..b21629b3 --- /dev/null +++ b/bundle/vim-javascript @@ -0,0 +1 @@ +Subproject commit b21629b371cc4b8ab76a59a6bc920082b00eb126 diff --git a/update_log.md b/update_log.md index 7d462bae..888738e5 100644 --- a/update_log.md +++ b/update_log.md @@ -4,6 +4,7 @@ - 增加javascript插件 - 增加常见的dict +- 完善``对javascript的支持 ### 2013年5月31日更新