Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added chain.save chain.custom to save #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ Remove the first link in the prompt chain.
### `chain.unshift <function>`
Add a _link function_ to the beginning of the prompt chain.

### `chain.save`
Saves the current chain prompt configuration

### `chain.custom`
Sets the chain prompt to your saved configuration

## Customization
Chain uses several global variables to customize the prompt appearance. The most important one is `$chain_links`: a list of function names that print out a single link in the prompt.
Expand Down
7 changes: 7 additions & 0 deletions functions/chain.custom.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function chain.custom -d 'Sets chain to saved custom chain'
set -U chain_links $custom_chain

if test "$_" = chain.custom
chain.compile
end
end
3 changes: 3 additions & 0 deletions functions/chain.save.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
function chain.save -d 'Saves current custom chain'
set -U custom_chain $chain_links
end