在Vim中为yanking选择不相交的代码块
发布时间:2020-12-15 17:00:17 所属栏目:安全 来源:网络整理
导读:我想知道我能否在Vim中做到这一点: 示例代码: require 'abstract_controller/collector'require 'active_support/core_ext/hash/reverse_merge'require 'active_support/core_ext/array/extract_options'require 'IDONTWANTTHISLINETOBEINCLUDEDINMYYANKRE
我想知道我能否在Vim中做到这一点:
示例代码: require 'abstract_controller/collector' require 'active_support/core_ext/hash/reverse_merge' require 'active_support/core_ext/array/extract_options' require 'IDONTWANTTHISLINETOBEINCLUDEDINMYYANKREGISTER' require 'IDONTWANTTHISLINETOBEINCLUDEDINMYYANKREGISTER' module ActionMailer #:nodoc: class Collector include AbstractController::Collector attr_reader :responses def initialize(context,&block) @context = context @responses = [] @default_render = block end def any(*args,&block) options = args.extract_options! raise "You have to supply at least one format" if args.empty? args.each { |type| send(type,options.dup,&block) } end alias :all :any def custom(mime,options={}) options.reverse_merge!(:content_type => mime.to_s) @context.freeze_formats([mime.to_sym]) options[:body] = block_given? ? yield : @default_render.call @responses << options end end end 现在假设我只想抽出一些线并将它们放在另一个文件中.假设我想要猛拉这些线条: 块1: require 'abstract_controller/collector' require 'active_support/core_ext/hash/reverse_merge' require 'active_support/core_ext/array/extract_options' 块2: module ActionMailer #:nodoc: class Collector include AbstractController::Collector attr_reader :responses def initialize(context,&block) @context = context @responses = [] @default_render = block end 块3: def custom(mime,options={}) options.reverse_merge!(:content_type => mime.to_s) @context.freeze_formats([mime.to_sym]) options[:body] = block_given? ? yield : @default_render.call @responses << options end end end 这些线不形成连续的线组,它们是分开的.所以为了实现我想要的东西,我必须分3个步骤来抓住这些块,我觉得很烦人.因为我必须猛拉,切换缓冲区,放置,猛拉,放……等等…… 那么,有没有办法更有效地完成这项工作(一步到位)?
在追加模式下使用寄存器:
>视觉上选择前三行,“ay 你喜欢寄存器吗? This answer is more in-depth. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- WebService的原理及概念
- angularjs – Angular .controller()在.run()之前运行
- bash – 只有在command1成功执行cmd windows shell时,才能运
- python – 使用memcache.add()而不是set()
- angularjs – Angular JS ng-repeat消耗更多的浏览器内存
- twitter-bootstrap – AngularJS ng-click在popover内破碎
- bash – 各种shell配置文件有什么区别?
- AngularJS进阶(四十)创建模块、服务
- Webservice 访问 随笔记载
- angularjs – 如何在角网页应用中使用Firebase隐形reCAPTCH