Hacker News new | ask | show | jobs
by lanycrost 8 days ago
I moved to nvim from vim and it's seems me to easy and handy for everyday use. While emacs like rocket since :D
2 comments

Emacs is most definitely not a rocket science. The problem with people trying Emacs is that they approach it just like any other text editor, instead of understanding the grand, core principle of it - Emacs is first and foremost a Lisp interpreter with a built-in text editor and not the other way around. Therefore it makes much better sense if you approach it from a Lisp perspective. Alas, many, perhaps most, beginners try it after hearing how "powerful this Emacs thingy is", and try to learn "editor features", instead of focusing on the Lisp side of things. Some even admit that they don't like Lisp and don't understand it and plan to never deal with it. Most posts of "abandonment" and "I switch to VSCode after decades of Emacs use", after closer examination, reveal that the person perhaps never even written any elisp code - at most, they'd just [almost] blindly copy&paste existing snippets into their configs.
No one, including yourself, approached emacs from a Lisp perspective.
I did.

After learning the key bindings, I actually found a library book on a pre-CLisp dialect of lisp by some finnish authors and wrote a tool i later used to write my thesis in electrical engineering.

The tool was parsing my matlab files and generated latex, which i then made into the final pdf, complete with formulaes and calculations.

So instead of writing a decent thesis, i learned about makefiles, latex, emacs lisp and the fact that parsers are very interesting.

Also, Lisp felt sooooooo out of this world after pascal, C, Cpp.

Surely, i did not work a single day as an electric engineer.

PS I keep looking for this book to this very day

GGP's claim is emacs is better learned as a lisp machine than a text editor, which is akin to saying a monad is just a monoid in the category of endofunctors. In other words, it does a neophyte no good to see the matrix without having lived in it first. It's all one can manage learning emacs's editing primitives if you've never seen it before. Reminding them some (but not all!) of these primitives are in fact elisp expressions is just annoying.
I have not forgotten my own "beginner's journey" - au contraire - I vividly remember it, and thus I'm sharing an admonition - so people wouldn't waste their time. Because I did. Besides, I have successfully mentored people from zero-to-hero and helped them learn Emacs.

My suggestion to focus on Elisp is not like tech-splaining monads, and Lisp is not that difficult. Definitely not even in the same league of difficulty as Haskell. It is an astoundingly simple language. And yet people just ignore it for years, clueless of what they're missing.

How did you approach emacs onboarding? In my case it wad sheer enthusiasm of 20 year old who want to do cool things, no matter the amount of effort.

So if it takes learning a language, language it was.

But i gave up on teaching Emacs. My current stance is: if you want emacs then you know how to do it.

I did - I first came to emacs during my lisp phase. I didn't stay with lisp, but I did stay with functional programming, and in those days emacs was the best environment for a number of functional programming languages (maybe still is).
GGP's claim is emacs is better learned as a lisp machine than a text editor, which is akin to saying a monad is just a monoid in the category of endofunctors. GGP's critique is typical of poor exposition. Read the first chapter of any maths textbook from the 1970s. It doesn't make any sense because the author already knows where everything leads and lest he appear a fool to his peers, will insist the reader does too.
And that's why it cost me two-three years of wasted experience. Looking back, I wish I had focused more on understanding Elisp, learning edebug and the built-in profiler. My bona fide Emacs journey began only after I started writing Elisp without fear.
I guess if one's hobby is fiddling with emacs, then I could see why learning edebug and the profiler are valuable first steps. But I view emacs as merely a tool to get vastly more important work done. I just want it to stay out of my way.

I have been using emacs for 20 years and never heard of edebug before today, and have never used the profiler. If I install some new package and it doesn't immediately work, I usually uninstall it right away. I don't have time to fuck around. I would rather chew glass than debug breaking changes in my init.el so I make changes rarely, and deliberately. To each their own, I suppose.

> I would rather chew glass

So, you're making assumptions even without ever trying? You just decided it's hard/time consuming/worthless even though you have "never heard" about it?

