Skip to content

Instantly share code, notes, and snippets.

@cognominal
Last active March 26, 2021 14:54
Show Gist options
  • Save cognominal/190613 to your computer and use it in GitHub Desktop.
Save cognominal/190613 to your computer and use it in GitHub Desktop.
shell-to-current-directory #el
(defun shell-to-current-directory ()
"go to '*shell*' and cd it to current directory of current buffer"
(interactive "")
(let pwd default-directory)
(switch-to-buffer "*shell*")
(end-of-buffer)
(insert pwd)
(comint-send-input)
)(defun shell-to-current-directory ()
"go to '*shell*' and cd it to current directory of current buffer"
(interactive "")
(let ((pwd default-directory)))
(switch-to-buffer "*shell*")
(end-of-buffer)
(insert pwd)
(comint-send-input)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment