vim: vim-qargs

104 篇文章 1 订阅

CREATED

8 years ago

UPDATED

5 years ago

VIM.ORGGITHUB

INSTALL FROM

  • Vundle
  • NeoBundle
  • VimPlug
  • Pathogen

Place this in your .vimrc:

Plugin 'henrik/vim-qargs'

… then run the following in Vim:

:source %
:PluginInstall

For Vundle version < 0.10.2, replace Plugin with Bundle above.

 

 Uncategorized

  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

TAGS

 EDIT

A Vim plugin for executing operations on the files in the quickfix list.

If the current window has a local quickfix list (a location list), then it's used instead of the global quickfix list, otherwise the global quickfix list is used.

Qdo command

The plugin adds a :Qdo command, which executes a command once for each file in the quickfix list.

Usage example:

:GitGrep foo.*bar
:Qdo %s/foo.*bar/baz/g | update

This will replace text and save the buffers for each file found by GitGrep in the previous search.

Qargs command

The plugin also adds a :Qargs command, which populates the argument list from the files in the quickfix list. Each file is only added once, even if there are multiple lines for the same file in the quickfix list.

Usage example:

:args *.txt
:vimgrep /foo/g ##
:Qargs
:argdo %s/foo/bar/ge
:argdo update

References

For an step-by-step guide and explanation, refer to the article Project Wide Search And Replace In Vim With Qdo.

For a video tutorial of search and replace strategies, and the original code which this plugin is based on, refer to Project-wide find and replace.

For a description of the need and the approach used by this solution, refer to the question Search & replace using quickfix list in Vim.

Vim Awesome is a directory of Vim plugins sourced from GitHub, Vim.org, and user submissions. Plugin usage data is extracted from dotfiles repos on GitHub.

Made with vim and vigor by David HuSophie Alpert, and Emily Eisenberg.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值