phi: gpu accelerated code-editor; definitely not to be confused phonetically with vi.
Go to file
Yasuhiro Matsumoto 88b798517d
pass empty string into ioutil.TempDir
TempDir uses the default directory for temporary files if dir is empty
2018-04-17 09:59:31 +09:00
cfg you can now toggle line numbers from displaying, fixes #28 2018-04-16 19:17:45 +01:00
gui cleanups to delete line, slight improvements to syntax highlighting 2018-04-16 23:25:19 +01:00
res editor -> gui, simple text rendering with rope ds 2016-11-13 22:31:21 +00:00
.DS_Store added mouse wheel scrolling + font face/size settings in toml configs 2018-04-15 19:18:01 +01:00
.gitignore fixed seg fault, try not to match conflicts 2018-04-15 22:10:05 +01:00
LICENSE license 2016-11-14 00:17:42 +00:00
main.go pass empty string into ioutil.TempDir 2018-04-17 09:59:31 +09:00
README.md fix config directory in README.md 2018-04-17 09:54:12 +09:00
screenshot.png updated screenshot; made for/if/switch/select/chan keywords in go 2018-04-14 02:13:05 +01:00

phi-editor

Phi is a minimal text editor designed to look pretty, run fast, and be easy to configure and use. It's primary function is for editing code.

Note that this is a work in progress and is very buggy! The editor is written as if it's a game, so it will probably eat up your battery, as well as run possibly quite slow - especially if you dont have a dedicated GPU - and probably crash frequently.

Do not edit your precious files with this editor!


Here's a screenshot of the editor:

goals

The editor must:

  • run fast;
  • load and edit large files with ease;
  • look pretty; and finally
  • be easy to use

building

You'll need Go with the GOPATH, GOBIN, etc. setup, as well as SDL2, SDL2_image, and SDL2_ttf. Here's an example for Ubuntu:

$ sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev
$ go get github.com/felixangell/phi-editor
$ cd $GOPATH/src/github.com/felixangell/phi-editor
$ go build
$ ./phi-editor

If you're on macOS, you can do something like this, using homebrew:

$ brew install sdl2 sdl2_image sdl2_ttf
$ go get github.com/felixangell/phi-editor
$ cd $GOPATH/src/github.com/felixangell/phi-editor
$ go build
$ ./phi-editor

If you're on windows, you have my condolences.

configuration

Configuration files are stored in $HOME/.phi-editor/config.toml. Note that this directory is created on first startup by the editor, as well as the configuration files in the 'cfg/' directory are pre-loaded dependening on platform: see 'cfg/linuxconfig.go', for example.

Below is a (non-exhaustive) configuration file to give you an idea of what the config files are like:

[editor]
tab_size = 4
hungry_backspace = true
tabs_are_spaces = true
match_braces = false
maintain_indentation = true
highlight_line = true

[render]
aliased = true
accelerated = true
throttle_cpu_usage = true
always_render = true

[theme]
background = 0x002649
foreground = 0xf2f4f6
cursor = 0xf2f4f6
cursor_invert = 0x000000

[cursor]
flash_rate = 400
reset_delay = 400
draw = true
flash = true

[commands]
[commands.save]
shortcut = "super+s"

[commands.delete_line]
shortcut = "super+d"

license

MIT License