]> code.delx.au - gnu-emacs-elpa/blob - packages/ztree/README.md
multishell - still 1.0.6, clarify conditions for tramp homedir bug
[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 ### Screenshots
60
61 ![ztreediff emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_diff_xterm.png "Emacs in xterm with ztree-diff")
62
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")
64
65 ## ztree-dir
66
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**.
68
69 Call the `ztree-dir` interactive function:
70
71 ```
72 M-x ztree-dir
73 ```
74
75 ### Hotkeys supported
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.
81
82 ### Customizations
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.
84
85
86 ![ztree emacsapp](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_app.png "Emacs App with ztree-dir")
87
88 ![ztree emacsx11](https://github.com/fourier/ztree/raw/screenshots/screenshots/emacs_xterm.png "Emacs in xterm with ztree-dir")
89