10 ms·
Emacs Rocks
- covi 12y ago"Mind Exploded" basically does what vi/vim natively does in an inferior way... (2x key strokes!)
- hk__2 12y agoVim is a modal editor, which means one keystroke doesn’t have the same meaning in one mode and in another. Emacs, on the other hand, doesn’t have all these modes, which is why you have to use modifier keys like ctrl/shift/alt to tell it what to do. That’s two paradigms, I’m not sure one is better than the other (note: I’m a Vim user).
- aerique 12y agoI switched from Vim to Emacs 15+ years ago because I did not like modal editing. Now I am using evil-mode in Emacs :-| I'm not sure which one is better either.
- pyre 12y agoI'm currently in the middle of attempting to gain proficiency in Emacs. I have to admit that it's difficult being someone that's spent 10+ years using Vim. I'm used to being able to just hit HJKL as a nervous habit, which doesn't go over so well in Emacs. I feel like there are many things in Vim that seem superior at first glance. For example, if I want to do a regexp search/replace in Vim, I can do this from Normal Mode (which will replace throughout the whole file): :%s/regxp/replacement/g<enter> Emacs (by default) has `replace-regexp`: M-x replace-regexp<enter>regexp<enter>replacement<enter> My only problem? This only replaces from the cursor to the end of the file/buffer, so to replace over the whole file I would need to do: M-< M-x replace-regexp<enter>regexp<enter>replacement<enter> It just seems that much more complicated, and now I've lost my place, so I'm at the top of the buffer rather than wherever I was in the file. On the other hand, I find Emacs Lisp to be much easier to deal with then VimScript/VimL even as someone that has written my own Vim plugins, and created plugins to patch issues with files in the standard Vim dist (too lazy to submit a patch and wait for the next Vim release).
- baddox 12y agoThis obviously isn't a solution to your valid complaint, but you can use C-u C-SPC to navigate to your previous cursor position. It can band-aid your issue, but it's also quite useful in general. https://www.gnu.org/software/emacs/manual/html_node/emacs/Mark-Ring.html https://www.gnu.org/software/emacs/manual/html_node/emacs/Ma...
- inclemnet 12y agoAre you aware of evil-mode? One of the many things it implements is the :%s/stuff/otherstuff/g syntax.
- pyre 12y agoI'm aware of evil-mode. I'm attempting to try 'the Emacs way' first. I'm not attempting to just throw myself in. When I need to be proficient I'll fallback to Vim, but I want to gain access to things like org-mode, for instance.
- klibertp 12y ago"The Emacs way" is very much "learn some elisp and write whatever you want". I switched from Vim to Emacs and in the beginning there were some things I really missed. One that I remember was "*", which in Vim/my config highlights current word in whole buffer and let's you n/N between matches. In Emacs, doing the same with M-left C-s C-w felt just wrong. Fixing this was a matter of 2-3 lines of very straightforward elisp. I since started relying more on Occur mode and IEdit mode for this, but the experience of lacking a feature and adding it absolutely painlessly remained with me. Writing simple elisp and simple editing-related features is a joy under Emacs. It's much easier than in Vim, for a number of different reasons. This makes me think that "the Emacs way" is about scripting and programming it to do whatever you need it to do.
- Wilfred 12y agoYou may also be interested in https://github.com/nschum/highlight-symbol.el https://github.com/nschum/highlight-symbol.el which provides highlighting of the current symbol, and provides highlight-symbol-{next,prev} commands to move between occurrences of a symbol.
- pmoriarty 12y agoEmacs does have modes (even if we set aside vi/vim emulation modes like evil, which is discussed elsewhere in this thread). When you use certain major or minor modes in emacs, you get to use a whole new set of keystrokes, by which you're effectively doing modal editing. One well-known example is magit.[1] When you activate magit, you can type all sorts of new one- or two-key commands. This is comparable to modes in vim. [1] - http://www.emacswiki.org/emacs/Magit http://www.emacswiki.org/emacs/Magit
- hk__2 12y agoThanks. As a Vim-only user I don’t know all these Emacs things (but am willing to learn).
- sjm 12y agoExactly right! All input in Emacs is just a key-bind. In a buffer focused on text-editing, letter keys (e.g. "a") are actually bound to a function called self-insert-command which inserts the last character typed. Modes like magit just re-bind keys to different functions (e.g. "s" gets bound to magit-stage-item).
- rdtsc 12y agoNo because keystrokes happen at the same time. They are cords. Is typing 'A' 2x the keystrokes that typing 'a'. Sure but it doesn't matter, it happens at the same time -- 'Shift+a'. So it is actaully Vim that takes 2x the time to do anything because you have multiple modes to track and switch from. If you look at how stenographers type, they don't use modes, they use cords. They also minimize moving the hands away from the homerow (or equivalent of), and by "minimize" I think that movement might be 0 actually.
- mostly_harmless 12y agoBut programming is not equivalent to stenography. Stenography works on a stream of input speech converting it into text, whereas programming is separated into the 2 modes of browsing&thinking and actually editing. But I think it comes down to preference of whether you want the universality of commands, or conceptual separation of modes.
- clarry 12y agoCounterpoint: many of the world's fastest typists avoid using modifier keys (and prefer caps lock over shift for typing uppercase letters), because using them requires careful timing: press the modifier after any other keys, press the key you need modified, lift the modifier. If you press the modifier too early or raise it too late, you screw up. In normal typing with no modifiers, it doesn't really matter when you lift the finger. You can afford to go much faster.
- na85 12y agoEmacs is pretty decent, yep. It remains my editor of choice. From what I've read over the years it's a paradigm of poor design under the hood however.
- deleted 12y ago[deleted]
- S4M 12y agoIt's pretty neat for a paradigm of poor design to last so long...
- aarohmankad 12y agoThere's also http://emacs.sexy/ http://emacs.sexy/
- 3ifbyw 12y agoThis feels strangely relevant: https://rms.sexy/ https://rms.sexy/
- kristopolous 12y agohttps://rms.sexy/img/p1010270.jpg https://rms.sexy/img/p1010270.jpg is a great one.
- joliv 12y agoOoh, and http://vim.sexy http://vim.sexy!
- lucb1e 12y agoIt died. This still works for me: http://webcache.googleusercontent.com/search?q=cache:http://vim.sexy http://webcache.googleusercontent.com/search?q=cache:http://...
- smacktoward 12y agoThe "How to Learn Emacs" infographic that's linked a little ways down on that page includes a bit of attitude that drives me nuts: NOTE: The Emacs tutorial has lots of weird terms: "Meta key", "frame", "buffer". This is because Emacs started a LONG time ago. Don't worry, you'll get the hang of it with practice. I have no idea why we make people jump through the hoops of learning archaic terminology, rather than evolving the software to use the terms people actually use today. The Meta key is called the "Meta key" because that's the label that was on the keyboards of the Lisp machines in the MIT AI lab when Emacs was first developed. It's been thirty-plus years since that key was found on anything close to a significant fraction of keyboards in use in the world. There's no evidence that it's ever going to make a roaring comeback, either. In other words, the Meta key, as a key, is dead and gone. It is literally as dead as disco! And yet the name persists, even though the way people have interacted with the "Meta key" for decades has been to press a key labeled something other than "Meta." So: why hang on to a dead word? It serves no practical purpose, and does active harm by confusing people new to the editor. But no, rather than update our terminology so it bears some resemblance to the world we actually live in, we hang on to it and tell newcomers that to learn Emacs they're just going to have to get used to pretending they're working on a space-cadet keyboard, because that's The Way It Has Always Been Done. Sigh.
- GoofballJones 12y agoIt's a great OS. I mean, Emacs is an OS, right? They've certainly crammed enough things into it to make it an OS.
- hollerith 12y agoI didn't downvote you, but I wish people would stop saying that. There's no scheduler inside Emacs. In contrast, there is something very much like a scheduler inside Firefox and inside Google Chrome so that more than one browser tab can make computational progress "simultaneously". What Emacs does have (at least when it is running on a Unix-like OS rather than on Windows) is a way to use the underlying OS to create and manage child processes. I.e., a way to add processes to the OS's scheduler. But a terminal-emulation app that lets the user create and manage multiple terminal-emulation windows or tabs has the same capability, and no one calls it an OS with an OS. Moreover, the programs `screen` and `tmux` also have that capability, and no one call them OSes within OSes. People who like Emacs sometimes treat it like a generalized interface to information. But the combination of a Unix shell and a terminal-emulation app ("the Unix commandline") is often treated the same way, and no one calls it an OS within an OS. Ditto a simple web browser like Lynx. EDIT: replaced "OS" with "OS within an OS" to try to make my argument less vulnerable to jacquesm's reply.
- jacquesm 12y agoThere was no scheduler in DOS either but it definitely was an OS.
- deleted 12y ago[deleted]
- cbd1984 12y ago> There was no scheduler in DOS either but it definitely was an OS. Meh. If you have to call it an OS, it isn't one.
- GoofballJones 12y ago> I wish people would stop saying that. Really? I thought I had an original thought there for a second. So, someone, somewhere, agrees with me out there.
- cosarara97 12y agoMaybe if there was a way to use it without modifier keys. Even using shift for caps is painful for me.
- 3rd3 12y agohttp://www.emacswiki.org/emacs/StickyModifiers http://www.emacswiki.org/emacs/StickyModifiers
- jqgatsby 12y agoOn a kinesis keyboard all the emacs modifier keys are by your thumbs. It makes emacs so much more awesome
- bostonvaulter2 12y agoThere's also optional foot petals.
- fractalsea 12y agoIs this actually serious? I would actually really love that. Would save so much strain on my fingers and it would probably even give my legs a bit of a workout.
- clarry 12y agoIt's serious. Unfortunately I find it very difficult to use. The foot just isn't as flexible as the fingers. It's slow and cumbersome. Also, using it limits how much I can move around in/with my chair. I tried to get used to it, but my foot pedal is just collecting dust under the desk now.
- clarry 12y agoIt's a shame the modifiers (shift included) like to get stuck on the Kinesis. Expensive pile of crap... If I had the money, I'd try out the Maltron 3D keyboard. I haven't heard about such problems with it. It also comes with a numpad in the middle, which I kinda miss in the Kinesis. It would be great for nethack, and something else.
- noobermin 12y agoI've been using emacs for years and I didn't know a few of these tricks! I've been meaning to dig deeper, and things like this site are a great way to whet my appetite.
- alttab 12y agoI'll leave this comment here for those of us who still prefer vi. :)
- rayshan 12y agoNice! Is there something similar for vim? For newbies looking to get into one, it'll be nice to see a comparison.
- Walkman 12y agoThere is very high quality series: http://vimcasts.org/ http://vimcasts.org/
- valvar 12y agoThere's also http://vim-adventures.com/ http://vim-adventures.com/. Costs a bit, unfortunately, but it's an amazing way to learn vim.
- dllthomas 12y agoCosts too much, I think, in that I think they're probably losing too much business. I know that I clicked the button happy to pay $10, they probably could have squeezed $20 out of me, I balked at the "$50/yr". I think it might very well be worth paying that to someone just learning vim. I'm skeptical enough of that population understand that, though.
- deleted 12y ago[deleted]
- entreprenewb 12y agoI ran across this site the other day when I was looking at overhauling my .emacs file since I'm only an occasional emacs user these days. This guy has a great starter repo of his customized .emacs.d directory that takes care of a lot of the setup work to use all the customizations and modes he's using: https://github.com/magnars/.emacs.d https://github.com/magnars/.emacs.d One note, if you do clone the repo, make sure to use the --recursive option (as the readme instructs) since there are a bunch of other git repositories imported in the repo.
- michaelsbradley 12y agoBozhidar Batsov's Emacs Prelude is also worthy of study: https://github.com/bbatsov/prelude https://github.com/bbatsov/prelude That is, even if you didn't want to use it outright for your config, prelude's init.el and modules are a good resource for learning how to wire things together with Emacs Lisp.
- josteink 12y ago> One note, if you do clone the repo, make sure to use the --recursive option (as the readme instructs) since there are a bunch of other git repositories imported in the repo. Doing this, you can tell that this guy really doesn't care for the Emacs package-repositories :)
- martin1975 12y agoI've never used emacs- currently using XCode to do C++ development. While I find the demonstrations interesting, what would emacs buy me as a C++ developer?
- michaelsbradley 12y agoEmacs is not only an editor, but a "computing environment" that can be readily customized and extended using the Emacs Lisp (elisp) language. In fact, much of Emacs itself is built with elisp. Some developers find that kind of flexibility in their tooling to be highly compelling, others not so much. I'm not a C++ programmer, but I turned up the following guide with a Google search, which might you might find interesting: C/C++ Development Environment for Emacs http://tuhdo.github.io/c-ide.html http://tuhdo.github.io/c-ide.html
- derengel 12y agohttp://tuhdo.github.io/c-ide.html http://tuhdo.github.io/c-ide.html
- myg204 12y agoOn the good side, once you are used to the keys, the text editing part is pretty efficient. Also, you have access to a lot of the other modes once you want to step out of the C++ tasks, to look at other files (makefiles, log files), keeping notes with org-mode, opening ftp windows, pretty-printing,.... Plus there's less behind the scene magic than in IDEs and you have access to everything to see where something breaks. It's not a black box the same way an IDE is. On the bad side, you'll have to spend time tweaking packages and so on to get IDE-similar goodies like autocomplete. I can't remember if there's a similar thing as a background compilation that highlight errors as you type. But the thing with emacs is that if you wonder about a plugin, there'a good chance it exists already.
- ddinh 12y agoI can't remember if there's a similar thing as a background compilation that highlight errors as you type. Check out Flycheck: http://flycheck.readthedocs.org/en/latest/ http://flycheck.readthedocs.org/en/latest/
- spiffy-spaceman 12y agoI just found my new emacs logo ;-)
- rayalez 12y agoThank you very much for a great link! I am using emacs for almost everything I do, and I've naturally learned a lot about it, and I was planning for a long time to start seriously learning some in-depth things. I've just recently learned the basics of lisp, this will be the perfect time to find out more about emacs. It is fantastic, and every time I discover some new feature it blows my mind how great and useful it is.
- dschiptsov 12y agomy 2¢ - http://karma-engineering.com/lab/wiki/Emacs http://karma-engineering.com/lab/wiki/Emacs
- mapcar 12y agoCan't you just create an alias for `emacs -nw -Q` or `emacsclient -nw` when you want to open an instance in a terminal?
- dschiptsov 12y agoI could, of course, but I like it less bloated - 70 shared libraries less.)
- craigching 12y agoAnother good emacs site is http://www.masteringemacs.org http://www.masteringemacs.org
- weavie 12y agoThe annoying thing about customising Emacs is that when following along with tutorials, I keep tripping up against shortcuts that I have reconfigured to work in a different way. Luckily emacs lets you type out the command in full to bypass the short cut key. I can then determine if it is useful enough to remap the command to a different key.
- agumonkey 12y agoother screencasts here http://www.emacswiki.org/emacs/EmacsScreencasts http://www.emacswiki.org/emacs/EmacsScreencasts ;)
- azinman2 12y agoNice concept. Id like to see this for vim, the one "true" text editor.
- cbd1984 12y agoYou'll never need it for ed, the standard text editor, because it is the standard. It is eternal. It is infinite. It is the standard, and any change would make it not standard. Puny mortals fail to see the immanent perfection of ed. There is no configuration because a Platonic Form has no time, no space, no change. It Is, It Was, It Will Be. ?
- thomasfl 12y agoI've been using Magnar's and Christian's excellent collection of emacs settings and packages for some years now, and haven't bothered to adjust the settings in emacs myself evet since. It's like turning your trusty old emacs into a monster hacker tool. Watching the screencasts is much more entertaining than reading boring documentation.