Skip to content

Instantly share code, notes, and snippets.

@jonEbird
Created June 4, 2014 21:44
Show Gist options
  • Save jonEbird/90813167f3015ba7511d to your computer and use it in GitHub Desktop.
Save jonEbird/90813167f3015ba7511d to your computer and use it in GitHub Desktop.
Launch a unique shell per session / project
; Launch a unique shell for the particular session or project
(defun jsm/unique-shell (&optional directory)
"Start or return to a shell session named and started from a particular directory"
(interactive)
(let* ((basedir (or directory (read-directory-name "Base Directory: ")))
(default-directory basedir))
(shell (concat "*ProjSH* "
(file-name-base (replace-regexp-in-string "/*$" "" basedir))))))
(defun jsm/projectile-shell-other-window ()
(interactive)
(jsm/unique-shell (projectile-project-root)))
(define-key projectile-command-map (kbd "$") 'jsm/projectile-shell-other-window)
(global-set-key (kbd "C-x 4 s") 'jsm/unique-shell)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment