Live data from Hacker News

Claude Code IDE integration for Emacs

github.com

251–260 of 281 posts

Re: Claude Code IDE integration for Emacs

#251

Earlier quoted context omitted.

> 8 years user here so still an emacs noobie, but I switched to nvim I don't know man, whenever I see comments like this, I just don't get it - there's just no "switching" for me personally to anything, like ever, I just don't even see the possibility for it. The question that always gets me is like: "were you just using it like ... I don't know to edit text? That's all you've done with it?..." I have no idea how wou…

I envy your level of emacs knowledge! I did a lot of things in it, but not as many as you: https://blog.calebjay.com/posts/my-emacs-environment/ I really wish I had finished my blog post I'm working on right now about my new life stack that no longer involves emacs, it'd contain all the info I'd like to convey here. Looking at your list, I guess what it came to for me is that getting an excellent UX for any one of th…

Oy vey, I guess I'll have to get more prescriptive than enumerative. I do seriously appreciate your wonderment and the invitation for less emotional and more scholarly discourse.

> getting an excellent UX for any one of those given tasks is only possible by using a tool made for that job.

That's true, but only to a certain extent. You see, when you look at Emacs' pieces individually, it's really difficult to see it as a perfect tool for any job. Emacs isn't the best email client, it certainly doesn't have the best web browser, it isn't the greatest debugging tool for any given programming language, it's not the best version control tool, etc. But that's when you look at each of the features in isolation. What makes Emacs the overall greatest thing is that it has the ability to act like glue, and things can work in harmonious integration, I've spoken about that before. https://news.ycombinator.com/item?id=44131735 "I cannot compare one or multiple selected aspects of Emacs, because in my view that is a pointless mental exercise — I have the holistic comprehension of Emacs features and only can speak about the emergent properties that arise from their integration. To isolate individual features would be like asking a fish to compare water to air - I exist within this environment so completely that I cannot meaningfully separate its components from the unified experience they create."

> it would take a lot of time for me to tweak a plugin or write my own.

It may take a long time regardless of what tools you use. It all boils down to the mastery of a chosen tool. The majority of beginners focus on shiny trinket features and text editing machinery of Emacs instead of reaping the fundamental principal truth about it - Emacs is not really a mere text editor; in fact, it's a kind of Lisp machine with a text editor embedded in it. Once someone understands that, accepts Lisp with all its enormous power and some unavoidable flaws, that fundamentally changes the entire philosophy of using Emacs to accomplish things.

Now, that's all axiomatic inscribed acoustics, let's get down to less theory:

- For video playback control I use mpv.el with some customizations. Turns out mpv player has IPC and can be perfectly controlled from Emacs, I bet Neovim users do that as well. It's nice when taking notes or when I need to review a bunch of videos in a folder. I have a transient I use to play, rewind, speed up, etc., all directly from the current buffer. It's great.

- I use org-noter for annotating PDFs - it's really nice. I just can't read any technical or scholarly sources without taking notes. And these notes are never disconnected from the source - I can always see my notes next to the exact page. I never needed to find a way to actually embed the notes in a way so I can read them on my phone or tablet, but I bet these days it would be just easier to run Emacs - Android lets you and I don't own Apple products anymore.

- > I don't use anki at all anymore

Oh, that's sad, because there is plenty of research done that proves the effectiveness of spaced repetition. Starting from Ebbinghaus and Pimsleur in the beginning-mid of the prior century, to the modern empirical studies - Cepeda, Kornell, Karpicke. Meta-analyses of Dunlosky and Carpenter. There's recent neuroscientific evidence - Smolen, Zhang, Byrne, et al.

What I like about anki-editor that my flashcards are just my notes - I don't need to maintain some special format, somewhere else. These days, I even often generate flashcards using LLMs and sync them to my phone.

