f573247a59773f47b1741967335ec6c495bcf4b4
- Author
- Marc Cornellà <marc.cornella@live.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/svn/README.md b/plugins/svn/README.md
2index b8eff70f56b2413a4ba2431572a9a4286737e2f1..1f7b70c865bc002564e7e31c3ae2769aebc2d9fe 100644
3--- a/plugins/svn/README.md
4+++ b/plugins/svn/README.md
5@@ -1,64 +1,67 @@
6 # `svn` plugin
7
8 This plugin adds some utility functions to display additional information regarding your current
9-svn repsitiory. See http://subversion.apache.org/ for the full svn documentation.
10+svn repository. See http://subversion.apache.org/ for the full svn documentation.
11+
12+To use it, add `svn` to your plugins array:
13+
14+```zsh
15+plugins=(... svn)
16+```
17
18 ## Functions
19
20-| Command | Description |
21-|:-----------------------|:----------------------------------------|
22-|svn_prompt_info | prompt for some themes |
23-|in_svn | within svn directory |
24-|svn_get_repo_name | |
25-|svn_get_branch_name | branch name (see caveats) |
26-|svn_get_rev_nr | revision number |
27-|svn_dirty | changes in this subversion repo |
28+| Command | Description |
29+|:----------------------|:--------------------------------------------|
30+| `svn_prompt_info` | Shows svn prompt in themes |
31+| `in_svn` | Checks if we're in an svn repository |
32+| `svn_get_repo_name` | Get repository name |
33+| `svn_get_branch_name` | Get branch name (see [caveats](#caveats)) |
34+| `svn_get_rev_nr` | Get revision number |
35+| `svn_dirty` | Checks if there are changes in the svn repo |
36
37 ## Caveats
38
39-The plugin expects the first directory to be the current branch / tag / trunk. So, it returns
40+The plugin expects the first directory to be the current branch / tag / trunk. So it returns
41 the first path element if you don't use branches.
42
43-## Usage
44+## Usage on themes
45
46-To use it, add `svn` to your plugins array:
47-```sh
48-plugins=(... svn)
49-```
50+To use this in the `agnoster` theme follow these instructions:
51
52-### Agnoster theme git-like prompt
53+1. Enable the svn plugin
54
55-Enable the svn plugin and add the followind lines to your ```~/.zshrc```
56+2. Add the following lines to your `zshrc` file:
57
58-```shell
59-prompt_svn() {
60- local rev branch
61- if in_svn; then
62- rev=$(svn_get_rev_nr)
63- branch=$(svn_get_branch_name)
64- if [ `svn_dirty_choose_pwd 1 0` -eq 1 ]; then
65- prompt_segment yellow black
66- echo -n "$rev@$branch"
67- echo -n "±"
68- else
69- prompt_segment green black
70- echo -n "$rev@$branch"
71+ ```shell
72+ prompt_svn() {
73+ local rev branch
74+ if in_svn; then
75+ rev=$(svn_get_rev_nr)
76+ branch=$(svn_get_branch_name)
77+ if [[ $(svn_dirty_choose_pwd 1 0) -eq 1 ]]; then
78+ prompt_segment yellow black
79+ echo -n "$rev@$branch"
80+ echo -n "±"
81+ else
82+ prompt_segment green black
83+ echo -n "$rev@$branch"
84+ fi
85 fi
86- fi
87-}
88-```
89+ }
90+ ```
91
92-override the agnoster build_prompt() function:
93+3. Override the agnoster `build_prompt()` function:
94
95-```shell
96-build_prompt() {
97- RETVAL=$?
98- prompt_status
99- prompt_context
100- prompt_dir
101- prompt_git
102- prompt_svn
103- prompt_end
104-}