phi/README.md

146 lines
3.8 KiB
Markdown
Raw Normal View History

2016-12-02 20:08:42 +03:00
<p align="center"><img src="res/icons/icon96.png"></p>
2018-04-22 20:43:01 +03:00
<h1>phi</h1>
2018-04-29 21:12:49 +03:00
Phi is a minimal code editor designed to look pretty, run fast, and be easy
2018-04-17 03:54:12 +03:00
to configure and use. It's primary function is for editing code.
2018-04-14 04:17:13 +03:00
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**.
2018-04-29 21:12:49 +03:00
**Do not edit your precious files with this editor!**
2016-11-14 10:06:25 +03:00
2016-12-02 20:06:11 +03:00
<br>
2018-04-22 20:43:01 +03:00
Here's a screenshot of Phi in action:
2017-11-04 17:24:44 +03:00
<p align="center"><img src="screenshot.png"></p>
# goals
The editor must:
2018-02-28 16:23:07 +03:00
* run fast;
* load and edit large files with ease;
* look pretty; and finally
2018-04-17 03:54:12 +03:00
* be easy to use
2018-04-29 21:12:49 +03:00
## non-goals
The editor probably wont:
* have any plugin support;
* be very customizable in terms of layout;
* support many non utf8 encodings;
* support non true-type-fonts;
* support right-to-left languages;
Perhaps in the future if I have time to get round to some of these
I may. Avoiding most of these is to avoid complexity in the code-base
and general architecture of the editor.
2018-04-22 20:43:01 +03:00
# why?
The editor does not exist as a serious replacement to Sublime Text/Atom/Emacs/[editor name here].
Though one of my big goals for the project is to possibly replace sublime text for my own personal use. Thus the editor is somewhat optimized for my own work-flow.
The code is up purely for people to look at and maybe use or contribute or whatever. Sharing is caring!
2018-04-17 16:23:51 +03:00
# reporting bugs/troubleshooting
Note the editor is still unstable. Please report any bugs you find so I can
squash them! It is appreciated if you skim the issue handler to make sure
you aren't reporting duplicate bugs.
## before filing an issue
Just to make sure it's an issue with the editor currently and not due to a
broken change, please:
* make sure the repository is up to date
* make sure all the dependencies are updated, especially "github.com/felixangell/strife"
* try removing the ~/.phi-config folder manually and letting the editor re-load it
2016-11-16 07:26:29 +03:00
# building
## requirements
You will need the go compiler installed with the GOPATH/GOBIN/etc setup. In addition
you will need the following libraries:
* sdl2
* sdl2_image
* sdl2_ttf
If you're on Linux, you will need:
* xsel
* xclip
Either works. This is for copying/pasting.
### linux
Here's an example for Ubuntu:
```bash
$ sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev xclip
2017-12-14 02:45:51 +03:00
$ go get github.com/felixangell/phi-editor
$ cd $GOPATH/src/github.com/felixangell/phi-editor
$ go build
2017-12-14 02:45:51 +03:00
$ ./phi-editor
```
### macOS
2018-04-16 17:34:16 +03:00
If you're on macOS, you can do something like this, using homebrew:
```bash
2018-04-22 04:35:31 +03:00
$ brew install sdl2 sdl2_image sdl2_ttf pkg-config
2018-04-16 17:34:16 +03:00
$ go get github.com/felixangell/phi-editor
$ cd $GOPATH/src/github.com/felixangell/phi-editor
$ go build
$ ./phi-editor
```
### windows
2018-04-16 17:34:16 +03:00
If you're on windows, you have my condolences.
## configuration
2018-04-17 03:54:12 +03:00
Configuration files are stored in `$HOME/.phi-editor/config.toml`. Note that
2018-02-28 16:23:07 +03:00
this directory is created on first startup by the editor, as well as the configuration
2018-04-16 16:16:25 +03:00
files in the 'cfg/' directory are pre-loaded dependening on platform: see 'cfg/linuxconfig.go', for example.
2018-04-29 21:12:49 +03:00
Below is an incomplete configuration file to give you an
2018-04-16 16:16:25 +03:00
idea of what the config files are like:
2016-11-16 07:26:29 +03:00
```toml
[editor]
2018-02-28 16:23:07 +03:00
tab_size = 4
2016-11-27 20:31:40 +03:00
hungry_backspace = true
tabs_are_spaces = true
match_braces = false
2018-02-28 16:23:07 +03:00
maintain_indentation = true
highlight_line = true
2016-11-27 20:31:40 +03:00
[render]
2016-11-16 07:26:29 +03:00
aliased = true
2018-02-28 16:23:07 +03:00
accelerated = true
throttle_cpu_usage = true
2018-04-16 16:16:25 +03:00
always_render = true
2016-11-27 20:31:40 +03:00
[theme]
2018-02-28 16:23:07 +03:00
background = 0x002649
foreground = 0xf2f4f6
cursor = 0xf2f4f6
cursor_invert = 0x000000
2016-11-27 20:31:40 +03:00
[cursor]
flash_rate = 400
reset_delay = 400
draw = true
flash = true
2018-02-28 16:23:07 +03:00
[commands]
[commands.save]
shortcut = "super+s"
[commands.delete_line]
shortcut = "super+d"
2016-11-16 07:26:29 +03:00
```
2016-11-14 10:06:25 +03:00
# license
2016-11-27 20:31:40 +03:00
[MIT License](/LICENSE)