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/#/).
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.
10 Add to your `.emacs` or `.emacs.d/init.el` following lines:
13 (setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")
14 ("melpa" . "http://melpa.milkbox.net/packages/")))
17 Follow the installation instructions for the GNU ELPA above.
20 Add the following to your .emacs file:
23 (push (substitute-in-file-name "path-to-ztree-directory") load-path)
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.
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.
32 If one wants to have a stand-alone application, consider the (WIP)[zdircmp](https://github.com/fourier/zdircmp) project based on **ztree-diff**.
34 Call the `ztree-diff` interactive function:
39 Then you need to specify the left and right directories to compare.
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.
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`.
61 ![ztreediff emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_diff_xterm.png "Emacs in xterm with ztree-diff")
63 ![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")
67 **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**.
69 Call the `ztree-dir` interactive function:
76 * Open/close directories with double-click, `RET` or `Space` keys.
77 * To jump to the parent directory, hit the `Backspace` key.
78 * To toggle open/closed state of the subtree of the current directory, hit the `x` key.
79 * To visit a file, press `Space` key.
80 * To open file in other window, use `RET` key.
83 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 ![ztree emacsapp](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_app.png "Emacs App with ztree-dir")
88 ![ztree emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_xterm.png "Emacs in xterm with ztree-dir")