Easy-to-use Vim plug-in: EasyGrep

Source: Internet
Author: User

Easy-to-use Vim plug-in: EasyGrep

# The powerful tool of GNU
Grep, AWK, Sed, find... The great GNU tool set is a powerful weapon that talents can write to themselves. Every one of them is like a clay, and the combination of two swords and several swords is even more indestructible. However, every one of them has a strange temper and is difficult to control. If they are insufficient in skill, they will attack themselves. These tools all have long parameter options. Apart from senior system administrators, I rarely see people who can really master and use them rationally. Most developers are familiar with some of the commands they often use, when they need to summon more powerful features, they often fail.

For example, in a project, there are many commands such as the following in the code compilation or installation script to clear the generated intermediate files, which are frequently used.

Find.-type f-name '*. if. *'-print0 | xargs-0 rm-rf

The most basic Linux Command, but I have never manually entered such a command. In case a parameter is wrong or another space is entered, who knows what will happen.

# Vim and Grep
As a motivated programmer, you still need to actively practice using these artifacts. For program development, Grep may be the most important among them. Find all the places where a function is used.

find . -name "*.cpp" | xargs grep "myfunction"

Find the crash process ......

ps -aux | grep "myapp"

Grep works with regular expressions in countless ways. If you like to study it, You can Google it. Our focus is Vim. Vim has built-in support for Grep, and Vim7.3 has updated the Grep engine. In Vim, Grep is faster. But in Vim, Grep is not easy to master. Fortunately, many plug-ins that simplify Grep can be used, including the grep variant ack, which is the most convenient to use and the easiest to use is EasyGrep.

EasyGrep features:

1. The visual configuration interface allows you to easily set the search path, configuration mode, and recursive mode.
2. You can directly search for words under the current cursor. You no longer need to manually enter the command.
3. It can be globally searched and replaced, which is particularly useful in code refactoring. Although this is the basic function of IDE, I haven't seen the plug-in Vim to achieve EasyGrep. You can choose whether to replace the current match. If you find that the current match is incorrect, you can cancel all replications with a single command.



Is the configuration interface of EasyGrep.

For more Vim tutorials, see the following:

Build VIM into a simple and practical IDE

Vim Learning Guide

Quick learn Vi Editor

Powerful Vim Editor

Build a Vim Development Environment on CentOS 6.2

Install the highlighted Vim editing tool in CentOS 5.4

Vim tips: C language settings

Set the Vim row number in Ubuntu

Vim editor basic tutorial

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.