Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ jobs:
- uses: actions/checkout@v2
- run: sh ./scripts/install.sh
- run: cat /etc/shells
- name: Install Bats (Linux)
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y bats
- name: Install Bats (macOS)
if: runner.os == 'macOS'
run: brew install bats-core
- name: Run unit tests
run: bats tests
- run: source ~/.pms/pms.sh bash 1 && pms help && pms diagnostic && pms about && pms theme list && pms plugin list
- run: sh ~/.pms/scripts/uninstall.sh -n
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,14 @@ really cool shit with git.

* [User Guides](https://docs.codewithjoshua.com/pms)
* [Developer Guides](https://docs.codewithjoshua.com/pms)

# Tests

PMS uses [Bats](https://bats-core.readthedocs.io/) for unit tests. After
installing Bats with your package manager (for example, `sudo apt-get install
bats` or `brew install bats-core`), run all tests with:

```
bats tests
```

5 changes: 4 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
* [Plugins](plugins/README.md)
* [cd](plugins/cd.md)
* [composer](plugins/composer.md)
* [dotfiles](plugins/dotfiles.md)
* [git](plugins/git.md)
* [history](plugins/history.md)
* [phpbrew](plugins/phpbrew.md)
* [vim](plugins/vim.md)
* [\_\_PLUGIN\_\_ Template](plugins/plugin\_templates\_for\_docs.md)
* [zsh](plugins/zsh.md)
* [__PLUGIN__ Template](plugins/plugin_templates_for_docs.md)
* [Themes](themes/README.md)
* [default](themes/default.md)
38 changes: 34 additions & 4 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ title: Environment Variables

# Environment Variables

PMS will search for and load a few different .env files to help you configure how PMS works.
PMS will search for and load a few different .env files to help you
configure how PMS works.

.env files, if they exist, are loaded in the following order:

Expand All @@ -14,9 +15,38 @@ PMS will search for and load a few different .env files to help you configure ho
4. `$HOME/.env.{SHELL}.local`

{% hint style="info" %}
_**{SHELL}**_ will be **zsh**, **bash**, **fish**, etc. depending on the shell you are using. 
_**{SHELL}**_ will be **zsh**, **bash**, **fish**, etc. depending on the
shell you are using. 
{% endhint %}

PMS Loads .env files in this order to allow you different configuration options. These files are where you will overwrite environment variables defined by [plugins](plugins/) to modify behavior.
PMS loads .env files in this order to allow you different configuration
options. These files are where you will overwrite environment variables
defined by [plugins](plugins/) to modify behavior.

<table><thead><tr><th width="223">Environment Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>PMS</code></td><td>Directory where PMS is installed</td></tr><tr><td><code>PMS_LOCAL</code></td><td>Directory where local files are stored</td></tr><tr><td><code>PMS_DEBUG</code></td><td>0 = disabled, 1 = enabled. Enabling debug will produce debug messages</td></tr><tr><td><code>PMS_REPO</code></td><td></td></tr><tr><td><code>PMS_REMOTE</code></td><td></td></tr><tr><td><code>PMS_BRANCH</code></td><td></td></tr><tr><td><code>PMS_THEME</code></td><td></td></tr><tr><td><code>PMS_PLUGINS</code></td><td></td></tr></tbody></table>
| Environment Variable | Description |
| --- | --- |
| `PMS` | Directory where PMS is installed |
| `PMS_LOCAL` | Directory where local files are stored |
| `PMS_DEBUG` | 0 = disabled, 1 = enabled. Enables debug messages when set |
| `PMS_REPO` | GitHub repo for PMS (see [install.sh](../scripts/install.sh)) |
| `PMS_REMOTE` | Full Git remote URL (see [install.sh](../scripts/install.sh)) |
| `PMS_BRANCH` | Branch to check out (see [install.sh](../scripts/install.sh)) |
| `PMS_THEME` | Active theme name (loaded in [lib/core.sh](../lib/core.sh)) |
| `PMS_PLUGINS` | Space-separated plugin list (used by [pms.sh](../pms.sh)) |

## Overriding defaults

To override any default, add the variable to one of the supported `.env`
files. For example:

```sh
# ~/.env.local
PMS_REPO=myfork/pms
PMS_REMOTE=https://git.example.com/${PMS_REPO}.git
PMS_BRANCH=development
PMS_THEME=solarized
PMS_PLUGINS=(git docker)
```

Shell-specific overrides such as `.env.zsh.local` take precedence over
the more general files.
9 changes: 9 additions & 0 deletions docs/installation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@ title: Installation
Installing can be done quick and easy by using curl. The installation process
will not overwrite any files and will backup your current rc files.

Set the `PMS_SHELL` environment variable to target a specific shell. If not
set, the installer uses your current shell.

## Using curl

```sh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/JoshuaEstes/pms/main/scripts/install.sh)"
```

To install for zsh:

```sh
PMS_SHELL=zsh sh -c "$(curl -fsSL https://raw.githubusercontent.com/JoshuaEstes/pms/main/scripts/install.sh)"
```

## Using wget

```sh
Expand Down
26 changes: 26 additions & 0 deletions docs/plugins/dotfiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
title: PMS "dotfiles" Plugin
toc: true
pms_plugin: dotfiles
---

# dotfiles

Manage your dotfiles repository using git.

## Requirements

* git

## Usage

```sh
pms plugin enable dotfiles # enable the plugin
pms dotfiles add ~/.vimrc # track a file
pms dotfiles push # push changes
pms dotfiles git status # run arbitrary git commands
```

## See Also

* [Plugin Source Code](https://github.com/JoshuaEstes/pms/tree/main/plugins/dotfiles)
21 changes: 21 additions & 0 deletions docs/plugins/history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: PMS "history" Plugin
toc: true
toc_sticky: true
---

# history

Provides persistent command history for zsh sessions.

## Environment Variables

| Variable | Default | Description |
| ---------- | ------------------------- | ------------------------------- |
| `HISTFILE` | `$PMS/cache/zsh_history` | Location of the history file |
| `HISTSIZE` | `50000` | Commands kept in memory |
| `SAVEHIST` | `10000` | Commands saved to disk |

## See Also

* [Plugin Source Code](https://github.com/JoshuaEstes/pms/tree/main/plugins/history)
20 changes: 20 additions & 0 deletions docs/plugins/zsh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: PMS "zsh" Plugin
toc: true
toc_sticky: true
---

# zsh

Configures basic zsh shell behavior.

## Environment Variables

| Variable | Default | Description |
| -------------- | ------- | --------------------------------------------- |
| `DIRSTACKSIZE` | `10` | Maximum size of the directory stack |
| `KEYTIMEOUT` | `1` | Key binding timeout in tenths of a second |

## See Also

* [Plugin Source Code](https://github.com/JoshuaEstes/pms/tree/main/plugins/zsh)
14 changes: 12 additions & 2 deletions docs/pms-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The PMS Manager is what you will use most of the time when you want to interact

You can run `pms help` at any time to get information on all the commands the PMS Manager supports.

## Getting Help

Use `pms help` to list available commands. For detailed help on a specific command or subcommand, run:

```shell
pms help plugin
pms help plugin enable
pms help theme switch
```

## Managing Plugins

Plugins modify shell behaviour such as loading auto-completion scripts, adding aliases, or modifying shell options. Plugins are managed using the `pms plugin` command.
Expand All @@ -32,7 +42,7 @@ pms plugin disable [PLUGIN]

## Managing Themes

Themes will modify how you shell looks. These are things such as colors and usually includes a kick ass command prompt.
Themes modify how your shell looks. These are things such as colors and usually include a kick ass command prompt.

_**Note**_ Some themes may enable or disable PMS plugins for functionality. An example of this would be a theme that would require the "git-prompt" plugin so it has access to that functionality. This is done for you so you don't need to do this by hand {: .notice--warning}

Expand Down Expand Up @@ -84,7 +94,7 @@ git --git-dir=$HOME/.dotfiles --work-tree=$HOME -C $HOME checkout
git --git-dir=$HOME/.dotfiles --work-tree=$HOME -C $HOME config --local status.showUntrackedFiles no
```

_**NOTE**_: You may run into issues when you run "git checkout". You will need to resolve those before you con make sure that everything is setup correctly.
_**NOTE**_: You may run into issues when you run "git checkout". You will need to resolve those before you can make sure that everything is set up correctly.

### Adding files

Expand Down
Loading