reddit / emacs

Is my understanding of Vim and Emacs correct?

iKnowButWhy · 2022-07-29 13:24
slappy_buddha · 2022-07-29 13:48
I still use evil-mode (vim keybindings) with emacs.That way I retain the mnemonic-style keybinds of vim, but I get the internal architecture of Emacs. Every major editor supports vim keybinds - (and just customizable mnemonic keybinds in general) so its more about the editor "ecosystem" IMO Thats the major thing about Emacs I like - while it doesn't have exactly the same "one-click, out of the box" functionality as VSCode for plugins, etc - its really this open LISP iterpreter/environment that you can add new custom automations and workflows to in a super frictionless way. Live-editing your editor from within your editor is not only easy, its sorta how Emacs is designed to be used!
MitchellMarquez42 · 2022-07-29 14:08
I was like you a year ago. I got vim-pilled and believed that using something like emacs would be silly and unnecessary. I installed neovim because of the performance. I learned all the vim keys, I watched tutorials, I customized my vimrc. Eventually I started installing plugins. Little things at first, like a prettier statusline and some additional syntax highlights. Then bigger plugins, and eventually my own color theme. I started trying to use the nvim integrated terminal for convenience. I was taking all my notes and generating my website with vimwiki. And then, I hit a wall. What had taken me 9 months to achieve in nvim was replicated within a week of switching to emacs. _And_ things like LSP actually work (I followed several tutorials for nvim and it never would activate, but the emacs LSP-mode package with default settings launches and works great for the things I use it for). Tl;dr: beware the slippery slope of configuration.
anaumann · 2022-07-29 14:10
If you're thinking of "writing code" as "typing text into an editor", you've still got a long way to go on your software development journey :) Pretty soon, you'll be familiar with the syntax and then, you'll start developing software instead of encoding tasks into instructions ;) And with that and ever-growing codebases, you'll want some more help from your development environment and that's where those heavy (often Java-based) IDEs come from. They usually have an understanding of how your software works instead of just grepping within one or a couple of files, so they can suggest and/or autocomplete some items for you. Both emacs and vi-like editors like vim can do something similar with the language server protocol LSP.. In that regard, it more or less comes down to preference rather than "what's future proof" or "efficient". In a commercial environment, being able to hand over your mouse and keyboard to a colleague can also be a factor..
jsled · 2022-07-29 14:23
> I just want to learn the the most effective and future proof way of writing code. vim is not actually a good tool for writing code without extending it so far that you really wish you were using emacs or a modern IDE instead.
WallyMetropolis · 2022-07-29 18:25
If learning the most effective way to write code was a simple matter of picking the one, perfect tool then there would only be one tool and everyone would use it. Alas, it's not so simple. The benefit of Emacs is it' configurability. Given enough effort, you can customize Emacs to do any number of things. Often, that amount of effort is pretty small: just find and install the packages that do what you like. Other times, it's modest, like making small tweaks, setting up custom key-bindings, and such. And then some times it can be a lot of work: writing your own packages and modes to do things exactly the way you'd like them to work. What that means is you can create a development (and text editing) environment that is specifically tailored to your preferences, which can result in wild productivity. *Today* you're not interested in using Emacs for organization, email, or note taking. But over time you may discover that you'd like to be able to configure all those tools to work precisely as you'd like them to instead of how the developers of some other application designed them to work. You may also find that using a single platform for all of these things saves you from having to switch between many different systems that all work differently. I love that I can quickly jot down and file away a note if an idea pops into my head and then be right back in my workflow without disruptions, for example. If I am coding and want to add a reminder to myself to do something, I don't need to open a calendar app, wait for it to start, reach for my mouse, click around, then write the reminder, then jump back to my editor and try to remember what it was I was doing. I just file that reminder away using emacs without switching contexts (which, you will learn as you learn code that context switching is incredibly destructive to your productivity). Emacs is a tool that will grow and change with you as you develop in your career and preferences. It's not a static thing. I use it very differently today than I did 10 years ago.
flylikeabanana · 2022-07-29 20:32
Learning vim is perennially relevant, and evil-mode is one of the best vim emulation modes available. I think you're on the right track, learn vim as a component of the UNIX development environment, get used to personalizing your editor, and when you hit the inevitable wall that comes with vim's adherence to "do one thing and do it well", then switch to emacs and do anything you want, using evil-mode to bridge the gap.
iKnowButWhy · 2022-07-29 23:40
Thanks for the insight! I think I would also be susceptible to the same trap, but in general I prefer keeping my applications as close to default as possible. I don’t like bloating and slowing down the program cuz I have 5000 plugins. Moreover, I like having the adaptability to assume a normal workflow on a new piece of hardware. I don’t really like the idea of being severely hampered without my perfectly customized system. I can see myself changing my mind on this, and eventually giving in to the conveniences and productivity improvements that come from meticulously configuring your setup. As things stand currently though, I prefer to get the most efficiency out of the least amount of added “bloat” (for lack of a better term).
iKnowButWhy · 2022-07-29 23:45
Yea I can see that vim is only the tip of the iceberg. I’m currently using IntelliJ with Vim bindings for Java and using Vim for any other text-editing task I have. I think that if I can’t do something with Vim easily, I would prefer to use a specialized application with a Vim-mode plugin as opposed to configuring Emacs for everything. As I gain more experience, however, I suspect that my views will change a lot.
marcioandrey · 2022-07-29 23:46
Hi. Let us agree in disagree. I use Vim for decades now without plugins on my daily work (as a developer) and I have no complains at all
[deleted] · 2022-07-29 23:54
[deleted]
namskiiiii · 2022-07-30 01:25
Your understanding of Vim and Emacs is pretty good. I have used both and I would recommend you to start off with Vim. Modal editting is superior. That's why there's evil-mode in Emacs, it tried to bring the best of Vim to Emacs.
balatus · 2022-07-30 03:19
vi is good to know, it's likely to be installed in some form on most Unix like OSes. I don't see Vim.as lightweight beyond using it as a text editor, if you want to use it as a development environment, it will cease to be lightweight. I honestly don't think that modal editing is superior, it's a preference thing. I tried Doom Emacs with the vim keybindings and hated it. Emacs keybindings are fine for me. Others loathe them. I use IntelliJ for Java, but now I'm working in Typescript I'm back to Emacs, the Jetbrains products are too slow and difficult to configure for our setup. Emacs has been far easier to tweak and get working (I just wish I didn't have to switch to other apps now). I never even considered Vim for that.
anaumann · 2022-07-30 08:33
Or maybe they won't :) The jetbrains IDEs are quite nice for software development. Whatever editor you're using for everyday editing won't matter much, I guess.. I switch back and forth between emacs and vi most of the day, because I'm using emacs locally and vi on all the servers I'm running and on some days, I run vi on my machine in an emacs terminal :D Being somewhat proficient in vi usage is never wasted time, because it's just so ubiquitous. Deep diving into emacs often ends with you barely leaving emacs again, because there's a package for everything and they all (kind of) look and feel the same. The only thing I never really warmed up to was Java development in emacs, but I haven't tried for a couple of years, because the "handing the keyboard over" factor is rather low in that case :) It's just easier if you're using the same IDE as everybody else :)
a-concerned-mother · 2022-07-31 07:00
I hear this all the time then see just(often more) as many vim plugins in the persons vimrc/init.lua/init.vim. More often you hit slowdown just due to one plugin at a time. I think people vastly over estimate how this ends up going. It's less so installing a ton of plugins and more so having better more extensible tools. Many of the built in features from vim I liked have basically been abandoned in favour of just telling people to use a plugin (even by the developers). A good example is using vim's native completion functionality with omnicomplete which shouldn't take much extension to be as capable as any ide's completion if not more powerful. instead they just tell you to use a new completion framework rather than actually making the program extensible. In the end you see people with 10 plugins just trying to hook into a new completion framework that vim didn't support in the first place. Same goes for linting, and command mode. Extending defaults seems to be an abandoned mindset in the vim community these days. Anyways my point was really that while you see extensive package filled config you would be surprised at just how much is actually possible with default features just turned on.
a-concerned-mother · 2022-07-31 07:02
For the record this isn't intended to be an attack on neovim or vim just a response to the point I so often hear when people talk about configuration being way more powerful. Assuming it's all about plugins