0

我发现 ExpressionEngine 标记包含在 HTML 文件类型中,这取决于三个因素:

  1. formatoptions包括c
  2. filetype plugin on已设置
  3. ExpressionEngine 标记缩进(制表符或空格)并过去textwidth

似乎 Vim 正在考虑[whitespace]{以 HTML 中的注释开头的行,据我所知,它不应该这样做。有趣的是,尽管 Vim 认为这一行是注释,但使用fo+=oset 时,hito不会导致下一行前面加上花括号之类的东西。


重现:

1)使用没有插件或设置运行vimvim -u NONE -N

2)运行以下命令:

filetype plugin on
set tw=80
set tabstop=2
set ft=html
set fo-=t

此时文件类型为html,格式选项为cq

3) 插入以下 HTML/EE 代码:

<div>
  <p>
    {exp:structure:breadcrumb here_as_title="yes" inc_here="yes" separator="&rsaquo;"}

4) 当你输入qof时,文本会自动换行&rsaquo;


这是我的输出:version

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 22 2012 15:36:46)
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments -conceal
+cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float
+folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu
+mksession +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme
+netbeans_intg -osfiletype +path_extra -perl +persistent_undo +postscript +printer -profile +python/dyn -python3 +quickfix +reltime -rightleft +ruby/dyn +scrollbind
+signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp
-xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -D_FORTIFY_SOURCE=0 -Iproto -DHAVE_CONFIG_H -arch i386 -arch x86_64 -g -Os -pipe
Linking: gcc -arch i386 -arch x86_64 -o vim -lncurses

这对我来说真的很困惑,所以如果您需要更多信息来帮助我诊断,请告诉我。谢谢你。

4

0 回答 0