I recently discovered the newContentEditor configuration setting, but for some reason I can’t seem to get it to work. I’ve added this to my config.toml:
NewContentEditor = "code"
In theory, this should launch Visual Studio Code when adding new content with hugo new post/test.md, but in my case (on macOS Mojave) it creates the post file, but does not open it in Visual Studio Code.
If I run it “manually” with hugo new post/test.md --editor=code it works as expected, so the Visual Studio Code binary is in my path, and can be called just by typing in code.