[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find
From: |
Oleh Krehel |
Subject: |
[elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find-file-map |
Date: |
Mon, 25 Apr 2016 10:13:15 +0000 |
branch: master
commit 66e00eda6cf0d89280194bd5017392b0fa9b1fd7
Author: justbur <address@hidden>
Commit: Oleh Krehel <address@hidden>
counsel: Add counsel-up-directory to find-file-map
New function that moves up to the parent directory and at the same time
preselects the current directory. This is useful for moving up and down
a file tree quickly.
Fixes #343
---
counsel.el | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/counsel.el b/counsel.el
index 4a734d4..6a97b70 100644
--- a/counsel.el
+++ b/counsel.el
@@ -457,7 +457,20 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(declare-function ffap-guesser "ffap")
-(defvar counsel-find-file-map (make-sparse-keymap))
+(defvar counsel-find-file-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "C-DEL") 'counsel-up-directory)
+ (define-key map (kbd "C-<backspace>") 'counsel-up-directory)
+ map))
+
+(defun counsel-up-directory ()
+ "Go to the parent directory preselecting the current one."
+ (interactive)
+ (let ((dir-file-name
+ (directory-file-name (expand-file-name ivy--directory))))
+ (ivy--cd (file-name-directory dir-file-name))
+ (setf (ivy-state-preselect ivy-last)
+ (file-name-as-directory (file-name-nondirectory dir-file-name)))))
;;;###autoload
(defun counsel-find-file (&optional initial-input)
- [elpa] master 2135752 040/272: counsel.el (counsel--async-filter): Fix up, (continued)
- [elpa] master 2135752 040/272: counsel.el (counsel--async-filter): Fix up, Oleh Krehel, 2016/04/25
- [elpa] master 426cfcb 028/272: ivy.el (ivy-completion-in-region): Fix a few bugs, Oleh Krehel, 2016/04/25
- [elpa] master a526e86 041/272: Refactor swiper-font-lock-ensure, Oleh Krehel, 2016/04/25
- [elpa] master 0d410d3 047/272: ivy.el (ivy-flx-limit): Configure when flx is used, Oleh Krehel, 2016/04/25
- [elpa] master c210bf6 050/272: counsel.el (counsel-tmm): Fix tmm free variable, Oleh Krehel, 2016/04/25
- [elpa] master bcb81dd 049/272: Fix swiper "backward" search, Oleh Krehel, 2016/04/25
- [elpa] master a1e0063 018/272: ivy.el (ivy--reset-state): Don't null initial-input, Oleh Krehel, 2016/04/25
- [elpa] master fdb21f6 033/272: counsel.el (counsel--async-sentinel): Re-display when no cands, Oleh Krehel, 2016/04/25
- [elpa] master 1365b2b 031/272: Change tramp prompt from "Find File: " to "address@hidden: ", Oleh Krehel, 2016/04/25
- [elpa] master d1216eb 036/272: Add the '!' behavior into `ivy--regex-ignore-order', Oleh Krehel, 2016/04/25
- [elpa] master 66e00ed 034/272: counsel: Add counsel-up-directory to find-file-map,
Oleh Krehel <=
- [elpa] master e23c175 039/272: Insert intermediate candidates during async completions, Oleh Krehel, 2016/04/25
- [elpa] master bc4d4a8 043/272: swiper.el (swiper-font-lock-exclude): Add sauron-mode, Oleh Krehel, 2016/04/25
- [elpa] master 93d1adc 026/272: Properly support matching ignoring order, Oleh Krehel, 2016/04/25
- [elpa] master 9a6b5fd 042/272: Add rcirc-mode to swiper-font-lock-ensure-exclude, Oleh Krehel, 2016/04/25
- [elpa] master ec7da3f 075/272: ivy.el (ivy-help-file): Improve location, Oleh Krehel, 2016/04/25
- [elpa] master c76c005 045/272: Add feedback for sole ivy completion., Oleh Krehel, 2016/04/25
- [elpa] master 59c5f16 044/272: Special case empty ivy-count-format completion., Oleh Krehel, 2016/04/25
- [elpa] master 569c11e 017/272: ivy.el (ivy-completion-in-region): Use compact ivy-count-format, Oleh Krehel, 2016/04/25
- [elpa] master d996215 038/272: Add counsel-descbinds, Oleh Krehel, 2016/04/25
- [elpa] master 9ef344d 062/272: use imenu API to jump to position. required by org-mode, Oleh Krehel, 2016/04/25