Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (43 sloc) 1.44 KB
(require 'open-junk-file)
(defvar my:junk-file-dir "~/junk")
(defvar my:junk-file-format-base (concat my:junk-file-dir "/%Y/%m/%Y%m%d_%H%M%S"))
(setq open-junk-file-format (concat my:junk-file-format-base "."))
(setq open-junk-file-find-file-function 'find-file)
;;; open-junk-dir
(defvar my:open-junk-dir-format (concat my:junk-file-format-base "_"))
(defun my:open-junk-dir ()
(let* ((dir-base (format-time-string my:open-junk-dir-format (current-time)))
(dir (read-string "Dirname: " dir-base)))
(make-directory dir t)
(find-file dir)))
;;; helm-junk-file
;;; REFS:
(require 'em-glob)
(require 'helm)
(defun my:junk-file-list ()
(eshell-extended-glob (concat
(file-name-as-directory my:junk-file-dir)
(defvar my:helm-source-junk-file
'((name . "Junk files")
(candidates . my:junk-file-list)
(type . file)))
(defun my:helm-junk-file ()
(helm :sources '(my:helm-source-junk-file)))
;;; ag-junk-file
(require 'ag)
(defun my:ag-junk-file (query)
(interactive "sSearch string: ")
(ag query my:junk-file-dir))
;;; key bindings
(kbd "C-x j")
(defhydra my:hydra-junk (:exit t)
("f" open-junk-file "file")
("d" my:open-junk-dir "dir")
("l" my:helm-junk-file "list")
("s" my:ag-junk-file "search")))
You can’t perform that action at this time.