Vim 8软件包干扰缩进?

时间:2019-02-12 22:50:58

标签: vim

我最近切换到Vim 8来利用新的packages功能。今天我注意到,当我使用=键自动校正缩进时,它现在破坏了一切。

这是破碎的缩进的样子:

  1 class FriendPolicy < ApplictionPolicy
  2 class Scope
  3 attr_reader :user, :friend
  4 
  5              def initialize(user, friend)
  6   @user = user
  7   @friend = friend
  8   end
  9 
 10   def resolve; end
 11   end
 12 
 13   def index?; end
 14   end

这是文件的外观:

  1 class FriendPolicy < ApplictionPolicy
  2   class Scope
  3     attr_reader :user, :friend
  4 
  5     def initialize(user, friend)
  6       @user = user
  7       @friend = friend
  8     end
  9 
 10     def resolve; end
 11   end
 12 
 13   def index?; end
 14 end

我尝试过的事情:

  1. 我将唯一的包重命名为vim/pack/my_packages/start/vim-rubocop_asdfjlkdf,然后,我的包未加载,但问题仍然存在。
  2. 我将vim/pack文件重命名为vim/pack_asdlkfjasdf之类的任意名称,然后缩进重新开始工作,但是当然我的包没有被加载

这是我超级简单的vim文件设置的链接:https://github.com/latazzajones/dotfiles/tree/master/vim

任何建议都会有所帮助

1 个答案:

答案 0 :(得分:0)

vimrc的角度来看您,似乎缺少了以下内容:

filetype plugin indent on

这可以加载特定于文件类型的插件和缩进文件。

请参见:help :filetype:help :filetype-plugin-on:help :filetype-indent-on

相关问题