## LiteEnv Plugin

LiteIDE environment setup plugin

### Select Environment

Select current use environment, default system

- Windows - win64 or win32
- Linux - linux64 or linux32
- MacOSX - darwin64 or darwin32

### Configure Environment

Menu: View -> Options -> LiteEnv or Welcome: Options -> LiteEnv

Double clicked *.env file to editor

Example win32.env

    #win32 environment

    GOROOT=c:\go
    GOARCH=386
    GOOS=windows

    PATH=%GOROOT%\bin;%PATH%

    LITEIDE_GDB=gdb
    LITEIDE_MAKE=mingw32-make
    LITEIDE_TERM=%COMSPEC%
    LITEIDE_TERMARGS=
    LITEIDE_EXEC=%COMSPEC%
    LITEIDE_EXECOPT=/k

Example linux32.env

    #linux32 environment

    GOROOT=$HOME/go
    GOARCH=386
    GOOS=linux

    PATH=$GOROOT/bin:$PATH

    LITEIDE_GDB=gdb
    LITEIDE_MAKE=make
    LITEIDE_TERM=/usr/bin/gnome-terminal
    LITEIDE_TERMARGS=
    LITEIDE_EXEC=/usr/bin/xterm
    LITEIDE_EXECOPT=-e

## LiteBuild Plugin

LiteIDE build system, build project or file, if file belong a project

### Configure Build

Menu: View -> Options -> LiteBuild or Welcome: Options -> LiteBuild

Double clicked *.xml file to editor

Example linux gopackage.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
        <mime-type type="text/x-gopackage" id="go-package" work="$(PROJECT_DIR)">
            <config id="Go" name="GO" value="$(GOROOT)/bin/go"/>
            <config id="GoExec" name="GOEXEC" value="$(LITEAPPDIR)/goexec"/>
            <config id="ErrRegex" name="ERRREGEX" value="([\w\d_\\/\.]+):(\d+):"/>
            <custom id="TargetArgs" name="TARGETARGS" value=""/>
            <custom id="BuildArgs" name="BUILDARGS" value=""/>
            <custom id="InstallArgs" name="INSTALLARGS" value=""/>
            <action id="Build" img="blue/build.png" key="Ctrl+B;F7" cmd="$(GO)" args="build $(BUILDARGS)" save="all" output="true" codec="" regex="$(ERRREGEX)" />
            <action id="Install" img="blue/install.png" key="Ctrl+F8" cmd="$(GO)" args="install $(INSTALLARGS)" save="all" output="true"/>
            <action id="Clean" img="blue/clean.png" cmd="$(GO)" args="clean" save="all" output="true"/>
            <action id="CleanAll" img="blue/cleanall.png" cmd="$(GO)" args="clean -i" save="all" output="true"/>
            <action id="Test" img="blue/test.png" key = "Ctrl+T" cmd="$(GO)" args="test" save="all" output="true" codec="utf-8"/>
            <action id="RunTerm" img="blue/runterm.png" key="Ctrl+Shift+F5" cmd="$(LITEIDE_EXEC)" args="$(LITEIDE_EXECOPT) $(GOEXEC) $(TARGETNAME) $(TARGETARGS)" output="false" readline="true"/>
            <action id="Run" img="blue/run.png" key="Ctrl+F5" cmd="$(TARGETPATH)" args="$(TARGETARGS)" output="true" codec="utf-8" readline="true"/>
            <action id="BuildAndRun" img="blue/buildrun.png" key="Ctrl+R;Ctrl+F7" task="Build;Run"/>
            <action id="GoFmt" img="blue/fmt.png" cmd="$(GO)" args="fmt" save="all" output="true" regex="$(ERRREGEX)"/>
        </mime-type>
    </mime-info>

- lookup mime-type: if no project, load example.go first lookup Makefile or *.e64 to use build toolbar
- action task: order execution defined action id list

## GolangCode Plugin

Use gocode word complete, example `fmt.`

### Install gocode

    $ export GOROOT=$HOME/go
    $ export PATH=$HOME/go/bin:$PATH
    $ go get -u github.com/nsf/gocode

### Load gocode incorrect

Test gocode status (my = my computer name)

    $ gocode status
    dial unix /tmp/acrserver.my: dial unix /tmp/acrserver.my: connection refused
    $ rm /tmp/acrserver.my

Reload LiteIDE

## GolangDoc Plugin

Golang doc browser and search

### Find package

example input "zip"

    archive/zip
    compress/bzip2
    compress/gzip

The result best matche is archive/zip, auto open zip package document.

## CodeSearch Plugin

Editor code search and replace

### Regex

(Colo)(u)(r) -> \1\3

## LiteDebug Plugin

LiteIDE debug plugin

### Gdb version >= 7.1

Golang debug request gdb version 7.1 or high

### Source path

The file or project source path cannot include outsite space or latin1 char

### Environment LITEIDE_GDB

example LiteEnv -> win64.env

    PATH=c:/go-w64/bin;%PATH%
    GOROOT=c:/go-w64
    GOBIN=c:/go-w64/bin
    GOARCH=amd64
    GOOS=windows
    LITEIDE_GDB=gdb64

### WIN32 and WIN64

WIN32 request gdb.exe,WIN64 request gdb64.exe.

## GolangFmt Plugin

Golang gofmt plugin

### Gofmt Setup

Menu -> View -> Options -> GolangFmt

- Use diff : use gofmt -d or not,need lookup gnu diff in PATH
- When the editor is saved auto fmt: need for gofmt -d

## Other

### Problems with window resizing under linux

This is a dock bug. drag any dock view (example golang package browser) to liteide right side and dock, and restart liteide.