> I have been using emacs for 20 years

Yeah, well. Like I said: Emacs is first and foremost a Lisp interpreter, "using Emacs" actually means dealing with Lisp. To what extent - it's everyone's own choice. I have seen too many stories of people like you - "using" it for decades and then abandoning it for VSCode or other things, without even realizing what they've given up.

It only takes just a bit of knowing the basics of Elisp to get the genuine Emacs experience, otherwise, you're just riding the car, not driving it.

> I don't have time to fuck around

That is a big misconception. Prolific Emacs users don't waste time ricing their setup just for the sake of it. They apply Lisp to meet their needs. My own work demands certain changes every single day - I have to move between different projects, in different PLs, dissimilar teams; I poke into various APIs; consume data in all sorts of formats; build prototypes, every time with different scope and requirements; analyze huge sets of data; search through documents, hop between different hosts, etc. I can only imagine how miserable my life would've been without my Lisp tools, where Emacs invariably takes the center stage.

It seems like you lack the notion of what it's like to literally shape your tools for your needs as they evolve. It's like having an entire pottery workshop at your disposal, but choosing to only pick up the already finished, dried pieces. Seriously, don't be daft - hook up an AI assistant to your config, the possibilities are virtually endless. It could be just about anything - any small annoyance that you may decide to improve in your workflow. I wish I had developed this "emacs/hacker mindset" where I don't even think twice, if something feels suboptimal - I'd try to automate it. I'd just start typing some Elisp in my scratch buffer. These days, it has gotten even simpler than that - I'd just type a prompt.

>You just decided it's hard/time consuming/worthless even though you have "never heard" about it?

You must mave misread what I wrote, because you're conflating two different statements.

>I have to move between different projects, in different PLs, dissimilar teams; I poke into various APIs; consume data in all sorts of formats

None of this requires elisp beyond the use-package incantations to install a given mode, which is only done a single time.

>It seems like you lack the notion of what it's like to literally shape your tools for your needs as they evolve.

My needs are already mostly satisfied by emacs. It is excellent at editing and composing text out of the box already. I have language servers for auto-completion. I have syntax highlighting. If I am mangling a text file I use the build in transient macro recording feature.

The editor itself is almost never the bottleneck in my work. Elisp is so unpleasant that I have zero desire to hack around in it for fun.

>Emacs is first and foremost a Lisp interpreter with a built-in text editor and not the other way around.

I've been using emacs as my primary editor since about 2002 and I hate this take. Emacs Lisp is by far the worst part of emacs. It is a horrible language, best kept dark and deep in the vaults, not to be used, unless at the uttermost end of need.

My config, after more than two decades, is about 400 lines, and I consider that excessive.

> Emacs Lisp is by far the worst part of emacs

Say what you want, but I wouldn't trade it for any other (non-homoiconic) language. Sure, it won't win the contest of the "nicest Lisp", nevertheless - it's a Lisp, and therefore far better suited for the things Emacs is designed to do.

Have you ever thought why Org-mode, developed and maintained by a handful of people (perhaps fewer people than the React.js core team has) is capable of carrying features that (despite so many brilliant minds) never appeared in any similar products? Like for example, executable source code blocks in different PLs that can pipe data into one another. Even Jupyter can't do polyglot execution with data passing between the languages. That shit doesn't exist in Neovim, or VSCode (where MSFT poured millions of $), or IntelliJ. It exists because Lisp makes it much simpler to design and build such things.

As someone who's been "using" Emacs just like you (without ever writing much Elisp), and also "properly using" it for a long time and having to see both sides, I can assure you - it's absolutely worthwhile to spend some time grokking Elisp. It's not a horrible language. For what it is - it is incredibly flexible. You just don't know what you're missing.

Some of us like Emacs Lisp fine.

Its documentation (the manual in Info and M-x describe-function, etc) is exceptionally good. I don't need to be connected to the net when I'm writing something in Emacs Lisp. Try that with Javascript!

