Updated speeddating plugin.
[profile.git] / .vim / doc / undotree.txt
1 *undotree.txt*  Display your undo history in a graph
2
3 Author:         Ming Bai <mbbill AT gmail DOT COM>
4 Licence:        BSD
5 Homepage:       https://github.com/mbbill/undotree/
6 Version:        4.3
7
8 ==============================================================================
9 CONTENTS                                                   *undotree-contents*
10
11     1. Intro ................................ |undotree-intro|
12     2. Usage ................................ |undotree-usage|
13     3. Configuration ........................ |undotree-config|
14         3.1  undotree_WindowLayout .......... |undotree_WindowLayout|
15         3.2  undotree_SplitWidth ............ |undotree_SplitWidth|
16         3.3  undotree_DiffpanelHeight ....... |undotree_DiffpanelHeight|
17         3.4  undotree_DiffAutoOpen .......... |undotree_DiffAutoOpen|
18         3.5  undotree_SetFocusWhenToggle .... |undotree_SetFocusWhenToggle|
19         3.6  undotree_TreeNodeShape ......... |undotree_TreeNodeShape|
20         3.7  undotree_DiffCommand ........... |undotree_DiffCommand|
21         3.8  undotree_RelativeTimestamp ..... |undotree_RelativeTimestamp|
22         3.9  undotree_HighlightChangedText .. |undotree_HighlightChangedText|
23         3.10 undotree_HighlightSyntaxAdd .... |undotree_HighlightSyntaxAdd|
24              undotree_HighlightSyntaxChange . |undotree_HighlightSyntaxChange|
25         3.11 Undotree_CustomMap ............. |Undotree_CustomMap|
26     4. Bugs ................................. |undotree-bugs|
27     5. Changelog ............................ |undotree-changelog|
28     6. License .............................. |undotree-license|
29
30 ==============================================================================
31 1. Intro                                                      *undotree-intro*
32
33 Vim 7.0 added a new feature named Undo branches. Basically it's a kind of
34 ability to go back to the text after any change, even if they were undone. Vim
35 stores undo history in a tree which you can browse and manipulate through a
36 bunch of commands. But that was not enough straightforward and a bit hard to
37 use. You may use :help |new-undo-branches| or :help |undo-tree| to get more
38 detailed help. Now this plug-in will free you from those commands and bring
39 back the power of undo tree.
40
41 ==============================================================================
42 2. Usage                                                      *undotree-usage*
43
44 Use :UndotreeToggle to toggle the undo-tree panel. You may want to map this
45 command to whatever hotkey by adding the following line to your vimrc, take F5
46 for example.
47 >
48     nnoremap <F5> :UndotreeToggle<cr>
49 <
50 Then you can try to do some modification, and the undo tree will automatically
51 updated afterwards.
52
53 There are some hotkeys provided by vim to switch between the changes in
54 history, like |u|, |<c-r>|, |g+|, |g-| as well as the |:earlier| and |:later|
55 commands.
56
57 You may also switch to undotree panel and use the hotkeys to switch between
58 history versions. Press ? in undotree window for quick help of hotkeys.
59
60 You can monitor the changed text in diff panel which is automatically updated
61 when undo/redo happens.
62
63 Persistent undo.
64 It is highly recommend to enable the persistent undo. If you don't like your
65 working directory be messed up with the undo file everywhere, you may add the
66 following line to your vimrc in order to make them stored together.
67 >
68     if has("persistent_undo")
69         set undodir='~/.undodir/'
70         set undofile
71     endif
72 <
73 ==============================================================================
74 3. Configuration                                             *undotree-config*
75
76 ------------------------------------------------------------------------------
77 3.1 g:undotree_WindowLayout                            *undotree_WindowLayout*
78
79 Set the undotree window layout.
80
81 Style 1
82 >
83     +----------+------------------------+
84     |          |                        |
85     |          |                        |
86     | undotree |                        |
87     |          |                        |
88     |          |                        |
89     +----------+                        |
90     |          |                        |
91     |   diff   |                        |
92     |          |                        |
93     +----------+------------------------+
94 <
95 Style 2
96 >
97     +----------+------------------------+
98     |          |                        |
99     |          |                        |
100     | undotree |                        |
101     |          |                        |
102     |          |                        |
103     +----------+------------------------+
104     |                                   |
105     |   diff                            |
106     |                                   |
107     +-----------------------------------+
108 <
109 Style 3
110 >
111     +------------------------+----------+
112     |                        |          |
113     |                        |          |
114     |                        | undotree |
115     |                        |          |
116     |                        |          |
117     |                        +----------+
118     |                        |          |
119     |                        |   diff   |
120     |                        |          |
121     +------------------------+----------+
122 <
123 Style 4
124 >
125     +------------------------+----------+
126     |                        |          |
127     |                        |          |
128     |                        | undotree |
129     |                        |          |
130     |                        |          |
131     +------------------------+----------+
132     |                                   |
133     |                            diff   |
134     |                                   |
135     +-----------------------------------+
136 <
137 Default: 1
138
139 ------------------------------------------------------------------------------
140 3.2 g:undotree_SplitWidth                                *undotree_SplitWidth*
141
142 Set the undotree window width.
143
144 Default: 30
145
146 ------------------------------------------------------------------------------
147 3.3 g:undotree_DiffpanelHeight                      *undotree_DiffpanelHeight*
148
149 Set the diff window height.
150
151 Default: 10
152
153 ------------------------------------------------------------------------------
154 3.4 g:undotree_DiffAutoOpen                            *undotree_DiffAutoOpen*
155
156 Set this to 1 to auto open the diff window.
157
158 Default: 1
159
160 ------------------------------------------------------------------------------
161 3.5 g:undotree_SetFocusWhenToggle                *undotree_SetFocusWhenToggle*
162
163 If set to 1, the undotree window will get focus after being opened, otherwise
164 focus will stay in current window.
165
166 Default: 0
167
168 ------------------------------------------------------------------------------
169 3.6 g:undotree_TreeNodeShape                          *undotree_TreeNodeShape*
170
171 Set the tree node shape.
172
173 Default: '*'
174
175 ------------------------------------------------------------------------------
176 3.7 g:undotree_DiffCommand                              *undotree_DiffCommand*
177
178 Set the command used to get the diff output.
179
180 Default: "diff"
181
182 ------------------------------------------------------------------------------
183 3.8 g:undotree_RelativeTimestamp                  *undotree_RelativeTimestamp*
184
185 Set to 1 to use relative timestamp.
186
187 Default: 1
188
189 ------------------------------------------------------------------------------
190 3.9 g:undotree_HighlightChangedText            *undotree_HighlightChangedText*
191
192 Set to 1 to highlight the changed text.
193
194 Default: 1
195
196 ------------------------------------------------------------------------------
197 3.10 g:undotree_HighlightSyntaxAdd               *undotree_HighlightSyntaxAdd*
198      g:undotree_HighlightSyntaxChange         *undotree_HighlightSyntaxChange*
199
200 Set the highlight linked syntax type.
201 You may chose your favorite through ":hi" command.
202
203 Default: "DiffAdd" and "DiffChange"
204
205 ------------------------------------------------------------------------------
206 3.11 g:Undotree_CustomMap                                  *Undotree_CustomMap*
207
208 There are two ways of changing the default key mappings:
209 The first way is to define global mappings as the following example:
210 >
211     nmap <buffer> J <plug>UndotreeGoNextState
212     nmap <buffer> K <plug>UndotreeGoPreviousState
213 <
214 A better approach is to define the callback function g:Undotree_CustomMap().
215 The function will be called after the undotree windows is initialized, so the
216 key mappings only works on the undotree windows.
217 >
218     function g:Undotree_CustomMap()
219         nmap <buffer> J <plug>UndotreeGoNextState
220         nmap <buffer> K <plug>UndotreeGoPreviousState
221     endfunc
222 <
223 List of the commands available for redefinition.
224 >
225     <plug>UndotreeHelp
226     <plug>UndotreeClose
227     <plug>UndotreeFocusTarget
228     <plug>UndotreeClearHistory
229     <plug>UndotreeTimestampToggle
230     <plug>UndotreeDiffToggle
231     <plug>UndotreeGoNextState
232     <plug>UndotreeGoPreviousState
233     <plug>UndotreeGoNextSaved
234     <plug>UndotreeGoPreviousSaved
235     <plug>UndotreeRedo
236     <plug>UndotreeUndo
237     <plug>UndotreeEnter
238     <plug>UndotreeEnter
239 <
240 ==============================================================================
241 4. Bugs                                                        *undotree-bugs*
242
243 Post any issue and feature request here:
244 https://github.com/mbbill/undotree/issues
245
246 ==============================================================================
247 5. Changelog                                              *undotree-changelog*
248
249 4.3 (2013-02-18)
250     - Several fixes and enhancements.
251
252 4.2 (2012-11-24)
253     - Fixed some small issue.
254
255 4.1 (2012-09-05)
256     - Enhanced tree style.
257     - Multi-window switching support.
258
259 4.0 (2012-08-30)
260     - Live updated highlight for changed text.
261     - Customizable key mappings.
262     - Fixed some minor bugs.
263
264 3.1 (2012-08-25)
265     - Add saved status.
266     - Add relative timestamp.
267     - Add ability of clear undo history.
268
269 3.0 (2012-08-24)
270     - Add diff panel.
271     - Performance improvement.
272
273 2.2 (2012-08-21)
274     - Stable version.
275
276 2.1 (2012-08-20)
277     - Fixed some annoying issues.
278
279 2.0 (2012-08-19)
280     - Hotkey support.
281     - Handle undo levels.
282     - Auto refresh.
283     - And so on.
284
285 1.0 (2012-08-18)
286     - Initial upload
287
288 ==============================================================================
289 6. License                                                  *undotree-license*
290
291 BSD