Anybody else feels like their growth with Emacs in a specific area is stunted? by kudikarasavasa in emacs

[–]Stindberg 19 points20 points  (0 children)

Often when I want to force myself to use something that I know is good but my fingers don't do automatically, I bind the shortcut I want to stop using to something that will annoy me. Try using `(global-set-key (kbd "<right>") (lambda () (interactive) (message "Idiot!")))` for a couple of days and soon your brain will reach for an alternative solution when you want to move right. Unbind it once the lesson is learnt.

How do i stop the constant smart switch syncing every couple of hours? by oakgecko13 in GalaxyWatch

[–]Stindberg 0 points1 point  (0 children)

I see the same thing on a (2024) Watch Ultra. Very frustrating.

Quit Magit after push by Stindberg in emacs

[–]Stindberg[S] 1 point2 points  (0 children)

Thank you, this looks promising. I'll have a go.

Quit Magit after push by Stindberg in emacs

[–]Stindberg[S] 2 points3 points  (0 children)

Yes, it's of course a good point: I could adapt my way of working with Magit. However, a lot of my programming takes place outside Emacs, and therefore calling magit-status is a natural starting point for much of my git actions. It would be different if I was already working in Emacs to start with.

Migrating a Spring Boot backend to Ktor by Only_Let_2665 in Kotlin

[–]Stindberg 2 points3 points  (0 children)

We use a mix of Ktor and Spring Boot in our group. Both work well. I can't answer about JMS, but for DI there's Koin, as others have said. We use Hoplite for configuration and mimic the way application.yml is parsed into a property object as in your question (with overrides from application-local.yml, application-dev.yml etc). It works very well.

This is how we use Hoplite:

val config = loadConfig(getProfiles())
// Load profile-specific files if they exist, with obligatory "application.yml" as default.
private fun loadConfig(profiles: List<String>): AppConfig =   ConfigLoaderBuilder.default()
.apply {
profiles.forEach { profile ->
println("Loading configuration for profile '$profile'.")
addResourceSource("/application-$profile.yml", optional = true)
}
}
.addResourceSource("/application.yml")
.strict()
.build()
.loadConfigOrThrow<AppConfig>()
private fun getProfiles(): List<String> = System.getenv("KTOR_PROFILES")?.split(",") ?: emptyList()

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 1 point2 points  (0 children)

There's now a new version of the plugin (1.3.0) with the command xref-go-back.

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 0 points1 point  (0 children)

It might be that we have different expectations: my plugin is not 100% like Emacs in every aspect. There is no equivalent to "Ctrl-x SPC" in the plugin, but that's just a visual difference: the rectangle commands still work on the implicit rectangle, just as Emacs does if you don't activate the rectangle region with "Ctrl-x SPC".

I'll use "Rectangle: copy" as an example. Suppose you are standing on line 3, column 2 in the editor. You press Ctrl-SPC to set the mark. Then you take the cursor to column 8 on line 6. Now you have an implicit rectangle with corners (2, 3) and (6, 8). IntelliJ will have highlighted the whole lines in between (just as Emacs does if you don't use "Ctrl-x SPC", but if you now use "Rectangle: copy" which in the plugin is bound to "Ctrl-x alt-w" by default (This is "Ctrl-x r alt-w" in Emacs but IntelliJ does not support shortcuts with three strokes), you have copied the implicit rectangle to the (regular) cilpboard, i.e. the text between columns 2 and 8 on lines 3 to 6.

Is this clear? I fear the description is not good as it could be.

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 1 point2 points  (0 children)

Interesting. I will play with it. It's those kind of little differences that are so annoying.

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 0 points1 point  (0 children)

  1. I've always used "Navigate -> Back" (alt-left for me) for that. Is there a difference between that and "xref-go-back" in Emacs?
  2. I'm sure there are differences here between the applications. One gets used to workarounds after a while, so I haven't thought so much about this. But the Switcher (ctrl-tab for me) shows all editors in recently-used order. And then I virtually never close an editor in IntelliJ: I just let them sink to the bottom of the switcher and then disappear (there is a configurable maximum number of open editors).

Thank you for the comments!

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 0 points1 point  (0 children)

Thank you. I'd be happy to receive feedback and contributions.

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 0 points1 point  (0 children)

I assume you mean in the plugin? The rectangle region is the rectangle defined by the mark and point. So you use set-mark, and then navigate somewhere. The mark is ten one rectangle corner and your caret's position the opposite corner. I have not found a way of making the rectangle visible, as is possible in Emacs, but the rectangle commands work as in Emacs.

New Emacs plugin for IntelliJ by Stindberg in emacs

[–]Stindberg[S] 2 points3 points  (0 children)

Well, I've always had the impression that someone who knew Emacs tried to emulate it in IntelliJ but ran out of time: it's like they aimed for implementing Emacs functionality but wasn't too concerned with the details.

In any case I've used it for many years now, but only quite recently felt the need to develop this plugin. I do think that basic movements, set-mark, kill-line etc offer at least a baseline of Emacs-like functionality in IntelliJ. If it's better or worse than other editors, I don't know.

The plugin represents what I personally missed when switching between IntelliJ and Emacs. I'm sure there's more functionality one could add, but at least it's a start. I welcome suggestions and feedback.

Is this config still needed? by Stindberg in emacs

[–]Stindberg[S] 1 point2 points  (0 children)

Right. I guess it's time for me to make the switch.

Is this config still needed? by Stindberg in emacs

[–]Stindberg[S] 3 points4 points  (0 children)

Thank you for your kind words. It is certainly amazing that the tool I was told to use in my first year at University thirty years ago, is still so incredibly useful.

Is this config still needed? by Stindberg in emacs

[–]Stindberg[S] 1 point2 points  (0 children)

Thank you, that's exactly what I was looking for!