Skip to content

Commit

Permalink
term-cd-current-buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
dougm committed Apr 21, 2014
1 parent ca1b36c commit f40f440
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom/eshell.el
Expand Up @@ -92,5 +92,5 @@
(delete-other-windows)))

;; key bindings
(global-set-key (kbd "C-c !") 'eshell-cd-current-buffer)
(global-set-key (kbd "C-c `") 'eshell-cd-current-buffer)
(global-set-key (kbd "C-c s") 'toggle-eshell-visor)
10 changes: 10 additions & 0 deletions custom/term.el
Expand Up @@ -22,6 +22,16 @@

(setq multi-term-program "bash")

(defun term-cd-current-buffer ()
"multi-term-next and cd to directory of current-buffer."
(interactive)
(let ((dir default-directory))
(multi-term-next)
(unless (string= dir default-directory)
(term-send-raw-string (format "cd %s\n" dir))
(term-send-raw-string "\C-l"))))

(global-set-key (kbd "C-c !") 'term-cd-current-buffer)
(global-set-key (kbd "C-c t") 'multi-term-next)
(global-set-key (kbd "C-c T") 'multi-term)
(global-set-key (kbd "C-c v") 'vagrant-tramp-term)

0 comments on commit f40f440

Please sign in to comment.