存档

  • Vim中避免缩进C++ Namespace

    Vim的cinoptions不支持定制C++的namespace缩进。不过,可以重写indent文件,把下面这个文件放到vimfiles/indent目录,即可。 cpp.vim如下: [code] " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 " Set the function to do the work. setlocal indentexpr=GetCppIndent() " Only define the function once. if exists("*GetCppIndent") finish endif function GetCppIndent() let indent = cindent(v:lnum) if v:lnum < 2 return indent endif [...]

    没有评论
    2011年12月31日 | 归档于 未分类
    标签:
  • 在Vim里给utf-8编码的文件加上BOM

    BOM: Byte Order Mark 简单来说,设置bomb选项(bomb/nobomb)。 今天编辑cue文件,中文曲目在foobar里不能正常显示,google后发现foobar是支持utf-8编码的cue文件的,只是要加上BOM。 于是在Vim里:h bom,得到方法如上。

    没有评论
    2011年12月27日 | 归档于 未分类
    标签:
‘未分类’ 分类的存档