3 ms·
> — Well, in my FrobnicatorStudio, there's a shortcut Ctrl+Alt+So for that When I get those people typically I'll switch to Emacs (it's always open), use dired
by TacticalCoder 3mo ago
> — Well, in my FrobnicatorStudio, there's a shortcut Ctrl+Alt+So for that
When I get those people typically I'll switch to Emacs (it's always open), use dired and rename 20 files at once, using either a keyboard macro I make on the spot or using a regexp replace.
This usually not only get them to shut up for good, they also typically then see me as the "computer wizard".
I demo'ed some terminal (piping command calls) and Emacs tricks to a very good dev who's using JetBrains tools. He got it and was very respectful... He told me: "yeah I can see the appeal, but it's not for me".
The CLI / terminal / command line utils won: LLMs have proved that. The discussion is over.
- frollogaston 3mo agoThat and Python. LLMs will use one-off Py scripts for anything on the complicated side.
- jibal 3mo agoWhen appropriate I use M-S-! or M-S-| to run a shell command in emacs.
- brabel 3mo agoWhy not eshell?
- slopinthebag 3mo agoI don't think I've ever had to rename 20 files at once, so I wonder if the way people work is kind of shaped by their tools?
- brabel 3mo agoThe only case I can imagine is when I rename a Java interface and want all implementations to be also renamed accordingly. I can do that in 1 second in IntelliJ. With dired on emacs that would not be possible at all and I would need a tool that can find all implementations first: that requires a LSP on emacs, and then from a xref buffer, not sure how I could rename all classes and their files at once. Probably would need to be manually done? Anyone knows how to do it in emacs with one command?
- maleldil 3mo agoIt would be the same as in IntelliJ. As long as you have the Java LSP active, you issue the `lsp-rename` action: https://emacs-lsp.github.io/lsp-java/#lsp-mode-commands https://emacs-lsp.github.io/lsp-java/#lsp-mode-commands This works exactly the same for all languages whose LSP support this action, which is most of them.
- brabel 3mo agoNo! Rename in JSP is not intelligent enough to match an interface name with its implementation names and decide whether to also rename those!
- maleldil 3mo agoWhat do you mean by "implementation names"? I assumed you meant changing the "implements X", which should be easy for an LSP.
- brabel 3mo agoJava implementations sometimes take part of the name from the interface they implement, for example, `FooRunner` probably implements `Runner`. My example was that I renamed `Runner` to whatever, `Executor`, and IntelliJ will ask me if I want to rename also implementations (in this case, it would show `FooRunner` -> `FooExecutor`).
- MrMetric 3mo agoI've had to batch-rename files many times over the years. That means: 1. I do it manually over however many minutes. Works if there aren't too many (especially if the pattern is too complex to trivially automate). 2. I make a Python script for it. No way I'm renaming a thousand files by hand. 3. I don't do it. Too much work. The problem lingers forever. Or these days, 4. I make an AI datacenter eat another town's water supply. I've never used Emacs. I tried vi(m) nonconsensually and had to google how to exit. A while later, I tried it intentionally and hkjl navigation didn't work because I use a custom keyboard layout, so I never touched it again. Sublime Text and its many cursors for the win! I'd love a way that isn't miserable to do such a common basic task.
- zahlman 3mo ago> I'd love a way that isn't miserable to do such a common basic task. The problem is that you actually describe a family of tasks which is not basic. The "iterate over files, select the right ones and apply rules to rename them" part is common; the problem is that the rules vary broadly in kind and complexity, and you haven't figured out how you want to specify them (some ways will be limited in the complexity they can handle. (Usually the selection of files is trivial; when not, we can fold that complexity into the change rules, and emit null changes in some cases.) If your selection rule is simple enough for Bash globbing, and your per-file rename rule is simple enough for, say `tr` to handle, then that's trivial to wrap up as a Bash script (or function). In fact, you could write the Python script such that it just accepts a single input filename and outputs the changed version, and handle the rest externally. > I've never used Emacs. I tried vi(m) nonconsensually and had to google how to exit. A while later, I tried it intentionally and hkjl navigation didn't work because I use a custom keyboard layout, so I never touched it again. Sublime Text and its many cursors for the win! I'm not really clear on how text editors are supposed to be relevant to batch file renaming. If trying vi(m) the first time wasn't your idea, then there should have been someone else around responsible for guiding you through it. But the variations I've tried had arrow-key navigation configured by default (and `vimtutor` explicitly tells you that it should also work); you really don't have to learn hjkl, which exists largely for a combination of historical reasons with a lot of back-filled justifications. (I would have used ijkl, mimicking an arrow-key layout.) And everything can be remapped in the config files.
- iLemming 3mo ago"I don't think I've ever had" stance, about any problem is not a good argument. At some point you'd face them and the mental models shaped by the tools you choose, often force you to deal with them in a way that often creates small, subtle micro-annoyances. You won't even consciously notice them, yet they add up. You get constantly distracted, every time by small bits, your focus budget gets eroded without you even noticing it. You feel inexplicably tired at 3PM without any meaningful work getting done for the day. In psychology there's a term called "emotional bank account model" - small chronic negatives silently drain the account, so by the time something "big" happens there's no reserve left, even though the big thing isn't the actual cause. That is I think why our field has notorious "burned out programmer" problem. We can't even explain the reasons - because the accumulation is diffuse and undramatic, people lack a narrative-worthy explanation, and the real cause is chronic negative-affect accumulation. That is why it is important to seek ways for the "gratified productivity" where no matter how small your problem seem to be, you can find ways to automate it nicely, ideally reaching for solutions quickly. Tools do shape your mindset. Expertise changes what affordances you perceive. Experienced Emacs user when stumbled on a problem looks at a workflow and literally sees the seams where it can be pried open, the way a climber sees holds on a blank wall. Novices often don't even recognize the wall. It's not that Emacs "has this capability, but other tools don't", it's not about specific features, it's about the mindset. Experience awk hacker for the same "rename 20 files problem" may combine a complex looking single-liner and say: "who needs Emacs schmimax? ble...", the difference in the approach, but the result is not just the output but also the mental gratification - small problem fixed quickly. While a newbie would be doing it manually, and maybe even solving it faster, but there's no gratification. We are species of "tool builders" - we get excited from using tools, sharpening them each time. Menial tasks don't leave that sharpened mental edge, they "blunt" your mindset and accumulate frustration.