]> code.delx.au - gnu-emacs-elpa/blob - packages/ztree/README.md
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / ztree / README.md
1 # ztree
2 Ztree is a project dedicated to implementation of several text-tree applications inside [GNU Emacs](http://www.gnu.org/software/emacs/). It consists of 2 subprojects: **ztree-diff** and **ztree-dir** (the basis of **ztree-diff**). Available in [GNU ELPA](https://elpa.gnu.org/) and [MELPA](http://melpa.org/#/).
3
4 ## Installation
5
6 ### Using ELPA
7 Press `M-x` in GNU Emacs and write `list-packages`. Find the `ztree` in the list of packages and press `i` to select this package, `x` to install the package.
8
9 ### Using MELPA
10 Add to your `.emacs` or `.emacs.d/init.el` following lines:
11
12 ```scheme
13 (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
14 ("melpa" . "http://melpa.milkbox.net/packages/")))
15 ```
16
17 Follow the installation instructions for the GNU ELPA above.
18
19 ### Manual
20 Add the following to your .emacs file:
21
22 ```scheme
23 (push (substitute-in-file-name "path-to-ztree-directory") load-path)
24 (require 'ztree)
25 ```
26
27 ## ztree-diff
28 **ztree-diff** is a directory-diff tool for Emacs inspired by commercial tools like Beyond Compare or Araxis Merge. It supports showing the difference between two directories; calling **Ediff** for not matching files, copying between directories, deleting file/directories, hiding/showing equal files/directories.
29
30 The comparison itself performed with the external **GNU diff** tool, so make sure to have one in the executable path. Verified on OSX and Linux.
31
32 If one wants to have a stand-alone application, consider the (WIP)[zdircmp](https://github.com/fourier/zdircmp) project based on **ztree-diff**.
33
34 Call the `ztree-diff` interactive function:
35
36 ```
37 M-x ztree-diff
38 ```
39 Then you need to specify the left and right directories to compare.
40
41 ### Hotkeys supported
42 * Open/close directories with double-click, `RET` or `Space` keys.
43 * To jump to the parent directory, hit the `Backspace` key.
44 * To toggle open/closed state of the subtree of the current directory, hit the `x` key.
45 * `RET` on different files starts the **Ediff** (or open file if one absent or the same)
46 * `Space` show the simple diff window for the current file instead of **Ediff** (or view file if one absent or the same)
47 * `TAB` to fast switch between panels
48 * `h` key to toggle show/hide identical files/directories
49 * `H` key to toggle show/hide hidden/ignored files/directories
50 * `C` key to copy current file or directory to the left or right panel
51 * `D` key to delete current file or directory
52 * `v` key to quick view the current file
53 * `r` initiates the rescan/refresh of current file or subdirectory
54 * `F5` forces the full rescan.
55
56 ### Customizations
57 By default all files starting with dot (like `.gitignore`) are not shown and excluded from the difference status for directories. One can add an additional regexps to the list `ztree-diff-filter-list`.
58
59 One also could turn on unicode characters to draw the tree with instead of normal ASCII-characters. This is controlled by the `ztree-draw-unicode-lines` variable.
60
61 ### Screenshots
62
63 ![ztreediff emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_diff_xterm.png "Emacs in xterm with ztree-diff")
64
65 ![ztreediff-diff emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_diff_simplediff_xterm.png "Emacs in xterm with ztree-diff and simple diff")
66
67 ## ztree-dir
68
69 **ztree-dir** is a simple text-mode directory tree for Emacs. See screenshots below for the GUI and the terminal versions of the **ztree-dir**.
70
71 Call the `ztree-dir` interactive function:
72
73 ```
74 M-x ztree-dir
75 ```
76
77 ### Hotkeys supported
78 * Open/close directories with double-click, `RET` or `Space` keys.
79 * To jump to the parent directory, hit the `Backspace` key.
80 * To toggle open/closed state of the subtree of the current directory, hit the `x` key.
81 * To visit a file, press `Space` key.
82 * To open file in other window, use `RET` key.
83
84 ### Customizations
85 Set the `ztree-dir-move-focus` variable to `t` in order to move focus to the other window when the `RET` key is pressed; the default behavior is to keep focus in `ztree-dir` window.
86
87
88 ![ztree emacsapp](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_app.png "Emacs App with ztree-dir")
89
90 ![ztree emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_xterm.png "Emacs in xterm with ztree-dir")
91
92
93 ## Contributions
94 You can contribute to **ztree** in one of the following ways.
95 - Submit a bug report
96 - Submit a feature request
97 - Submit a simple pull request (with changes < 15 lines)
98
99 ### Copyright issues
100 Since **ztree** is a part of [GNU ELPA](https://elpa.gnu.org/), it is copyrighted by the [Free Software Foundation, Inc.](http://www.fsf.org/). Therefore in order to submit nontrivial changes (with total amount of lines > 15), one needs to to grant the right to include your works in GNU Emacs to the FSF.
101
102 For this you need to complete [this](https://raw.githubusercontent.com/fourier/ztree/contributions/request-assign.txt) form, and send it to [assign@gnu.org](mailto:assign@gnu.org). The FSF will send you the assignment contract that both you and the FSF will sign.
103
104 For more information one can read [here](http://www.gnu.org/licenses/why-assign.html) to understand why it is needed.
105
106 As soon as the paperwork is done one can contribute to **ztree** with bigger pull requests.
107 Note what pull requests without paperwork done will not be accepted, so please notify the [maintainer](mailto:alexey.veretennikov@gmail.com) if everything is in place.
108