launch_editor

package module
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 12 Imported by: 0

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
Value Editor Linux Windows OSX
appcode AppCode
atom Atom
atom-beta Atom Beta
brackets Brackets
clion Clion
code Visual Studio Code
code-insiders Visual Studio Code Insiders
codium VSCodium
emacs Emacs
idea IDEA
notepad++ Notepad++
pycharm PyCharm
phpstorm PhpStorm
rubymine RubyMine
sublime Sublime Text
vim Vim
visualstudio Visual Studio
webstorm WebStorm
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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LaunchEditor

func LaunchEditor(file string) error

func LaunchEditorWithName

func LaunchEditorWithName(file string, specifiedEditor string) (err error)

Types

type EditorProcessError

type EditorProcessError struct {
	// contains filtered or unexported fields
}

func (*EditorProcessError) Error

func (e *EditorProcessError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL