首页 \ 问答 \ 每当我切换到它时,VIM刷新缓冲区(VIM refreshing buffer whenever I switch to it)

每当我切换到它时,VIM刷新缓冲区(VIM refreshing buffer whenever I switch to it)

我正在使用VIM编辑SCP上的文件,因此读取和写入文件是一个非常缓慢的过程。

出于某种原因,每当我切换到缓冲区时,VIM都会从磁盘读取它。 状态栏显示:〜@ k。

我已经禁用了.vimrc中的所有自动命令,而且我还没有BufEnter的自动命令。 知道我可能会缺少什么吗?

更新:我发现了一个罪魁祸首,一个不是自动命令的字数宏。 现在,当我切换它时,它会更快,但仍然很慢。 状态栏说^ Ww。

更新2:我在下面尝试了ZyX的答案(谢谢!!)。 结果:

1)设置eventignore = all绝对解决它; 它的速度非常快。 但是2)尝试调试它对我不起作用。

我尝试了两个:debug buffer scp-buffer-name:debug wincmd p并得到:

进入调试模式。 输入“cont”继续。

cmd:wincmd p

第1行:对于m in filter(copy(fuf#getModeNames()),'fuf#{v:val} #requiresOnCommandPre()')`

然后无论我键入什么(s,n,“cont”),该单行都会重复。 它显然与Fuzzy Finder插件有关,我使用了很多,这是我使用VIM的一个关键原因。 有任何想法吗?

再次感谢你的帮助。 非常感谢,XyZ!

问题已解决:确实是模糊查找器。 它具有MRU-File模式,在切换缓冲区时,文档说明可能会导致性能问题。 我禁用了这种模式,现在VIM又快了! 谢谢!


I'm using VIM to edit files over SCP, so reading and writing files is a very slow process.

For some reason, whenever I switch to a buffer, VIM reads it from disk. The status bar says: ~@k.

I've disabled all autocommands in my .vimrc, and I have no autocommands for BufEnter anyway. Any idea what I might be missing?

Update: I found one culprit, a word-count macro which wasn't an auto-command. Now when I switch it's a tad faster but still slow. Status bar says ^Ww.

Update 2: I tried ZyX's answer below (Thanks!!). The results:

1) setting eventignore=all absolutely solves it; it's blazing fast. BUT 2) trying to debug it doesn't work for me.

I tried both :debug buffer scp-buffer-name and :debug wincmd p and got:

Entering Debug mode. Type "cont" to continue.

cmd: wincmd p

line 1: for m in filter(copy(fuf#getModeNames()), 'fuf#{v:val}#requiresOnCommandPre()')`

And then no matter what I typed (s, n, "cont"), that single line would just repeat. It's obviously related to the Fuzzy Finder plugin, which I do use quite a lot and is a key reason for me to use VIM. Any ideas?

Thanks again for your help. Much appreciated, XyZ!

ISSUE SOLVED: It was indeed Fuzzy Finder. It has a MRU-File mode which documentation notes may cause a performance issue when switching buffers. I disabled this mode and now VIM is fast again! Thanks!


原文:https://stackoverflow.com/questions/5166999
更新时间:2022-02-17 08:02

最满意答案

如何检查是否已使用适当的参数调用I18n.with_locale

it 'sets locale from request'
  allow(I18n).to receive(:with_locale)
  get :action, locale: locale
  expect(I18n).to have_received(:with_locale).with(locale)
end

How about checking if I18n.with_locale has been called with proper parameters.

it 'sets locale from request'
  allow(I18n).to receive(:with_locale)
  get :action, locale: locale
  expect(I18n).to have_received(:with_locale).with(locale)
end

相关问答

更多
  • 他们的建议转换如下: setup do @request.env['HTTP_REFERER'] = 'http://test.com/sessions/new' post :create, { :user => { :email => 'invalid@abc' } } end Their recommendation translates to the following: setup do @request.env['HTTP_REFERER'] = 'http://test.com/s ...
  • 在我回答你的问题之前:在你的情况下会使用Bugsnag或类似的工作吗? 另外, rescue_from Exception, with: :exception_handler为你工作? (虽然不允许你再加上例外) 我挖掘Rails源代码,似乎参数不存储在任何地方。 它们只是作为splat传递给您的邮件程序类中定义的实例方法。 但是,有一种方法可以存储它们(没有猴子修补)。 邮件程序继承自AbstractController::Base 。 看下面的代码: # Call the action. Overr ...
  • 你在打电话吗? load_resource_authorize_resource 在你的控制器中就是这样,还是你包括一个模型来授权? 我发现我可以复制你的问题,如果我输入如下内容: load_resource_authorize_resource Deck 我认为后者不起作用的原因是因为您要求CanCan任意授权“Deck”,而不是授权控制器操作,而这正是您真正想要做的。 Are you calling load_resource_authorize_resource in your contro ...
  • around_action更像是append_before_action + prepend_after_action 。 在内部,想想它就像rails有两个数组, @before_actions和@after_actions 。 因此,当您声明around_action ,它会将其推送/追加到@before_actions的末尾,并且它会@before_actions / @after_actions到@after_actions 。 快速测试如下: class SomeController < Appl ...
  • 使用单引号括起条件: class Profile < ActiveRecord::Base has_many :friendships has_many :removed_friends, :class_name => 'Profile', :through => :friendships, :conditions => ' ( friendships.profile_id = #{self.id} OR friend ...
  • 如何检查是否已使用适当的参数调用I18n.with_locale 。 it 'sets locale from request' allow(I18n).to receive(:with_locale) get :action, locale: locale expect(I18n).to have_received(:with_locale).with(locale) end How about checking if I18n.with_locale has been called wit ...
  • http://guides.rubyonrails.org/active_record_querying.html 阅读13.2在预先加载的关联中指定条件 Using where like this will only work when you pass it a Hash. For SQL-fragments you need use references to force joined tables: Article.includes(:comments).where("comments.visib ...
  • Per steve klein的评论。 我喜欢这种解决方案,因为它的透明度。 如果这不是一个假设的例子,我肯定会重新使用satisfies_condition方法来获取参数数组(对于DRYness)。 before_action :a_or_b_or_c, only: [:show] before_action :b_or_c, only: [:edit, :update, :destroy] before_action :c, only: [:index] ... private def a_or_ ...
  • 你需要使用: my_user.awesome_friends.create(:name=>'jim')或my_user.awesome_friends.build(:name=>'jim') 在文档中: has_many(:conditions) 如果使用散列,则关联的记录创建是作用域的。 has_many:posts,:conditions => {:published => true}将使用@ blog.posts.create或@ blog.posts.build创建已发布的帖子。 You need ...
  • 它们是等价的。 on: :create只是一个DSL版本,然后最终转换(在后台) if: :new_record 。 来自rails的源代码 验证(参见validations / validates.rb#L123)引导我们validates_with (参见验证/ with.rb#L92),导致我们validate (参见validations.rb#L162)我们可以看到on成为if : if options.key?(:on) options = options.dup ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)