Welcome to my little node on the network! My name is Petar and you can follow along while I try to figure out how computers work.

Recent notes

Zed as the default editor for commits

I started to use the Zed editor as my default editor, and with it I also use the terminal that comes with it. When using the Zed terminal, I would also like the git commit messages to open in Zed, but only if I’m actually in the Zed terminal. To do this, I first added this to my Zed configuration:

"terminal": {
  "env": {
    "TERM_PROGRAM": "zed"
  }
}

And then, in my Fish config, I added this:

# Zed editor
if test "$TERM_PROGRAM" = "zed"
    set -x EDITOR zed --wait
    set -x VISUAL zed --wait
end

Now, only when I’m in Zed terminal, git commits will also open in Zed. Any other terminal, it defaults back to Neovim.

Permalink

Recent Posts

Running to think

For a few years now, I've been partaking in the age-old ritual of running. I began my journey like many others, swathed in quality athletic wear and armed with a meticulous training schedule...

Read more

Recent reads