magnars / mark-multiple.el Goto Github PK
View Code? Open in Web Editor NEWAn extension to emacs that sorta lets you mark several regions at once
An extension to emacs that sorta lets you mark several regions at once
Per our discussion on IRC, inline-string-rectangle requires use of delete-selection-mode to replace the existing contents of a rectangle. When delete-selection-mode is not in effect the new rectangle content is appended to the original content.
Hi, great mode, however there's an issue when it is used with Pabbrev, pabbrev shows autocompetion candidates directly into the buffer which mess up the text when used with a multi-mark (tried with C-x r t & C->/<).
You should be able to test pretty easily:
(require 'pabbrev)
(global-pabbrev-mode)
(setq pabbrev-idle-timer-verbose nil)
Then try to use a multi-mark command...
I think pabbrev is bundled with the Emacs 23/24 -- not sure.
A simple fix would be to toggle pabbrev on/off when entering mark mode, maybe they already are some hooks I can use for that... I would have checked/fixed myself but my elisp is "hack 'till it works" level, I'm sure you can find a cleaner solution than what I could come up with.
Is it possible (and practical) to make this an installable package?
Currently mark-multiple selects parts of words, which in many cases is not very useful (e.g. programming).
Here's an idea: one common workflow is to 1. isearch for a work, 2. start query-replace from within isearch. (It is so common to invoke query-replace from isearch that the Emacs maintainer once commented to me that this could be the only way.)
I've extended isearch slightly in order to be able to kill the current match from within isearch and keep isearch'ing:
;; Often during incremental search I want to delete the search match. This
;; binds the C-k key in isearch mode to to just that.
(defun kill-isearch-match ()
"Kill the current isearch match string and continue searching."
(interactive)
(kill-region isearch-other-end (point)))
(define-key isearch-mode-map [(control k)] 'kill-isearch-match)
It would be great if mark-multiple would support being invoked from isearch.
(This is of course just an idea, I suppose I could hook this up myself, but since this is recent development, I thought you might find it interesting. I currently 1. isearch to the work I want to replace, 2. exit isearch, 3. reselect the word for mark-multiple, 4. invoke mark-multiple. It's a bit much.)
Cheers,
I am new to emacs and elisp but enjoying looking for useful emacs plugins like mark-multiple. I have some questions about mark-multiple:
1.Skip some next/previous substrings like:
abc
abc-config
abc
How can I skip the second 'abc' but mark the first and third 'abc' ?
2.Sometimes the text is to long, if marking previous/next can scroll the screen at the same time that will be awesome.
3.Sometimes I press 'C->' too fast and want to cancel marking some, how can I do that ?
I am new to elisp and confused by the document string. So I hope I can find an answer here.
If some of these are not provided in the current version I will be glad to see them in the next release. :)
It would probably be good to either have mark-multiple-pkg.el
file in the package or to add a Version:
string to the head of mark-multiple.el
.
emacs 24 (on windows 7) complains about these 2 lines:
((or (eq base 'up) (eq base ?ĂĽ))
and
((or (eq base 'down) (eq base ?ĂŚ))
in mark-more-like-this.el throwing a message: Invalid read syntax: "?"
mark-multiple mc/mark-next-like-this does not mark the next occurrence correctly.
In a R-mode buffer, if I have
## TH 1
abcd
## TH 2
efg
## TH 3
I select the first TH and then mark-next-like-this to select the second TH. After that I repeat the command and it selects the abcd line.
I have auto-complete enabled for R. When I disable auto-comlpete-mode, it works correctly. A work-around would be to disable auto-complete-mode before running mc/mark-next-like-this for example:
(defadvice mc/mark-next-like-this (around fix-issue)
(let ((ac-on (and (boundp 'auto-complete-mode) auto-complete-mode)))
(when ac-on
(auto-complete-mode -1))
ad-do-it
(when ac-on
(auto-complete-mode 1))))
However this still doesn't work for me.
I think add something to mm/add-mirror would do the trick.
high i love your package, is there a hack to make it work for web-mode instead of html-mode ?
When mark-next-like-this is called I would like the cursor and current buffer to scroll to the end of the last item marked.
I've tried to modify mark-next-like-this as such:
L69 (if (search-forward master-str nil t)
(progn
(set-window-point (get-buffer-window (current-buffer) 'visible) (point))
(mm/add-mirror (- (point) (length master-str)) (point))
)
I've also tried to use (goto-point (point)) instead but neither seem to do anything at all, do you have any idea how I could implement that?
Hi @magnars ! First of all, thanks for utterly useful emacs mode and great videos on Emacs Rocks!
Now, I know that I may just talk rubbish, but I can't find js2-rename-var
in mark-multiple
. What's the catch?
if you have few cursors and each should trigger higlight change the color is changed only to the first one.
Example:
you have (in web-mode) php tags (inside strings) and want to change it to twig/django tags.
<li><a href="<?= $item['href'] ?>"><?= $item['name'] ?></a></li>
<li><a href="<?= $item['href'] ?>"><?= $item['name'] ?></a></li>
<li><a href="<?= $item['href'] ?>"><?= $item['name'] ?></a></li>
in web mode it's white (I think broken) and if you change that to {{
and }}
using multiply cursors
<li><a href="{{ item['href'] }}">{{ item['name'] }}</a></li>
<li><a href="{{ item['href'] }}">{{ item['name'] }}</a></li>
<li><a href="{{ item['href'] }}">{{ item['name'] }}</a></li>
only first instance will get color. They all should have changed.
Maybe it's something with web-mode.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.