fourier / ztree

Directory tree comparison mode for Emacs
http://www.emacswiki.org/emacs/ZtreeDiff
GNU General Public License v3.0
239 stars 21 forks source link

Feature request: ztreedir functions to narrow to a directory and explore parent #42

Closed talwrii closed 7 years ago

talwrii commented 7 years ago

I found myself immediately wanting this functionality, so I wrote it:

(defun ztreedir-explore-node ()
  (interactive)
  (ztree-dir (ztree-find-node-in-line (line-number-at-pos))))

(defun ztreedir-explore-parent ()
  (interactive)
  (ztree-dir (directory-file-name (file-name-directory ztree-start-node))))

I imagine one might also want a go back command as well as keybindings for them (I use evil so these aren't relevant to me)

fourier commented 7 years ago

Hi,

I've added proper implementation of this functionality. Now you can narrow to the current directory under cursor (or the parent if it is the file under the cursor) using '>' hotkey. You can use '<' hotkey to explore parent directory. All this happens in the same buffer.

talwrii commented 7 years ago

Awesome, thanks.