-
Notifications
You must be signed in to change notification settings - Fork 293
Home
arvidj edited this page Feb 3, 2020
·
1 revision
Welcome to the bashmarks wiki!
(defun bashmarks-alist ()
""
(interactive)
(let ((str (string-trim-right (shell-command-to-string (concat "source ~/.sdirs && env | grep ^DIR_")))))
(mapcar (lambda (s)
(let* ((spl (split-string s "=" ))
(mark (cadr (split-string (car spl) "DIR_" )))
(dir (cadr spl)))
`(,mark . ,dir)
))
(split-string str "\n" ))))
(defun setup-bashmarks ()
""
(interactive)
(cl-loop for (mark . dir) in (bashmarks-alist)
do (global-set-key (kbd (concat "C-c g " mark))
`(lambda () (interactive)
(let ((default-directory ,dir)) (ido-find-file))
))))
(setup-bashmarks)
(provide 'bashmarks)