- For testing API endpoints I use Org-mode source blocks. For simple queries - ob-http, for data-heavy stuff I use verb.el - what I like about it is that it exposes hooks where I automatically convert json response to Clojure data structures. IMO Clojure is hands-down the best tool for quick data manipulation. I would have a src-block with `:wrap src clojure` in the header, then I can immediately start exploring the data - slicing, dicing, grouping, mapping through it, visualizing it - all without having to send new requests over and over again. I'm pretty sure I can do the same thing with ob-http by advising corresponding functions, but verb.el has public hooks that are well documented, so... Besides, using org-mode source blocks allows me to pipe that data into any other different language - e.g. Python.

... I'm having to split it (HM whines that my comment gotten too long)...

Re: Claude Code IDE integration for Emacs

#252

Earlier quoted context omitted.

I envy your level of emacs knowledge! I did a lot of things in it, but not as many as you: https://blog.calebjay.com/posts/my-emacs-environment/ I really wish I had finished my blog post I'm working on right now about my new life stack that no longer involves emacs, it'd contain all the info I'd like to convey here. Looking at your list, I guess what it came to for me is that getting an excellent UX for any one of th…

Oy vey, I guess I'll have to get more prescriptive than enumerative. I do seriously appreciate your wonderment and the invitation for less emotional and more scholarly discourse. > getting an excellent UX for any one of those given tasks is only possible by using a tool made for that job. That's true, but only to a certain extent. You see, when you look at Emacs' pieces individually, it's really difficult to see it a…

- > I've never heard of using org-babel for managing dotfiles

Oh that technique is just bananas - my entire system is in a single .org file, I'm sorry I can't share it - it contains private stuff and I just never thought about separating and encrypting it, I don't want to accidentally put something in public portion of it. So, I have source blocks with headers such as:

    #+begin_src gitconfig :tangle ~/.gitconfig :tangle-mode (identity #o444)
       ... it contains my gitconfig values
    
That's quite straightforward, innit? The readonly mode is for so I am not tempted to manually change the file, and prefer making changes in my dotfiles using (org-babel-tangle) command. Then I have another corresponding part of the same file:

    #+begin_src gitconfig :tangle (if (eq system-type 'gnu/linux) "~/.gitconfig" "no") :tangle-mode (identity #o444)
    
You can see that the first part would write to ~/.gitconfig on any system, the second part only does it on Linux, e.g. gpg program path differs.

I have some other tricks like merging only the values I care about with the entire config template, for example for my terminal. Kitty's config template is self-documented, so I'd like to preserve all that, including the values I keep commented out, but I don't want having to include the entire template in my .org file, I only want k/v pairs I modify. What I do is that I run elisp functions on org-babel-tangle-finished-hook, one of them would force Kitty to generate config template, then grab the values from my config and merge them in there. Org-mode files can contain executable elisp, so my single org-mode file is not only declarative, but when needed it also uses imperative instructions. The simplicity of this is ingenious. The only remaining bottleneck for bootstrapping any new machine - VM, EC2, Desktop - Linux and Mac for me is to get a hold of Emacs, cloning my dotfile.org and running org-babel-tangle - usually takes less than two minutes.

- Dired for file management is superb. It's better than anything I ever used before. I have all the trinkets there - icons, vim-style navigation, subtrees, etc. I don't know if you know this already, but Dired stands for "DIRectory EDitor" - you can fully edit your directory structure, recursively, using whichever tools you have in Emacs - multiple cursors and such, you can edit it as if you're editing plain text, and when you commit, it unravels this new structure onto the filesystem - that's just nuts.

- > Text under cursor - what modes is that

For intelligently recognizing patterns in plain-text I use Embark, it's very cool and it's relatively straightforward to add new types and commands recognizing it. If you never used Embark, I highly recommend it - it adds context-aware actions - so if the cursor is at a url, it knows what to do with it. It works great with Consult and Vertico. Another alternative which I have never tried is Hyperbole. I just never explored it, because Embark I guess covers it for me, but maybe there are things there I'm unaware of, it's probably best to expire both.

- For searching on HN I use consult-hn, a package of my own. It's published on MELPA. There's a demo in the readme, where I show how I read HN and Reddit and do some other interesting things, like extracting all urls from a thread.