To each their own, but I don't really understand the sheer hatred elisp puts in some people. As far as scripting languages go, it's pretty good. I haven't seen a scripting language alternative I'd really prefer for this - maybe Clojure or some other modernized lisp.
It's not just Elisp, I think, just any Lisp dialect gets this reaction. Which, honestly, I can't fully comprehend. Wait, how do even people use Emacs while at the same time hating Lisp? Isn't that kind of a painful way to deal with it in general? Sounds like having extreme motion sickness but still loving cars, puking all the way while driving them.
I think there is a crowd, maybe less common than the others, that just want less warts. I can understand that, though I'm not sure the usual dialects that get thrown around are much better.

What I don't understand is wanting to replace elisp with a mainstream scripting language. None of them are really functional-style languages; it's just a completely different world.

(Non-scripting languages are a different story, but fundamentally a different use case.)

> I don't understand is wanting to replace elisp with a mainstream scripting language

That typically comes from people without any experience in any Lisps. They don't know "REPL-driven development", they haven't heard about "structural editing", Lisp looks like a parenthesized mess to them. I looked at it the same way until I learned. Now I don't even notice parens - I see structure, beauty and reason.

Heh. In the early 1990s, I got initiated to the basic Emacs key bindings and editing UI via JOVE for a Scheme programming class. JOVE didn't have elisp behind it, instead being light enough that scores of students could all be running their own editor session and Scheme interpreter processes on the same memory-starved, multi-user server.

I'd already known Common Lisp from a prior class, which mostly used some Mac based REPL. Shortly after, I had real Emacs and various CL and Scheme runtimes on my Linux PC. Scheme was my obsession at the time. A lot of my pathway into CS was puzzling over what it would take to implement a Scheme runtime. But, I felt no desire to get into the bizarre-to-me elisp dialect. It just felt gross.

Probably because of early years using shared terminal server rooms and hosts, I also learned that over-customization just became a pain when I had to move between environments. I ran the Emacs that came bundled with my Linux distro, with the extensions that came packaged along with it. Mostly I just tried to have Xresources to get my preferred color scheme and text fonts.

From all of this, I'm nearly some kind of old school Unix fundamentalist. I've never wanted an IDE. Or rather, my IDE has always been the host OS, shell prompt, filesystem state, and other terminals. I use adjacent shells to run builds, tests, debuggers, version control, etc. Emacs is just my editor. I've never, ever wanted any editor to subsume my OS, window management, and these other tools.

My favorite interface feature is creating several "frames" (separate X windows) viewing into the same buffers. Sometimes several files side by side, and sometimes several editing viewports on the same file. I also use the X based menus to find many esoteric features or session settings for which I would never memorize the command names.

But, when I am forced to run Emacs in text terminal mode, I revert to thinking of it like JOVE. I'd rather open multiple terminals (and SSH connections, when remote) and have each one run its own ephemeral Emacs instance with one buffer for a brief foray into one file. Somehow, I've never had the urge to fire up an Emacs server to share state between these. I just find my way back to a proper graphical Emacs when I want that kind of complex editing session.

The only Emacs modes I use are for syntax highlighting and auto-indentation. I also never wanted Emacs "windowing", i.e. text terminal muxing. For me, learning to kill accidental window splits was roughly the same need as learning how to exit/abort out of accidentally launched vi. Repulsed, I head for the exit!

My favorite editing features are just search, find-replace, and find-replace-regexp. But search is mostly just a fast-scroll to me, jumping forward or back to text I know is there. If I'm really searching, I more likely mouse over to a terminal window and run find and/or grep from a shell. My favorite advanced editing feature is buffer-compare (Ediff), which I use for merging changes between two files in side-by-side frames.

Oh, and I despise the GNU infos-style help system too. I much prefer manpages, or secondarily reading docs in a web browser.

> Or rather, my IDE has always been the host OS, shell prompt, filesystem state, and other terminals.

As described by its creators: The Unix Programming Environment <https://en.wikipedia.org/w/index.php?title=The_Unix_Programm...>

How to get started with nvim?