This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; ** Hydras | |
;;; *** context launcher for hydras | |
(defun dfeich/context-hydra-launcher () | |
"A launcher for hydras based on the current context." | |
(interactive) | |
(cl-case major-mode | |
('org-mode (let* ((elem (org-element-context)) | |
(etype (car elem)) | |
(type (org-element-property :type elem))) | |
(cl-case etype |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dfeich/ansi-terminal (&optional path name) | |
"Opens an ansi terminal at PATH. If no PATH is given, it uses | |
the value of `default-directory'. PATH may be a tramp remote path. | |
The ansi-term buffer is named based on `name' " | |
(interactive) | |
(unless path (setq path default-directory)) | |
(unless name (setq name "ansi-term")) | |
(ansi-term "/bin/bash" name) | |
(let ((path (replace-regexp-in-string "^file:" "" path)) | |
(cd-str |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun dfeich/gnome-terminal (&optional path) | |
"Opens a gnome terminal at PATH. If no PATH is given, it uses | |
the value of `default-directory'. PATH may be a tramp remote path." | |
(interactive) | |
(unless path (setq path default-directory)) | |
(if (tramp-tramp-file-p path) | |
(let ((tstruct (tramp-dissect-file-name path))) | |
(cond | |
((equal (tramp-file-name-method tstruct) "ssh") | |
(call-process "/usr/bin/gnome-terminal" nil nil nil |