- > I could just do this `whatever | nvim`, right?

Well, the thing is - when you do that in Eshell, the stuff stays within the Emacs session, buffers remain as part of your workspace, you can append to existing buffers and the result is immediately available for searching, macros, etc. Your command output always remains a first-class citizen in your editing environment.

- For automatic color theme change I use circadian.el. It's a relatively simple package that utilizes Emacs' built-in solar calendar.

- > I used to manage my emails in mu4e

Long ago I got annoyed by inconsistencies in mu4e and switched to notmuch. I don't use email as much anymore as I used to, but notmuch for me works better for mailing list discussions. What I like about using email in Emacs is that I can link to any email in my notes, and can jump to it directly from my notes - which I also don't use a lot, but it's nice to have. I also have some customizations, like finding a given email and opening it in gmail in the browser, or identifying a given email in a mailing list and opening it in the web interface, etc.

- > I used to track time very well in org mode

Yeah, I don't do much of that anymore, except for pomodoros. Pomodoro technique is great and it lets me focus on specific tasks and track the time spent on each, but I have never used it for serious analyses. However, I still can if I ever need to do that.

- > I am a recovering reddit addict and don't use it anymore

Those fuckers shadowbanned my account of many years for no good reason, and now all my previous comments and posts are not publicly available. I tried to send appeal requests for weeks, every single day, but they seem to be going into a void. I used to be very active there, but now I realized those imbeciles just broke the whole idea of what makes Internet, and I don't use it much anymore.

- Presentations in org mode. I don't remember when I had to do it last time, but I had great success with org-reveal. There are a bunch of different ways to create presentations in Org-mode, reveal is just one of them.

- For testing database queries I still use org-mode source blocks, it looks something like:

    #+begin_src sql :engine mysql :dbhost 127.0.0.1 :dbport 6009 :database mydb
    ...
- For managing Docker there's docker.el, you can also directly explore any given container using TRAMP-mode, you'd just navigate to /docker:container-name:/path/to/file, and that also works for k8s pods

- > Come on, opening a terminal and typing `man` isn't that big of a deal, surely!

Yeah, of course, on the surface it isn't. But you know what I often do (because I can)? I would open a man page in Emacs, using either (man) or (woman) command - typically the second one on Mac. Then, I can select a region of text, narrow my buffer to it and just start typing LLM requests, e.g., "can you explain this part, etc..." That alone makes kind of a big deal for me, not to mention that it's all within the same environment - all the keybindings still work the same, I have imenu, narrowing, etc.

- > I didn't know emacs had a mode for this, that's interesting but I can't imagine it to be quite as smooth as the webUI is...

Ha, you have no idea. First of all, because it's once again, tightly integrated, I can immediately start translating - active region, word-at-point, my killring content, etc. I speak multiple languages and it's not so atypical for me to try to translate things in the midst of typing or reading text - the speed and the efficiency Emacs allows me is beautiful.

But that's not all. Check this out. I'm learning Spanish, alright? So when I want to translate something like "The colonel was born in 1939...", what does GTranslate do? It translates it into "El coronel nació en 1939", and that totally makes sense, right? But guess what? I really needed to see it like this: "El coronel nació en mil novecientos treinta y nueve", because, well, I'm still getting acquainted with the numbers. How would one do it in literally anything else, any other plugin - for Vim, for VSCode, etc? For VSCode, you'd probably have to talk to the maintainer of an existing extension, make PRs, or even make your own. In Vim, you'd have to rewrite an entire function. What did it take me? Like 15 minutes and a few lines of Elisp. Did I have to learn the internals of GTranslate API? No. Did I have to rewrite an entire function that sends the payload there? No! Here's what I did: Using the built-in profile I've identified the function that sends the payload, and advised it. I added an advising function that just before sending the payload, checks the text, finds a pattern, then sends that portion for processing, to the number-to-words function. Guess what? I couldn't even find implementation of such a function in Elisp, and I didn't have time to write my own. I simply delegated the task to the npm package. Hacky? Sure. Stupid? Well, maybe. Yet, it does work. Maybe shit ain't so stupid if thy shit works, eh? Tell me if such simplicity is ever possible in other editors.

