Categorygithub.com/Binbiubiubiu/launch_editor
repositorypackage
1.0.6
Repository: https://github.com/binbiubiubiu/launch_editor.git
Documentation: pkg.go.dev

# README

launch_editor

Open file with line numbers in editor from Go.

Usage

package main

import (
	"log"

	. "github.com/Binbiubiubiu/launch_editor"
)

func main() {
	err := LaunchEditorWithName("guess.go:59:20", "code")
	if err != nil {
		log.Fatalln(err)
	}
}

Supported editors

ValueEditorLinuxWindowsOSX
appcodeAppCode
atomAtom
atom-betaAtom Beta
bracketsBrackets
clionClion
codeVisual Studio Code
code-insidersVisual Studio Code Insiders
codiumVSCodium
emacsEmacs
ideaIDEA
notepad++Notepad++
pycharmPyCharm
phpstormPhpStorm
rubymineRubyMine
sublimeSublime Text
vimVim
visualstudioVisual Studio
webstormWebStorm

Custom editor support

You can use the LAUNCH_EDITOR environment variable

to force a specific supported editor

LAUNCH_EDITOR=codium

to run a custom launch script

LAUNCH_EDITOR=my-editor-launcher.sh
# gets called with 3 args: filename, line, column
filename=$1
line=$2
column=$3

# call your editor with whatever args it expects
my-editor -l $line -c $column -f $filename

Thanks

launch-editor Open file in editor from Node.js.