vim - Vim 8 包干扰缩进?
问题描述
我最近切换到 Vim 8 以利用新的包功能。我今天注意到,当我使用=
自动更正缩进的键时,它现在破坏了一切。
这是损坏的缩进的样子:
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
我尝试过的事情:
- 我将唯一的包重命名为
vim/pack/my_packages/start/vim-rubocop_asdfjlkdf
然后,我的包没有加载,但问题仍然存在。 - 我将我的
vim/pack
文件重命名为任意名称,例如vim/pack_asdlkfjasdf
然后缩进再次开始工作,但当然我的包没有加载
这是我的超级简单 vim 文件设置的链接:https ://github.com/latazzajones/dotfiles/tree/master/vim
任何意见将是有益的
解决方案
From looking at you vimrc
, it seems the following is missing:
filetype plugin indent on
This enables to load filetype specific plugins and indent files.
See :help :filetype
, :help :filetype-plugin-on
and :help :filetype-indent-on
.
推荐阅读
- hadoop - 使用 DATE over TIMESTAMP 是否有性能改进?
- sql - 如何在通过触发器的字符变化中保存带有逗号的数据?
- ios - 由于某种原因,托管对象上下文在 iOS 中为零
- unity3d - 无法列出目标平台 Unity 2018.1.0f2
- android - 如何初始化 BLE 设备以发送一些字符串?
- android - FCM 15.0.2 无法使用 Dexguard 在发布版本中制作令牌
- android - 通知推送 ruby on rails with firebase for ios and android
- json - 如何提取 64base 值并使用 awk 或 sed 替换 json 格式的值?
- javascript - 如果更改 url 失败,如何让 Chrome 抛出异常
- apache-kafka - Kafka Stream:优雅关闭