- > LLM integration in emacs looks very interesting

Oh, once again, you have no idea. It's just beyond amazing. Using gptel, I can send LLM commands virtually from anywhere - like I'd be typing commands in Eshell and I can just ask an LLM for the proper options for, I dunno, docker-compose, or something. Right there, in-place.

That example alone is very illustrative of what makes Emacs such an amazing tool - the best of everything - you always have access to all the tools you can imagine - I can use spellchecking, thesaurus, translation and LLM while I want to type something in a git commit message, Jira comment, Slack thread, etc.

I'd be talking to someone on the phone, and they'd ask me to spell out some cryptic thing - like a ticket number - no problem, Emacs can help me here, I'd select it, and run (nato-region), it spells it out using NATO alphabet.

I need to quickly figure out the difference between two dates - no worries, built-in calendar has a way for it.

It's just really difficult for me to imagine any scenario, a use case that is text-related and Emacs can't help with for any reason.

Not long ago I wrote a command to OCR the content of my clipboard. Because I didn't want to distract my colleague when he was showing some stuff over Zoom. I didn't want to keep interrupting him with "hey, hold on, can you send me this url?", "wait a minute, I'm taking notes here...", etc.

> I never arrived

It's quite alright, even though it is never a destination but still a journey.

I hope I was able to open your eyes to how empowering Emacs can be. But hey, I'm a die-hard vimmer, I use evil-mode, and I do use Neovim too - it's a fine tool for certain things where Emacs can feel too big and too clunky.

Re: Claude Code IDE integration for Emacs

#253
post #9

Like LSP and tree-sitter, I think AI coding tools like Claude Code or Aider are very good news for niche editors like Emacs or Vim. Instead of struggling about implementing advanced IDE-like features, they can integrate with these tools relatively easily, and focus on other editing related features that set them apart. In fact, IMO it makes these editors more competitive because they are highly customizable and easie…

You think VIM is a niche? neovim + vim is used by over 38% of developers according StackExchange survey. That is more than 1 out of 3 developer, closer to 2 out of 5. I am not sure what is going on with here recently, maybe I have overgrown the place, or maybe everyday a little by little this place is getting filled with people who shouldn't be talking about CS.

> people who shouldn't be talking about CS.

Dijkstra said computer science is about computers as much as astronomy is about telescopes.

I am not sure I agree with that, but it's definitely not about text editor choice.

I have a .vimrc file with LSPs and whatnot. But it was from 3 years back. These days I use VSCode and IntelliJ (depending on language) because they do so many things out of the box. I would say the choice of editor is the least consequential thing in one's understanding of "CS" and programming methodologies. On the other hand, using debuggers, profilers, monitoring tooling can have a real impact on how you solve some problems.

Re: Claude Code IDE integration for Emacs

#254

Earlier quoted context omitted.

It's not. I use vim on a daily basis, but all I do with it is writing commit messages. The rest I do with an IDE or different editor. I'm surely not alone with that.

And writing commit messages are to development in the same class as using the restroom?

Judging by the quality of most commit messages - yes.

Re: Claude Code IDE integration for Emacs

#255

Earlier quoted context omitted.

You think VIM is a niche? neovim + vim is used by over 38% of developers according StackExchange survey. That is more than 1 out of 3 developer, closer to 2 out of 5. I am not sure what is going on with here recently, maybe I have overgrown the place, or maybe everyday a little by little this place is getting filled with people who shouldn't be talking about CS.

> people who shouldn't be talking about CS. Dijkstra said computer science is about computers as much as astronomy is about telescopes. I am not sure I agree with that, but it's definitely not about text editor choice. I have a .vimrc file with LSPs and whatnot. But it was from 3 years back. These days I use VSCode and IntelliJ (depending on language) because they do so many things out of the box. I would say the cho…

