summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ferbar <christian.ferbar@gmx.net>2016-09-27 12:27:37 +0200
committerMarc CornellĂ  <marc.cornella@live.com>2016-09-29 13:56:35 +0200
commit10ffa4fe992e56a93396ed8914eba74821bb2cca (patch)
tree8183e74986f4199c06afb899daacbdc42486d03c
parentac8915d43f0e8de9294c8552dc338ecc9993acd2 (diff)
downloadzsh-10ffa4fe992e56a93396ed8914eba74821bb2cca.tar.gz
zsh-10ffa4fe992e56a93396ed8914eba74821bb2cca.tar.bz2
zsh-10ffa4fe992e56a93396ed8914eba74821bb2cca.zip
Add README to svn plugin
-rw-r--r--plugins/svn/README.md64
1 files changed, 64 insertions, 0 deletions
diff --git a/plugins/svn/README.md b/plugins/svn/README.md
new file mode 100644
index 000000000..b8eff70f5
--- /dev/null
+++ b/plugins/svn/README.md
@@ -0,0 +1,64 @@
+# `svn` plugin
+
+This plugin adds some utility functions to display additional information regarding your current
+svn repsitiory. See http://subversion.apache.org/ for the full svn documentation.
+
+## Functions
+
+| Command | Description |
+|:-----------------------|:----------------------------------------|
+|svn_prompt_info | prompt for some themes |
+|in_svn | within svn directory |
+|svn_get_repo_name | |
+|svn_get_branch_name | branch name (see caveats) |
+|svn_get_rev_nr | revision number |
+|svn_dirty | changes in this subversion repo |
+
+## Caveats
+
+The plugin expects the first directory to be the current branch / tag / trunk. So, it returns
+the first path element if you don't use branches.
+
+## Usage
+
+To use it, add `svn` to your plugins array:
+```sh
+plugins=(... svn)
+```
+
+### Agnoster theme git-like prompt
+
+Enable the svn plugin and add the followind lines to your ```~/.zshrc```
+
+```shell
+prompt_svn() {
+ local rev branch
+ if in_svn; then
+ rev=$(svn_get_rev_nr)
+ branch=$(svn_get_branch_name)
+ if [ `svn_dirty_choose_pwd 1 0` -eq 1 ]; then
+ prompt_segment yellow black
+ echo -n "$rev@$branch"
+ echo -n "±"
+ else
+ prompt_segment green black
+ echo -n "$rev@$branch"
+ fi
+ fi
+}
+```
+
+override the agnoster build_prompt() function:
+
+```shell
+build_prompt() {
+ RETVAL=$?
+ prompt_status
+ prompt_context
+ prompt_dir
+ prompt_git
+ prompt_svn
+ prompt_end
+}
+```
+