为什么大括号(ExpressionEngine标签)导致行包装在HTML中?

时间:2013-10-21 17:27:55

标签: vim

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

  1. formatoptions包含c
  2. filetype plugin on已设置
  3. ExpressionEngine标记缩进(制表符或空格)并经过textwidth
  4. 似乎Vim正在考虑以[whitespace]{开头的行作为HTML中的注释,据我所知它不应该。有趣的是,即使Vim将此行视为注释,但设置为fo+=o,但点击o不会导致下一行添加任何类似花括号的内容。


    重现:

    1)使用vim -u NONE -N

    运行没有插件或设置的vim

    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)当您输入q

    &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
    

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

0 个答案:

没有答案