Skip to content

Instantly share code, notes, and snippets.

@chuntaro
Created November 23, 2016 08:13
Show Gist options
  • Select an option

  • Save chuntaro/0b2d375faa5112a1e05e03d342d93289 to your computer and use it in GitHub Desktop.

Select an option

Save chuntaro/0b2d375faa5112a1e05e03d342d93289 to your computer and use it in GitHub Desktop.
バッファのカレントディレクトリで eshell を起動する
;; 色々やり方があるけど、これはcdのコマンド履歴を残すやり方
(defun eshell-cd-default-directory ()
"Eshell 'cd' with current buffer's default-directory."
(interactive)
(let ((dir default-directory))
(eshell)
(eshell-reset)
(insert (concat "cd " (shell-quote-wildcard-pattern dir)))
(eshell-send-input)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment