4 ms·
I got exactly the same behaviour in emacs by installing the 'multiple-cursors package and adding the following to my .emacs file (require 'multiple-cursors) (g
by vbsteven 12y ago
I got exactly the same behaviour in emacs by installing the 'multiple-cursors package and adding the following to my .emacs file
(require 'multiple-cursors)
(global-unset-key (kbd "M-<down-mouse-1>"))
(global-set-key (kbd "M-<mouse-1>") 'mc/add-cursor-on-click)
- m_mueller 12y agoOk that's interesting. The following features are also crucial to me: * Tree view * Split window with synchronized views when showing the same file * Regex search over file or selection, results can be turned into multicursors (!) * Regex search over multiple files or directories * Multicursors at each line for a selection * Auto-update of views when file underneath changes (editor should ask what to do in case of edits) I'm sure all of this can be achieved with Emacs - my question is: How long will it take me to set up? Will the result be portable, e.g. can I copy some config file unto any POSIX machine and use it from there in an ssh terminal? That last point would be the main draw for me on why to switch to Emacs, since with Sublime I have to mount the drives (with Expandrive) which works well for the essential things, however there are details like the treeview not updating in that case.
- easytiger 12y agoInteresting, I guess it is just an editing preference. Multiple cursors i associate with mouse use (I know it isn't the same but I bet most people use the mouse with them). I consider touching the mouse dangerous for myself and for productivity. > Tree View This i fully understand (and exisits in emacs) but I think not necessary either for my workflow. A treeview does already exist in a format called folders and files ;) I prefer to know the structure of the directories I'm working in and rarely require a reference to them visually > Split window with synchronized views when showing the same file I do too and this is a very basic emacs feature > Regex Emacs has a massive number of regex and non regex search options. Though usually i simply use Ctrl-Z; grep; fg, which is less efficient but fits my mental model better. But ctrl-h a <regex> has ~ 34 commands on my machine. Including things like dired-do-isearch-regexp > Multicursors at each line for a selection No idea what this means sadly! > Auto-update of views when file underneath changes (editor should ask what to do in case of edits) I doubt any editor handles this stuff as well as emacs and is invoked in my environments daily. Apart from multicursor stuff (that i do not see the point of for my workflow) everything you mention is a very very old basic emacs feature.
- m_mueller 12y agoMulticursors are one of these things that you don't understand the use for, until you start using them, at which point you can never go back. In order to understand what they do, just have a look at all six gifs on this page: http://www.sublimetext.com/ http://www.sublimetext.com/. And sorry, but if you don't know about multicursors, I'm not sure whether you get what I mean with "Regex search over file or selection, results can be turned into multicursors". Just have a look at the animations in above URL. Can emacs do that without turning this into a big modding project?
- judk 12y agoSo multicursor is an unhygenic version of semantic rename (refactoring)? Ew.
- FichteFoll 12y agoNo, multicursors are way more powerful because you don't have to rename something in order to use them. The second animation on http://www.sublimetext.com/ http://www.sublimetext.com/ is a use case that has occured several times to me alone, and there are more (e.g. indenting only specific lines, aligning code).
- xorcist 12y agoHere's a datapoint against it. I forced myself to use multicursors for a while but I don't see the point at all. It's a more clumsy way to do replacements.
- unhammer 12y agogif1: It seems the multiple-cursors package does this, though I don't quite see the point when you have regex-replace. gif2: I typically do this kind of stuff with CUA-rectangles: http://trey-jackson.blogspot.no/2008/10/emacs-tip-26-cua-mode-specifically.html http://trey-jackson.blogspot.no/2008/10/emacs-tip-26-cua-mod... Looks about the same. gif3: looks like M-x, though there are newer alternatives to M-x like smex that do more fancy matching: http://www.emacswiki.org/emacs/Smex http://www.emacswiki.org/emacs/Smex I feel like I'm faster with plain M-x, though haven't really given smex much of a chance gif4: There's a million packages that do this in various different ways (using recent files, VC-tracked files, bookmarks, Meta-dot with TAGS or parsers to go from symbols to definitions, etc.). I suppose people have different preferences for how to navigate quickly to other files. gif5: M-x occur is built-in. There's also multi-occur to show over several files, or occur-edit to edit directly from the list of hits without going into the file itself, etc. gif6: regex-replace also has been built-in forever, mc/mark-all-in-region-regexp seems to match this UI more closely though. But I'm sure lots of the newer Emacs packages have been inspired by Sublime or TextMate (or vim!) :-)
- hiker 12y agoAs an active Emacs user, I can confirm the answer of all of the above is "yes". Heck, it even has a Tetris and a Psychiatrist built in. My .emacs is portable and I use it across Linux, OS X and Windows. Of course it's based on my personal preferences (vim emulation anyone?) and I seldom see people sharing the same config except maybe Bozhidar's Emacs prelude https://github.com/bbatsov/prelude https://github.com/bbatsov/prelude
- m_mueller 12y agoWhat about Regex search over file or selection, results can be turned into multicursors (!) ? GP described 'require multicursors', which I presume is an emacs package. Does it come with regex search integration?
- lclarkmichalek 12y agoIt probably doesn't, but I would be very highly surprised if you couldn't compose the actions together with a couple lines of lisp
- unhammer 12y agoperhaps M-x mc/mark-all-in-region-regexp though I just installed multiple-cursors now, have never tried Sublime so no idea what the deal is with these multiple cursors