> These days I use VSCode and IntelliJ (depending on language) because they do so many things out of the box.

While I don't appreciate the weight of an IDE, the time commitment to create (and maintain!) a config for vim/nvim with LSP, agents, etc., loses out to the relative ease of adding vim-style modal editing to the IDE.

Re: Claude Code IDE integration for Emacs

#256

Earlier quoted context omitted.

So how did the switch to neovim go? I'm very interested in where you ended up. Please share a summary if a full blog post is too hard! > I'd be curious to learn more about your API testing setup, that sounds very cool! At work, our API is served via FastAPI and there's swagger docs automatically available that I can browse in a web browser if I want, or I just in nvim `SPC f f` to open a fuzzy file finder and find th…

Ah, PDF, that would have been smart :P I can recommend at least trying neovim, but I had a much easier transition than perhaps you will, since I used `evil-mode` in emacs ;) So I've been a primarily modal editor for 8 years, and actually don't remember any of the chorded commands from my initial days learning emacs. I took one thing from that time: putting CTRL where CAPS is, then I installed evil-mode and never look…

> You're right, vim bindings are very qwerty focused.

I can't share my personal experience, because I never tried switching either to Dvorak or Colemak - I never conceived my typing speed to be a bottleneck - I type faster than I can think of words (but that might be because I'm not a native English speaker), but I've been a vim user for a very long time, and thus I've talked to many vimmers. I have heard several stories that switching to another layout wasn't incredibly difficult, but I suppose the experience would be very personal.

> Macros are great in vim, I think just as powerful as emacs.

Not quite. In Emacs, you can not only record and replay macros, they are fully editable entities.

Vim macros mostly are limited to sequential keystrokes, there's no vars, no if/then logic, no loops, there's no prompting for input, no data manipulation. From practical point these don't really matter, but what sets Emacs apart that you can record a keyboard macro and then fully edit the corresponding elisp code it translates to. Which also allows you to embed logic in a macro - you can inject Elisp evaluation directly during macro recording, which in practice allows you to do things like: "Loop through lines until you find a blank one" inside a macro.

> Maybe this is because more content creators are vim/nvim-forward, than emacs?

That might be true, most Emacs users don't even bother sharing their "secret" knowledge. Some interesting bits quietly sit, marinating in private repos for years, sometimes decades without ever making into a package.

One thing you might be missing here - there is a ton of Emacs Lisp out there. GitHub alone contains some enormous amount of Elisp. It's pretty mind blowing - I suspect there's more Elisp in the wild than Common Lisp and Clojure combined. And of course, I don't need to remind you that Elisp is not a general-purpose language. It's made for one and one objective only - to serve as a configuration language for Emacs, it doesn't get used in anything else.

Even with all the current and increasing popularity of Neovim, it will probably take a while to catch up with Emacs in terms of written code and solutions for it. Case in point - Org-mode. It's been around for a long time; it is an incredibly ingenious system. Alas, so many attempts to clone it to work in something else still haven't gotten too far.

Re: Claude Code IDE integration for Emacs

#257

Earlier quoted context omitted.

Oy vey, I guess I'll have to get more prescriptive than enumerative. I do seriously appreciate your wonderment and the invitation for less emotional and more scholarly discourse. > getting an excellent UX for any one of those given tasks is only possible by using a tool made for that job. That's true, but only to a certain extent. You see, when you look at Emacs' pieces individually, it's really difficult to see it a…

- > I've never heard of using org-babel for managing dotfiles Oh that technique is just bananas - my entire system is in a single .org file, I'm sorry I can't share it - it contains private stuff and I just never thought about separating and encrypting it, I don't want to accidentally put something in public portion of it. So, I have source blocks with headers such as: #+begin_src gitconfig :tangle ~/.gitconfig :tang…

You should really start a youtube channel with Emacs workflows screencasts :)

Re: Claude Code IDE integration for Emacs

#259
post #175

Earlier quoted context omitted.

