GithubHelp home page GithubHelp logo

mookid / iedit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victorhge/iedit

0.0 2.0 0.0 527 KB

Edit multiple regions simultaneously in a buffer or a region

Home Page: https://www.emacswiki.org/emacs/Iedit

Emacs Lisp 99.27% Shell 0.73%

iedit's Introduction

Iedit - Edit multiple regions in the same way simultaneously

http://melpa.org/packages/iedit-badge.svg http://stable.melpa.org/packages/iedit-badge.svg

./iedit-demo.gif

Introduction

This package includes Emacs minor modes (iedit-mode and iedit-rectangle-mode) based on a API library (iedit-lib) and allows you to edit one occurrence of some text in a buffer (possibly narrowed) or region, and simultaneously have other occurrences edited in the same way, with visual feedback as you type.

Normal work flow of Iedit mode is like:

  • Move to certain point and press C-; (The default key binding). All occurrences of a symbol, string or a region in the buffer are highlighted corresponding to the thing under the point, current mark and prefix argument. Refer to the document of `iedit-mode’ for details.
  • Edit one of the occurrences The change is applied to other occurrences simultaneously.
  • Finish - by pressing C-; again

Many other work flows to highlight occurrences are possible, for example, activation from isearch, incremental selection and markup tag pair selection.

You can also use Iedit mode as a quick way to temporarily show only the buffer lines that match the current text being edited. This gives you the effect of a temporary `keep-lines’ or `occur’. To get this effect, hit C-’ when in Iedit mode - it toggles hiding non-matching lines.

Renaming refactoring is convenient in Iedit mode

  • The symbol under point is selected as occurrence by default and only complete symbols are matched
  • With digit prefix argument 0, only occurrences in current function are matched
  • Restricting symbols in current region can be done by pressing C-; again
  • Last renaming refactoring is remembered and can be applied to other buffers later
  • Restricting the search area to just the current line can be done by pressing M-I.
  • Restricting the search area to the lines near the current line can be done by pressing M-{ and M-}. These will expand the search region one line at a time from the top and bottom. Add a prefix argument to go the opposite direction.

Iedit-rectangle-mode provides rectangle support with visible rectangle highlighting, which is similar with cua mode rectangle support. But it’s lighter weight and uses iedit mechanisms.

There are also some other facilities you may never think about. Refer to the document of function `iedit-mode’ (C-h f iedit-mode RET) for more details.

Installation instruction

Installing from MELPA

The easiest way to install and keep Iedit up-to-date is using Emacs’s built-in package manager. Iedit is available in the MELPA repository. Refer to http://melpa.org/#/getting-started for how to install a package from MELPA.

Installing from GitHub

You can also clone Iedit’s repository or download a zip package from GitHub https://github.com/victorhge/iedit

You will need to add a few extra lines in your .emacs file, to make your Emacs knows about the package:

(add-to-list 'load-path "~/dir/to/your/iedit")
(require 'iedit)

iedit's People

Contributors

articuluxe avatar duianto avatar edwardbetts avatar imwihfm avatar jasminpatry avatar jorgenschaefer avatar justbur avatar leungbk avatar lionel- avatar mbneedham avatar mgalgs avatar miciah avatar tsdh avatar victorhge avatar vifon avatar yesudeep avatar zhenya-1007 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.