[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b3ca5e3 119/348: Add counsel commands for jumping to files
From: |
Oleh Krehel |
Subject: |
[elpa] master b3ca5e3 119/348: Add counsel commands for jumping to files |
Date: |
Sat, 8 Apr 2017 11:03:39 -0400 (EDT) |
branch: master
commit b3ca5e3a242a4300a84fdffa8364eb5aa754936d
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Add counsel commands for jumping to files
* counsel.el (counsel-file-jump): New command to jump to file in
any sub directory
* counsel.el (counsel-dired-jump): New command to jump to any sub
directory
---
counsel.el | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/counsel.el b/counsel.el
index 9a1344e..4210549 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1440,6 +1440,52 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
:unwind #'counsel-delete-process
:caller 'counsel-locate))
+;;** File Jump and Dired Jump
+
+;;;###autoload
+(defun counsel-file-jump (&optional initial-input initial-directory)
+ "Jump to a file from a list of all files directories
+below the current one. INITIAL-INPUT can be given as the initial
+minibuffer input. INITIAL-DIRECTORY, if non-nil, is used as the
+root directory for search."
+ (interactive
+ (list nil
+ (when current-prefix-arg
+ (read-directory-name "From directory: "))))
+ (let* ((default-directory (or initial-directory default-directory)))
+ (ivy-read "Find file: "
+ (split-string (shell-command-to-string "find * -type f"))
+ :matcher #'counsel--find-file-matcher
+ :initial-input initial-input
+ :action (lambda (x)
+ (with-ivy-window
+ (find-file (expand-file-name x ivy--directory))))
+ :preselect (when counsel-find-file-at-point
+ (require 'ffap)
+ (let ((f (ffap-guesser)))
+ (when f (expand-file-name f))))
+ :require-match 'confirm-after-completion
+ :history 'file-name-history
+ :keymap counsel-find-file-map
+ :caller 'counsel-file-jump)))
+
+;;;###autoload
+(defun counsel-dired-jump (&optional initial-input initial-directory)
+ "Jump to a directory (in dired) from a list of all directories
+below the current one. INITIAL-INPUT can be given as the initial
+minibuffer input. INITIAL-DIRECTORY, if non-nil, is used as the
+root directory for search."
+ (interactive
+ (list nil
+ (when current-prefix-arg
+ (read-directory-name "From directory: "))))
+ (let* ((default-directory (or initial-directory default-directory)))
+ (ivy-read "Directory: "
+ (split-string (shell-command-to-string "find * -type d"))
+ :initial-input initial-input
+ :action #'dired-jump
+ :caller 'counsel-dired-jump)))
+
;;* Grep
;;** `counsel-ag'
(defvar counsel-ag-map
- [elpa] master 06d5cf5 078/348: counsel.el (counsel-rhythmbox): Require dbus, (continued)
- [elpa] master 06d5cf5 078/348: counsel.el (counsel-rhythmbox): Require dbus, Oleh Krehel, 2017/04/08
- [elpa] master 469a4ab 081/348: Add ivy-push-view and ivy-pop-view, Oleh Krehel, 2017/04/08
- [elpa] master c009b28 080/348: ivy.el: Breaking change for alist type collection actions, Oleh Krehel, 2017/04/08
- [elpa] master 8df5a67 089/348: counsel.el (counsel-semantic): New command, Oleh Krehel, 2017/04/08
- [elpa] master af5d2c1 097/348: Don't crash if default-directory is nil., Oleh Krehel, 2017/04/08
- [elpa] master 874632e 098/348: Name bookmarked directories using the bookmark name, Oleh Krehel, 2017/04/08
- [elpa] master 9e6bf2d 112/348: Makefile (plain): Fix target, Oleh Krehel, 2017/04/08
- [elpa] master c43de47 120/348: counsel.el (counsel-dired-jump): Fix up, Oleh Krehel, 2017/04/08
- [elpa] master 5fe3cef 122/348: counsel.el (counsel-file-jump): Allow spaces in path, Oleh Krehel, 2017/04/08
- [elpa] master f27a1f0 124/348: swiper.el (swiper-all-function): Add a ">0 cands -> 0 cands" fix, Oleh Krehel, 2017/04/08
- [elpa] master b3ca5e3 119/348: Add counsel commands for jumping to files,
Oleh Krehel <=
- [elpa] master 46a5346 121/348: counsel.el (counsel-file-jump): Skip ".git/", Oleh Krehel, 2017/04/08
- [elpa] master 3c20b2c 126/348: counsel.el (counsel-git-grep): Fix prompt, Oleh Krehel, 2017/04/08
- [elpa] master fe92b1b 133/348: ivy.el: Fix the "C-m" not working for last commit, Oleh Krehel, 2017/04/08
- [elpa] master 230ae1a 132/348: Implement unique index for alist completion, Oleh Krehel, 2017/04/08
- [elpa] master 413bf7f 135/348: ivy.el: Prevent region expanding to prompt, Oleh Krehel, 2017/04/08
- [elpa] master b49ed2f 140/348: ivy.el (ivy--reset-state): Add stringp preselect guard, Oleh Krehel, 2017/04/08
- [elpa] master a2ed614 138/348: ivy.el (ivy-occur-mode-map): Make "RET" switch window, Oleh Krehel, 2017/04/08
- [elpa] master 80db2cc 142/348: ivy-test.el (ivy-read-preselect): New test, Oleh Krehel, 2017/04/08
- [elpa] master 61c2b12 125/348: counsel-git-grep now supports custom per-project commands, Oleh Krehel, 2017/04/08
- [elpa] master 434ccce 150/348: swiper.el (swiper-font-lock-exclude): Add bookmark-bmenu-mode, Oleh Krehel, 2017/04/08