summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/eos/jao-buffers.el21
-rw-r--r--lib/eos/jao-shell.el2
2 files changed, 22 insertions, 1 deletions
diff --git a/lib/eos/jao-buffers.el b/lib/eos/jao-buffers.el
index 800b264..5665117 100644
--- a/lib/eos/jao-buffers.el
+++ b/lib/eos/jao-buffers.el
@@ -21,7 +21,28 @@
;;; deps
(require 'eldoc)
+(require 'dired)
+;;; copy buffer file name
+;; https://stackoverflow.com/questions/18812938/copy-full-file-path-into-copy-paste-clipboard
+;;;###autoload
+(defun copy-buffer-file-name-as-kill (choice)
+ "Copy the buffer-file-name to the kill-ring"
+ (interactive "cCopy buffer name: (f)ull, (d)irectory, (n)ame")
+ (let ((new-kill-string)
+ (name (if (eq major-mode 'dired-mode)
+ (dired-get-filename)
+ (or (buffer-file-name) ""))))
+ (cond ((eq choice ?f)
+ (setq new-kill-string name))
+ ((eq choice ?d)
+ (setq new-kill-string (file-name-directory name)))
+ ((eq choice ?n)
+ (setq new-kill-string (file-name-nondirectory name)))
+ (t (message "Quit")))
+ (when new-kill-string
+ (message "%s copied" new-kill-string)
+ (kill-new new-kill-string))))
;;; lines
;;;###autoload
diff --git a/lib/eos/jao-shell.el b/lib/eos/jao-shell.el
index 8745492..4d35e4c 100644
--- a/lib/eos/jao-shell.el
+++ b/lib/eos/jao-shell.el
@@ -68,7 +68,7 @@
(lambda (process event)
(when (string= event "finished\n")
(kill-buffer (process-buffer process))))))
- (setq-local jao-term--cmd cmd)
+ (setq-local jao-term--cmd cmd scroll-margin 0)
(term-send-string nil (format "%s%s\n" cmd (if no-kill "" ";exit"))))))
;;;###autoload