1

我有这段 PHP 代码:

    } elseif($uri->next() == "list"){
      bla();
      /*****************************************
       * Get empty relation by type             *
       * ====================================== *
       * GET /api.php?/relations/(string)/list  *
       ******************************************/
  //get a list of all relations with the specified type.
  $rel->giveRelationsOfType($relationType);
    } elseif($uri->end()){

它的缩进完全按照上面显示的方式自动完成。我当然希望我的 elseif 块中的所有内容都缩进到与“bla”相同的列,如下所示:

    } elseif($uri->next() == "list"){
      bla();
      /*****************************************
       * Get empty relation by type             *
       * ====================================== *
       * GET /api.php?/relations/(string)/list  *
       ******************************************/
      //get a list of all relations with the specified type.
      $rel->giveRelationsOfType($relationType);
    } elseif($uri->end()){

但是当我选择整个块(可视模式)并按时=,缩进变回我的第一个示例的缩进。我尝试了上述几种变体;多行注释似乎是奇怪的缩进所依赖的东西。

我的格式选项(set fo?)是2qwcbro. (按:h fo-table信息)在我的vimrc我有

set smartindent
set tabstop=2
set shiftwidth=2
set expandtab

但是,set smartindent似乎被我的文件类型或其他东西关闭了,即使在{. 打开 smartindent 没有帮助。

4

0 回答 0