Hacker News new | ask | show | jobs
by checkyoursudo 1020 days ago
What is the coolest thing you can do with emacs?

I tried emacs a few years ago, but I didn't stick with emacs for more than a couple weeks, if even. I had already been using vim for many years before that without pain, so I could not find a compelling reason to switch.

4 comments

Customisability is the biggest selling point of emacs. I tried it many years ago as a user of Visual Studio. This way way before LSPs became a thing. I decided I much prefered Visual Studio at that time.

Then I transitioned to doing a lot less in C/C++ and more in Python, Java and shell scripting. I used Pycharm and Idea for a while as I got the licenses at work, eventually I tried Vscode with all the plugins, LSPs etc. I tried emacs again at the time. I liked the much better customisability, but I hated the fact Emacs was no faster than vscode on large codebases with lsp.

Eventually neovim with treesitter showed up and I embraced it as a nice quick editor. Then I heard emacs 29 has treesitter too so I decided to give it a try. Why? I was relatively happy with neovim, but certain things bugged me. I wanted ability to have different fonts and font sizes and other things.

So I started looking into emacs again. I wanted to learn the "emacs way" as opposed to the evil mode so I stayed away from distros like doom emacs. I set up treesitter (including for extra languages like hcl) an extra color theme and I'm happy enough to pursue it further this time.

I am programming SQL exploratorily in org mode. It renders server responses using org mode’s built-in spreadsheet engine. At the end of the day I mark the better queries for „tangling“ to create the schema changeset for me. In find that quite convenient.

Last time I was really impressed I had two remote dired buffers open (using tramp mode: „C-x f“: ssh:user@server.com:/foo/bar), one on server A and one on server B. Then I selected some files to copy (using „m“) and then hit „C“. Emacs then recommended the server B location automatically, I hit enter and it copied the files from A to B. Nice. You need „ dired-dwim-target“ (Do What I Mean target) set to true for this to work. But I use this trick regularly two run test queries on production machines.

What I also love is the built-in „compilation mode“. I‘ve bound „C-c l“ to „compile“ and „C-c r“ to „recompile“. We have different tests in different directories so I‘ve sprinkled a couple of “.dir-locals.el” in all the relevant places populating all the right default “compilation commands” for me. So when I want to run or create a new test I hit “C-c l” once, select the right default and then recompile after every iteration using “C-c r”. This boosts my turn over so much as any errors are also captured in separate buffer. The tests may even run remotely transparently by leveraging “ssh”.

So you don’t even need a complex configuration for easing many of your daily routines.

In the menubar I can click on Help->Describe->Describe Key or Mouse Operation... and then click on Tools->Compile Project to get information about what Tools->Compile Project does. It's easy to learn about the various tools available to me in a way that I find severely lacking elsewhere. Is it the coolest thing you can do in Emacs? Probably not, but it's something I really appreciate.