-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,66 @@ | ||
PowerLine: Customizable bash prompt | ||
=================================== | ||
|
||
PHPl: The Ultimate PHP Powerline | ||
================================ | ||
|
||
This is a highly customizable powerline prompt generator for PHP. While being 100% | ||
modular, the configuration is processed into a compact ready-to-use cache. Themes | ||
are extremely dynamic, making use of a CSS-like syntax to add styles to panels based | ||
on type, status or class, with 256-color support. And everything can be configured | ||
from the command line. | ||
|
||
## Installing | ||
|
||
To install, copy this directory to `~/.powerline`. Then source the `powerline.sh` script from | ||
your `.bashrc`: | ||
The recommended method of installing is using the installer, or by using the | ||
`install.sh` script after cloning into a temporary directory. If *phpl* is already | ||
installed, it will be updated. | ||
|
||
## Configuration | ||
|
||
The initial prompt will display the directory and a status indicator: | ||
|
||
~ $ | ||
|
||
To edit the prompt, use the `phpl-config` command. To make it a bit more boring: | ||
|
||
$ phpl-config -i username --first --no-reload | ||
$ phpl-config -i text --after username -s text="@" --no-reload | ||
$ phpl-config -i hostname --after text | ||
|
||
The prompt will now look like: | ||
|
||
user @ hostname $ | ||
|
||
$ cp -R src ~/.powerline | ||
$ echo 'source ~/.powerline/powerline.sh' >> ~/.bashrc | ||
## Appearance | ||
|
||
To activate, reopen your console or source your `.bashrc` again: | ||
To make the prompt less fluffy, you can create a compact style. Create `~/.powerline/theme/compact.theme`: | ||
|
||
$ source ~/.bashrc | ||
* { | ||
pad-before: 0; | ||
pad-after: 0; | ||
} | ||
|
||
Activate the theme using `phpl-config`: | ||
|
||
## Editing | ||
$ phpl-config --theme compact | ||
|
||
Add git status in the best position: | ||
To add some color to the prompt: | ||
|
||
$ phpl-config -igit | ||
username hostname { | ||
color: bright-blue; | ||
} | ||
text { | ||
color: white; | ||
} | ||
status:good { | ||
color: green; | ||
} | ||
status:bad { | ||
color: red; | ||
} | ||
|
||
Add git status to beginning of prompt: | ||
This will have the following result: | ||
|
||
$ phpl-config -igit --first | ||
* The `username` and `hostname` parts will be colored bright blue | ||
* All `text` items will be colored white | ||
* The status indicator (`$`) will be colored green if the last command was successful, and | ||
red otherwise. | ||
|
||
Use `-h` for help. |