13 ms·
I've been a hardcore vi user pretty much my entire life, but I decided to force myself to spend a year using emacs a while back just to see what all the fuss wa
by commandlinefan 4y ago
I've been a hardcore vi user pretty much my entire life, but I decided to force myself to spend a year using emacs a while back just to see what all the fuss was about. When the year was over and I "allowed" myself to return to vi, it was like a huge weight lifted off my shoulders... to this day I still don't see what the hype was about. On the plus side, though, I memorized the emacs cursor movement commands, which are (for some reason) the default cursor movement commands in most command line environments like the Postgres CLI.
- celeritascelery 4y agoI am surprised you didn’t use evil-mode to emulate the vim keybindings. Or was this a an attempt to use “pure” Emacs without packages and customization?
- pmoriarty 4y agoIt sounds like they're not even aware that it was an option. Many people don't realize that emacs' default keybindings can be changed to be modal in exactly the same as vim, by using evil.
- kentosi 4y agoSorry for the naive question, but if you're changing all your bindings to vim, then why use emacs at all? Is there any extra functional difference?
- skydhash 4y agoEmacs is more like an ecosystem around text, so switching keybinding does not matter much. And most people's system is installed on a single computer, very much like Photoshop or Visual Studio. Vim is all about editing text and the keybinding are like a DSL for this purpose, so changing things will make you awkward everywhere.
- pmoriarty 4y agoThere's a ton more to both editors than just keybindings. See this post[1] where I talk about some of the things I've done with emacs -- none of which have anything to do with bindings. You can do millions of other things too, as I'm not using emacs nearly to its full capacity. Same with vim. Bindings in editors are like symbols in math. Yes, they're necessary, and you can do a lot with them, but symbols are not nearly all there is to math. [1] - https://news.ycombinator.com/item?id=35560107 https://news.ycombinator.com/item?id=35560107
- avgcorrection 4y agoThe clue lies in the fact that you can customize the editing experience to function like Vim. Because that’s one out of a thousand different ways you can customize that app to function like a one-off editor, a Git client, an email reader, and so on.
- vvillena 4y agoVi is like an standard for moving around and editing text files. I use Vi-style commands in all my editors: Emacs, IntelliJ, and VSCode. For me, any application that supports Vi keybindings and has some sort of command palette will feel like home. Regarding why edit files in Emacs instead of vim: I simply work on Emacs. I don't use a CLI or a file manager to navigate to my files, I already have projects set up in Emacs and can quickly open files in any such projects. Emacs also holds my note taking system. And when I'm dealing with git, nothing comes close to magit. Also, I've been using the Spacemacs framework for years, which makes it really easy to create such a customized and efficient configuration without much hassle.
- School-Cotton 4y agoThe reason people like emacs has nothing to do with the default key bindings, which are basically arbitrary. Emacs is a framework and programming environment for building custom IDEs.
- elenaferrantes 4y agoYou get the vi bindings and modal behaviour which I find better _plus_ all emacs functions and most of the emacs bindings. I’m often mixing the 2 modes while editing.
- commandlinefan 4y ago> they're not even aware that it was an option Actually in this case I was - but my goal was to use "vanilla" emacs just like I use "vanilla" vi(m). After all, if I'm using vi key bindings... why not just use vi?
- pmoriarty 4y agoBoth vanilla emacs and vanilla vim are only a tiny fraction as powerful as either editor enhanced with plugins. You really missed out with this choice.
- coutego 4y agoThe pure text editing is just a tiny detail. I exclusively use vim keybindings inside Emacs, as many others do. Emacs makes extending the editor a breeze. As a new user this just means that you have packages (like VS 'extensions' or IntelliJ 'plugins') for, well, everything. For a more advanced user it means you can automate away many things that are a pain in the ass to repeatedly do in your daily work. I'd suggest you try Doom Emacs when you have a couple of free hours to get a taste of what a properly configured Emacs can do. And, once you are on it, just press "SPC f p", select 'init.el' and check what popular packages you can activate just by uncommenting a line and doing a 'doom sync'. Then press "SPC f p" and select 'config.el' to check how even "configuration" in Emacs is just elisp code. You are just running a piece of code you can edit and even debug from itself _while_ you are running it (although that'd require a bit more explanation of how it's done) . This should give you a taste of what Emacs is about.
- mtnygard 4y agoThey're the default keys because a lot of programs use the GNU readline package for line editing.
- tomjakubowski 4y agoIt's also possible to configure GNU readline on your system to use vi keys. See https://vim.fandom.com/wiki/Use_vi_shortcuts_in_terminal https://vim.fandom.com/wiki/Use_vi_shortcuts_in_terminal Put this in ~/.inputrc set editing-mode vi set keymap vi-command
- neilparikh 4y agoYou'll also want `set show-mode-in-prompt on`. Note that this feature is broken when you have a PS1 with a \n in it, in an older version of readline/bash (I am not sure which), so if you're having this problem, just upgrade your bash version.
- softirq 4y agoI did the same experiment and came to the same conclusion. There’s really nothing killer in Emacs that makes it a huge sell over just using vim which is a much better editor unless you just love Emacs lisp. Emacs also has some glaring issues - tramp being a major one. It’s slow and very unreliable. Vim is much more in line with the Unix philosophy. It’s a great editor that can be extended with fzf, ripgrep, lsps, git etc. Emacs has three versions of every plugin and they’re all usually not as good as the thin vim wrapper around fzf etc. If you’re not editing and need email, mutt is a great email client. Irssi is a great chat client. Emacs is very much an all or nothing computing environment. I am glad I tried Emacs though, because I did love which-key and ended up adding it to my Vim config. And Emacs is slightly easier to quit? ADVICE: Try both Emacs and Vim vanilla before you do anything else. Downloading a "distro" is really doing yourself a disservice by not showing you just how much either can do without the chrome. And for the love of RMS DON'T USE VSCODE.
- kqr 4y agoHuh, my experience is the other way around. The "killer" of vim is the control scheme, and evil mode ports that over very faithfully to emacs. Then you get the best of both worlds. Why would you use vim other than in very barebones environments where you cannot access your own config? (I also don't see how tramp is an issue -- it opens up workflows I wouldn't even have access to without it!)
- softirq 4y agoWhy would I want to run an emacs layer adding more latency to my work to turn Emacs in to Vim when, as I said, I can do everything in Emacs I can do in Vim. > (I also don't see how tramp is an issue -- it opens up workflows I wouldn't even have access to without it!) Because it will randomly freeze and it's single threaded, it's slow, and it's also not novel. Vim can also edit files over SSH, VSCode can run itself remotely.
- School-Cotton 4y ago> I can do everything in Emacs I can do in Vim Can you immediately jump to the source code associated with any key binding, read it, debug it, modify and reload it, etc., regardless of whether it comes from the base distribution or a plug-in? For me that’s the killer feature of emacs.
- alyandon 4y agoI had a very similar experience and at the end of the day I switched back to vi(m) (and specialized IDEs) mostly because I didn't have the time to constantly evolve my emacs environment to solve the tasks at hand efficiently. I can see the appeal of emacs though if you really have the time and energy to deep dive and make it your own environment. To this day, I still swap ctrl/capslock - that is so useful that it should just be a standard.
- taeric 4y agoThe default cursor movement commands probably predate emacs. Such that you are used to readline defaults. https://news.ycombinator.com/item?id=24083753 https://news.ycombinator.com/item?id=24083753 is the first post I'm finding on that. That said, I'm curious what the weight of emacs was on you? If it was that you were wanting to be in the other editor, than it makes sense that you should stay in the other editor. But this is no different than a lot of things. Is why some folks don't like changing the vehicle type that they use daily. Very little rational argument one way or the other. Such that, yes, you should use what makes you happy. Not only does it make you happy, but you are probably more effective because of that.
- commandlinefan 4y ago> what the weight of emacs was on you What I've noticed about emacs lovers is that they all customize it heavily - I didn't want to do that, since to me the point of using a plain text editor is that it's always available in exactly the same form wherever I happen to be. I did start to looking into all the ways to customize it, but at that point, I couldn't really see much benefit over just using an IDE. But that's just me.
- taeric 4y agoOddly, I haven't customized mine heavily. I'd assert that there really isn't a single "crowd" that are computer users. All the more true for stuff as customizable as emacs. Even more amusing, I'm fairly certain I had more customization in vim before I decided I wanted to learn lisp. What ultimately killed my customization in all things, was I felt like I was customizing on top of a very shaky foundation. Emacs/vim are stable enough, of course. But building/packaging software is basically a giant playground.
- bloopernova 4y agoYeah I adore picking at my config to solve some small issue. Or implement a cool feature or customization. I don't really use Emacs for the editor! It's more because it's a very configurable language runtime/vm with an editor interface. And org-mode is great too.
- circuit 4y agoI had a similar experience, but came to the opposite conclusion. I walked away replacing vim with emacs as my daily driver. Elisp is far more extensible than vimscript and evil-mode is pretty much at 1-1 feature parity with the real vim. I don't care much for the emacs movement keybindings except for the readline movement commands. > to this day I still don't see what the hype was about. Most of vim is written in C with some interfaces exposed for scripting. Emacs is mostly written in elisp with some C code where necessary. The latter lends itself better to 'hackability' imo For my own machines, I build emacs and import my saved init.el On other machines, there is usually a standard vi/vim install that I can use if I am ssh'd in somewhere where I don't have my personalized copy of emacs. If I remember, I'll try to put these five lines[1] in the .vimrc for some saner defaults [1] https://news.ycombinator.com/item?id=25410390 https://news.ycombinator.com/item?id=25410390
- outworlder 4y agoWhy don't you SSH _from_ Emacs? If you are editing a remote file there's usually no need to SSH and then invoke an editor. https://willschenk.com/howto/2020/tramp_tricks/ https://willschenk.com/howto/2020/tramp_tricks/
- circuit 4y agoI used to, and I probably would if I had to work with remote files more often. But in my experience I found it faster to just build emacs on the remote server and run it as a daemon there, since all the machines I was working on remotely had /home on an NFS mount. TRAMP took just a little too long to load remote directories for my liking. But in case I am plopped in front of an unknown terminal/have to do something on someone else's machine ... at least I can rely on using the default vim to do basic editing.
- Y_Y 4y agoDoes that mean you have a nice setup for running emacs as a server on a remote machine and connecting via a local client? I've tried this a couple of times but it seems to be prohibitively awkward and I'm stuck with the idiosyncrasies of Tramp or even just saying in a vterm. I'd be very grateful if you (or anyone else) can explain how to do this.
- juped 4y agoEmacs is an operating system, not an editor; I'm really not sure why Stallman constantly promoted the "emacs vs. vi" meme. You might as well try to switch from Notepad to Linux. It's just a type error, and you'll have a bad time.
- commandlinefan 4y ago> Emacs is an operating system Reminds me of an old joke: "Emacs would be a great OS, if only it came with a decent text editor..."
- 0zemp1c 4y ago> Emacs is an operating system, not an editor what does it take for this tired and false meme to die?
- Y_Y 4y agoOk, it doesnt have a kernel full of hardware drivers or an implementation that runs on bare metal. That said, it covers a lot of userland and things otherwise covered by a Desktop Environment (which are often conflated with OSes). In terms of application hosting, window management, low-level system control, etc. and the fact that some brave souls have had success with running emacs as PID 1 means that it's not a million miles away from being an OS. (And that's without the inevitable implementation of some basic OS functions in elisp by various wizards)
- pcthrowaway 4y ago> or an implementation that runs on bare metal There's https://github.com/whily/yalo https://github.com/whily/yalo apparently
- abudabi123 4y ago(global-set-key (kbd "M-<tab>") #'completion-at-point-using-chatgpt)
- suetoniusp91 4y ago
- pxc 4y ago> the emacs cursor movement commands, which are (for some reason) the default cursor movement commands in most command line environments like the Postgres CLI. I think this is because they're used in GNU readline. They're also defaults in all the macOS GUIs, though, so maybe not.
- commandlinefan 4y ago> GNU readline Interesting... I always assumed that emacs was around for a while before anybody generalized a "readline" library, but I guess it makes sense that readline would have come first.
- slavapestov 4y agoemacs definitely came first, and readline adopted emacs bindings (it also supports vi)
- jb1991 4y ago> the default cursor movement commands in most command line environments like the Postgres CLI. and also macOS!
- LastNevadan 4y agoWhen I was at the university and started programming on UNIX, the professor said we should try both emacs and vi and see which we like better, and provided links to some tutorials. I tried them both and liked vi. Emacs seemed slower. In my undergraduate wisdom, I deemed emacs to be "stupid" and went on with my life using vi. After I had been programming professionally for about ten years, I decided that my harsh judgement as an undergraduate was often incorrect. (I had also deemed Voltaire, Spanish, sociology, microeconomics and many other things as "stupid", and came to understand as an adult that they weren't.) So, I decided to give emacs another chance. My conclusion was this: vi is better for touch typists. Your fingers are almost always on the home row. Emacs wants you to hit the meta/alt key a lot, which is difficult for a touch typist. It's much harder than hitting shift. Vi makes you hit escape, but that only happens when you switch modes and it's not that hard to hit. I noticed that lots of skilled and professional engineers never learned to touch type. That discovery itself was odd to me: why would a professional programmer not want to invest the time to learn to type properly: typing fast boosts your productivity significantly. But they do. And my conclusion was that emacs was for them, because hitting the control/alt key isn't as much of a penalty when you're a hunt-and-peck typist.
- shagie 4y ago> My conclusion was this: vi is better for touch typists. Your fingers are almost on the home row. Emacs wants you to hit the meta/alt key a lot, which is difficult for a touch typist. It's much harder than hitting shift. Vi makes you hit escape, but that only happens when you switch modes and it's not that hard to hit. I had been playing rogue and nethack for a bit when I started programming. The keys hjkl for doing movement was a natural transition to a vt-100 terminal for writing code in vi. I had also been coding in LPMuds for a bit and the ed command set was firmly engrained in my mind. With vi being both "move using rogue keys" and "do the fancy stuff with the ed commands" there wasn't even a second thought spent on considering emacs.
- smokel 4y agoMany people who use Emacs a lot make CapsLock an additional Ctrl. Using your left-hand little finger makes it trivial to use C-p, C-n, C-f, C-b as cursor keys.
- pmoriarty 4y agoWhat all the hype is about depends on how you use emacs, what you add to it and how you configure it. I used vi and vim for 25 years before switching to emacs, and I spent a ton of time making it very vim like. Now my emacs can do way more than vim ever did. Things like: - browse the web through emacs - read my email through emacs - use org-mode to take notes in outline format, with hyperlinks, tables, executable source blocks, etc - use magit, which is a great interface to git All of these things and more are tightly integrated, so moving text/data between them and editing that data is seamless. It's all programmed and configured in elisp, and is part of a gigantic elisp ecosystem. Though I much prefer Scheme to elisp, I like elisp far more than vimscript, python, lua, or pretty much any other non-lisp language. Emacs has some shortcomings (like handling long lines and large files, and certain types of regex handling that vim can do better), and while I do occasionally still fire up vim, I've felt no yearning to go back to it permanently. For me emacs does everything vim did and far, far more.
- w0m 4y agomagit and org-mode are the two items that made me try emacs a few times now. Never been able to make it stick though.
- _a_a_a_ 4y ago> and certain types of regex handling that vim can do better Hi, emacs user here, can you elaborate please.
- pmoriarty 4y agoSee the \zs and \ze patterns in vim. I've asked for them to be implemented in evil, but have been told it's not possible because evil just uses emacs' regex engine, which can't do this.
- _a_a_a_ 4y agoI think these are lookahead's in some parlance, Emacs doesn't support them. On the rare occasions I need something like that I just use capture brackets. Suppose I want to delete a contiguous string of 'a' but only if it's followed by the letter 'b', then a+\(b\) → \1 aaaab aa gets you b aa <-- unchanged cos no trailing b So it works with a simple case. I guess it could get messy if you're doing anything really complex but TBH the above is about as far as I have ever needed to go. Good luck vimming!
- ragnese 4y ago> to this day I still don't see what the hype was about. As an Emacs user[1], I agree. The flexibility is really cool, and there are a handful of Emacs applications (notice I didn't call them "packages") that are "killer apps", like Magit, Org-Mode, Calc, etc. But, even though I do use and like Emacs, I can't honestly recommend it to anyone and I wouldn't even consider it to be a very good programming environment unless you're specifically working in a Lisp/Scheme (where it's awesome). These days, I mostly use Emacs for programming in Rust and for using Magit as a git porcelain even when not using Emacs for the actual code editing. Here are the things that suck[2] about Emacs (mostly from the point of view of a programming text editor): * The UI is slow. Don't tell me that it's "only" when we have long lines, or too much syntax highlighting or whatever. Sure, if I turn off all of the useful programming features, the UI updates fast enough for me to not notice any latency, but any time I open a file that uses a LSP server or equivalent (not just Rust- I've done Clojure, JavaScript, PHP, and C++ in Emacs), the latency for even just moving the cursor around is noticeable and it's distracting. * Tramp sucks. I don't understand how everyone says that Tramp is awesome and magical. Every single time I've tried to use it to do anything, it's been a bad experience. It's been a few years since I've even tried it, but I remember having to wrestle with ssh-agent authentication, some packages not playing nicely with it (besides the "obvious" ones like LSP-mode), and the whole application hanging if the Tramp session hung for some reason. * It's actually really HARD to customize properly. The experts say that Emacs is "self-documenting" and "introspectable", but many times, I'll try to customize some behavior or a keymap or something, and I'll read the documentation for a variable or function and it'll say something like "takes a plist of FOO definitions,"--well, what the heck does a "FOO" definition look like? What are the keys for the plist? What are acceptable values for those keys? It's very common to just have to dig through the actual elisp code to find out. Then, you'll find out that your customization doesn't even work correctly because some other mode or function stomps on your code, or gets initialized in a different logic path that isn't affected by your change. Since every feature and every package is different, you have little chance of just figuring out a few conventions or any standard structure for packages. * Handling buffers is tedious. Sometimes buffers appear and take over the whole frame, sometimes they split the frame and steal focus, and sometimes they split the frame and don't steal focus. And it's very ad-hoc and tedious to try to separate out "background, system buffers" from "my actual work buffers". There are tons of Emacs packages that attempt to make it easier to manage buffers, switch between them more easily, group them in lists, etc. Like I said, I like Emacs. But, I also run Linux on my personal machines and run a de-Googled AOSP ROM on my rooted Android phone. UX, polish, and convenience are obviously not a high priority for me. [1]: I've used Emacs to varying degrees and with varying levels of dedication and hardcore-ness since 2008-ish. At a few points, I would've said that I was pretty competent/proficient in Elisp, and have authored some fairly elaborate functions to help me with common tasks within Emacs. I even use to try to do a version of "literate programming" with org-mode and org-mode babel blocks in place of something like Jupyter notebooks for Python. [2]: Yes, this is a very negative comment, but I tend to complain loudest about the things that I love and care about. I don't complain or criticize things that I don't like or don't want to use.
- cassepipe 4y agoI am personnally fan of command line vi modes. readline has one (bash, gdb, and others), zsh and fish have (a better) one too. I have remapped Caps Lock to Esc and it's never been easier to just go up and down the history with j an k and to make quick edits.
- papaver 4y agowould definitely agree. i find tmux + vim does almost everything i need. granted i don't try to script anything myself. generally there are command line tools or vim plugins that do most i want. adding to much gravy to vim also just slows vim down which can be incredibly frustrating when one is used to typing very fast. i would say just a couple of years of vim isn't enough to really become one with the software. think it took me around 5 years to really understand why vim is amazing. took me at least one year just to get the hang of it properly and be highly productive. i can't even type in a normal editor anymore as my brain is wired to vim commands. and i still to this day learn new commands which make my life easier. that being said i totally understand why people love emacs. but i get a decent amount of the window management stuff just using the tmux. and vi is installed almost everywhere as an editor which makes editing in 90% of environments a breeze. even when in windows gvim does pretty good.
- avgcorrection 4y ago> I've been a hardcore vi user pretty much my entire life, but I decided to force myself to spend a year using emacs a while back just to see what all the fuss was about. This is like saying that you have been a mountain biker all your life, but then decided to play the trumpet for one year. Nonsensical conjunction.
- jvanderbot 4y agoNonsense. Emacs and vi have similar use cases, right? And similar inputs (keyboard) and similar environments, for similar users. They might be a difference of degree along a few axes, but they aren't a difference of kind like trumpets and mountain bikes are.
- smabie 4y agoAs someone who used Emacs 10yrs before ditching it.. I just really don't think it's very good at doing much. I mean sure it can sorta half ass a lot of different things but besides org-mode and magit, it's a pretty mediocre and clunky piece of software (clunky, incredibly slow, ugly, etc)
- weaksauce 4y agowhy didn't you just use evil mode? vim is great and so is emacs and with evil mode you get vim inside emacs. i still use emacs for magit as it's hands down the best git gui i've seen so far. i used to use spacemacs but just wanted a quicker startup while still being reasonably configured... doom emacs is both.
- avindroth 4y agoTo each their own. Minds function differently, desire different workflows, and thus are extended better with different tools. I use both non-evil emacs and neovim, given the mood I am feeling that day. For quick and dirty things, I prefer neovim, and for more extended workflows, I prefer emacs. But besides functional differences, the two "mediums" feel different. Neovim is clean (and hangs less in general). No bloat. Emacs is a monster, suited towards my liking (with many years of .emacs config). But as much as I love Lisp, sometimes you want to get away from the bloat and sit quietly with a blinking cursor in vim.
- nyarlathotep_ 4y ago> which are (for some reason) the default cursor movement commands in most command line environments like the Postgres CLI. AFAIK/IIRC these bindings are something to do with readline being widely used for CLI interfaces? Additionally, they work all over OSX too (on text inputs), not just the shell--<C-a>, <C-e> for start and end of line, etc, probably lots of others too that I'm unaware of.
- malodyets 4y agoThe some reason is the (GNU) readline library that powers most command line editing.
- remexre 4y agoAlso, macOS seems to have copied many of them, so they're worth learning for that too IMO.
- butterisgood 4y agoI think of emacs as more of an operating system for emacs lisp with an in-built editor more than I think of it as an editor. I say that because I have "live documents" that run Jira queries for me, and cross reference defects to other systems behind REST interfaces and can drive the whole thing with a few keystrokes. (And it didn't take long to put together) Emacs and emacs lisp, is a bit like Smalltalk in some ways too, once you get the hang of it. (and I've thought of porting that entire workflow I just mentioned to Pharo too)