> I'm curious what emacs users are doing these days. Integrating with a new language ecosystem is a significant amount of work for me because it involves making choices about what packages to configure and how, and which external dependencies to go with (e.g., which LSP server to use). I try to make those choices carefully, and for a lot of projects I touch in only a dabbler in those languages. It takes time to figur…

Yes Nix is also something I've been thinking of diving into with emacs to solve this issue. What's your experience been running Nix on non-Linux targets? I mostly use MacOS and FreeBSD outside of Linux, primarily MacOS.

I've written most of the development environment declarations for my team's projects, which are mostly glue code or IaC in Terraform, Python, Bash (Nix can do some really cool things with Bash scripts[1]), and Ruby, and some Nix packages that we also use to deploy those projects. About half of my team uses Nix on macOS, and the other half uses Nix on Linux (via WSL), and our other deployment targets are all Linux on AWS (some EC2 boxes, some Lambda services, some ECS/Fargate deployments), though not all of those are Nix-based.

There are sometimes small differences, like sometimes a Python package with native dependencies will fail to build in some Linux environments but not on macOS or vice-versa, but generally you don't, even then, need to special-case things by operating system to make them work uniformly.

As for overall support, macOS is a more chaotic and quirky environment: macOS updates break applications or remove APIs more often than Linux updates do, macOS updates nuke configuration files in `/etc`, or blindly steamroll system users (low UIDs), the login shell doesn't manage environment variables or other aspects of the GUI session, etc. These are extra hurdles that Nix has to work around on macOS. But it generally works well and the only real hooks that Nix needs into your environment are some shell scripts that need to be sourced on startup. If you know how to manage your PATH and shell initialization in general, you can do it with Nix. (Additionally, one distributions of Nix itself includes some extra software for managing these hurdles that works pretty well at the cost of a more opinionated and more "invasive" install-- check out "Determinate Nix" if you're interested.) Other than that, it's basically the same as on Linux. Package selection is good, things mostly work the same way.

Nix's support for platforms other than Linux and macOS is less mature. In years past, efforts have waxed and waned, but in the past few years there've been some concerted and persistent efforts to make Nix and Nixpkgs more usable on Windows, NetBSD, and FreeBSD. Even native (e.g., not just cross-compilation from other platforms) support for Windows is actually a thing!

You can also easily set up "remote builders" to local VMs for Linux and FreeBSD so that you can transparently build packages and environments for those platforms on your Mac, if that's a frequent choice of development platform.

Overall I'd say it's pretty good, but I don't personally know much about the current status of FreeBSD. It looks like there are a few hundred FreeBSD-specific packages in Nixpkgs, and there's also a fork of NixOS based on FreeBSD called NixBSD. Most packages include "platforms = [ unix ];" in their metadata, which means they're at least intended to build for not just Linux and macOS but also FreeBSD, but I don't know if Hydra is building binaries for any FreeBSD platforms. If it's not, then many packages may be untested and have small build problems. My guess is that at worst, Nix on FreeBSD is probably slightly behind where Nix on Linux was when I got into it 7 or 8 years ago. At that time, Nix still felt amazing and very worth it, but certainly required a willingness to learn how to package things and fill in gaps yourself to get the most out of it. Consider dropping by NixOS' Matrix community; I'm sure there's a FreeBSD channel. --

1: https://github.com/abathur/resholve/

Re: Claude Code IDE integration for Emacs

#260

Earlier quoted context omitted.

- > I've never heard of using org-babel for managing dotfiles Oh that technique is just bananas - my entire system is in a single .org file, I'm sorry I can't share it - it contains private stuff and I just never thought about separating and encrypting it, I don't want to accidentally put something in public portion of it. So, I have source blocks with headers such as: #+begin_src gitconfig :tangle ~/.gitconfig :tang…

You should really start a youtube channel with Emacs workflows screencasts :)

I have. I just suck at it splendidly and not getting any better https://www.youtube.com/@ilemming

btw, folks, if you have time, join our discussion today at 6PM Central Time https://www.meetup.com/emacsatx

Post reply on HN