• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language
    Emacs Lisp
  • Created about 13 years ago
  • Updated about 12 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An extension to emacs that sorta lets you mark several regions at once



Please note! mark-multiple has been superseded by multiple-cursors

It has all the functionality of mark-multiple, but with a more robust implementation and more features.

To get the features from mark-multiple, use:

  • mc/mark-more-like-this in place of mark-more-like-this
  • set-rectangular-region-anchor as a more convenient replacement for inline-string-rectangle
  • or mc/edit-lines for a more familiar replacement for inline-string-rectangle
  • mc/mark-sgml-tag-pair in place of rename-sgml-tag

Read more about multiple-cursors on its own page.




mark-multiple.el

An emacs extension that sorta lets you mark several regions at once.

More precisely, it allows for one master region, with several mirror regions. The mirrors are updated inline while you type. This allows for some awesome functionality. Or at least, some more visually pleasing insert and replace operations.

Video

You can watch an intro to mark-multiple at Emacs Rocks.

Done

  • A general library for managing master and mirrors
  • mark-more-like-this which selects next/previous substring in the buffer that matches the current region.
  • inline-string-rectangle which works like string-rectangle but lets you write inline - making it less error prone.
  • rename-sgml-tag which updates the matching tag while typing.

Note: js2-rename-var has been moved to js2-refactor.el.

Installation

git submodule add https://github.com/magnars/mark-multiple.el.git site-lisp/mark-multiple

Then add the modules you want to your init-file:

(require 'inline-string-rectangle)
(global-set-key (kbd "C-x r t") 'inline-string-rectangle)

(require 'mark-more-like-this)
(global-set-key (kbd "C-<") 'mark-previous-like-this)
(global-set-key (kbd "C->") 'mark-next-like-this)
(global-set-key (kbd "C-M-m") 'mark-more-like-this) ; like the other two, but takes an argument (negative is previous)
(global-set-key (kbd "C-*") 'mark-all-like-this)

(add-hook 'sgml-mode-hook
          (lambda ()
            (require 'rename-sgml-tag)
            (define-key sgml-mode-map (kbd "C-c C-r") 'rename-sgml-tag)))

Feel free to come up with your own keybindings.

Bugs and gotchas

  • Adding a master and mirrors does not remove the active region. This might feel strange, but turns out to be practical.

  • The current mark-multiple general library lets you do stupid shit, like adding overlapping mirrors. That's only a problem for people who want to write their own functions using mm/create-master and mm/add-mirror.

  • Seems like there is some conflict with undo-tree.el, which sometimes clobbers the undo history. I might be doing something particularly stupid. Looking into it.

  • Reverting a buffer with active marks makes them unremovable.

A wild idea

Is this a subset of a crazy multiple-point module? Would that even work?

Edit: Yes, indeed it is. And yes, it does. This module has been pretty much eclipsed by multiple-cursors.el, which goes quite a bit farther and with a saner implementation to boot.

Contribute

If you make some nice commands with mark-multiple, it would be great if you opened a pull-request. The repo is at:

https://github.com/magnars/mark-multiple.el

Contributors

  • Pao-Chin Wu fixed mark-next-like-this if no region is active.
  • Syohei YOSHIDA improved the error messages for mark-next-like-this
  • Mounier Florian added mark-all-like-this and mark-all-like-this-in-region

Thanks!

License

Copyright (C) 2011 Magnar Sveen

Author: Magnar Sveen [email protected] Keywords: marking library

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

More Repositories

1

multiple-cursors.el

Multiple cursors for emacs.
Emacs Lisp
2,294
star
2

dash.el

A modern list library for Emacs
Emacs Lisp
1,669
star
3

expand-region.el

Emacs extension to increase selected region by semantic units.
Emacs Lisp
1,367
star
4

s.el

The long lost Emacs string manipulation library.
Emacs Lisp
1,030
star
5

prone

Better exception reporting middleware for Ring.
Clojure
512
star
6

optimus

A Ring middleware for frontend performance optimization.
Clojure
364
star
7

stasis

Some Clojure functions for creating static websites.
Clojure
348
star
8

parens-of-the-dead

A series of zombie-themed games written with Clojure and ClojureScript.
Clojure
153
star
9

string-edit.el

Avoid escape nightmares by editing strings in a separate buffer
Emacs Lisp
105
star
10

tagedit

A collection of paredit-like functions for editing in html-mode.
Emacs Lisp
99
star
11

multifiles.el

Work in progress: View and edit parts of multiple files in one buffer
Emacs Lisp
76
star
12

fold-this.el

Fold the active region in Emacs
Emacs Lisp
73
star
13

change-inner.el

Emacs version of vim's ci and co commands
Emacs Lisp
64
star
14

angular-snippets.el

Yasnippets for AngularJS
Emacs Lisp
45
star
15

autolint

Autolint watches your files for jslint-errors
JavaScript
43
star
16

kaocha-runner.el

An emacs package for running Kaocha tests via CIDER.
Emacs Lisp
34
star
17

smart-forward.el

semantic navigation based on expand-region.el
Emacs Lisp
31
star
18

java-time-literals

A Clojure library that defines literals for java.time classes.
Clojure
29
star
19

hardcore-mode.el

Disable arrow keys + optionally backspace and return
Emacs Lisp
28
star
20

confair

Confair is a configuration library for Clojure.
Clojure
26
star
21

parens-of-the-dead-s2

The code for Parens of the Dead season 2
Clojure
23
star
22

emacsd-reboot

Reboot of .emacs.d
Emacs Lisp
23
star
23

yesql-ghosts

Display ghostly yesql defqueries inline, in Emacs
Emacs Lisp
18
star
24

emacsrocks.com

The emacsrocks.com site implemented in Clojure with Stasis and Optimus
Clojure
16
star
25

catenate

A deprecated Ring middleware to serve concatenated static files with cache buster URLs in production.
Clojure
16
star
26

realize

Realizing clojure data structures, no more laziness
Clojure
15
star
27

test-with-files

A Clojure library to easily write tests with files.
Clojure
15
star
28

datomic-type-extensions

A Clojure library that wraps Datomic API functions to add type extensions.
Clojure
14
star
29

datoms-differ

Find the diff between two txes in datoms.
Clojure
14
star
30

datomic-snippets

Yasnippets for Datomic.
Emacs Lisp
14
star
31

mapdown

A lightweight markup format to turn strings into maps in Clojure.
Clojure
13
star
32

zombie-clj

An zombie themed web game made with Clojure and ClojureScript
Clojure
13
star
33

cljs-styles

Vendor prefixes for React inline styles with ClojureScript.
Clojure
13
star
34

html5-walker

Search and replace in HTML5 strings.
Clojure
12
star
35

what-the-emacsd

The code for http://whattheemacsd.com
HTML
11
star
36

www.parens-of-the-dead.com

The code that generates parens-of-the-dead.com
Clojure
11
star
37

kaocha-noyoda

Don't talk like yoda. This kaocha plugin lets you write `(is (= actual expected))`.
Clojure
11
star
38

Zombie-TDD

Bli med når jeg lager et nettspill fra scratch med javascript på både frontend og backend. Det blir zombier, mafia og testdrevet utvikling.
JavaScript
10
star
39

annoying-arrows-mode.el

Emacs gets annoyed when you navigate around your document one char at a time.
Emacs Lisp
10
star
40

helpful-loader

A Clojure library to load resources with helpful error messages.
Clojure
9
star
41

buster-mode

A minor mode for emacs to speed up development when writing tests with Buster.JS
Emacs Lisp
8
star
42

stubadub

A small stubbing library for Clojure and ClojureScript
Clojure
8
star
43

bang.el

Used to be a modern list library for Emacs (renamed to dash)
Emacs Lisp
8
star
44

optimus-angular

Angular.JS optimizations for Optimus
Clojure
8
star
45

buster.tmbundle

TextMate bundle for Buster.js
6
star
46

java-time-dte

Datomic type extensions for java.time classes
Clojure
6
star
47

optimus-img-transform

An Optimus image transformation middleware.
Clojure
6
star
48

simplezen.el

A simple subset of zencoding-mode for Emacs
Emacs Lisp
5
star
49

zombieclj-s02

Koden til ZombieCLJ Sesong 2
CSS
5
star
50

server-facade

Code and slides belonging to my JavaZone-talk about wrapping your ajax-calls to get cleaner code and nicer testing.
JavaScript
4
star
51

blockout

Recreating one of my first games for the web to learn Canvas.
JavaScript
4
star
52

naive-xml-reader

A naive Clojure library that turns XML into maps.
Clojure
4
star
53

norsk-extreme-startup

Oversatt til norsk og tilpassett FINN
Ruby
3
star
54

roll20-scripts

Scripts for roll20
JavaScript
3
star
55

optimus-jsx

A React JSX asset loader for Optimus.
JavaScript
3
star
56

crappy-jsp-mode

Seriously, this is not a good jsp-mode, it just solves some of my problems
Emacs Lisp
3
star
57

optimus-less

A LESS asset loader for Optimus.
Clojure
3
star
58

zombieclj.no

Koden bak www.zombieclj.no
Clojure
2
star
59

zombieclj-s2

Koden for andre sesong av Zombie CLJ.
CSS
2
star
60

mytomatoes.clj

mytomatoes.com rescue operation
Clojure
2
star
61

creator.js

A tiny library for creating create-methods for your objects.
JavaScript
2
star
62

buster-snippets.el

Yasnippets for the Buster test framework.
Emacs Lisp
2
star