Skip to content

Instantly share code, notes, and snippets.

@ojarjur
Last active May 12, 2018 00:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ojarjur/b90627beea05da05239e to your computer and use it in GitHub Desktop.
Save ojarjur/b90627beea05da05239e to your computer and use it in GitHub Desktop.
(load "~/losak/lsk-mode.el")
(defun my-scheme-mode-hook ()
"Custom hook for Scheme mode"
(setq indent-tabs-mode nil))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(gud-gdb-command-name "gdb --annotate=1")
'(large-file-warning-threshold nil)
'(scheme-mode-hook 'my-scheme-mode-hook))
(require 'ansi-color)
(autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
;; Disable the super-annoying electric-indent mode anti-feature
(when (fboundp 'electric-indent-mode)
(electric-indent-mode -1))
(defun spawn-shell (shell-name dir)
"Spawn a shell buffer with the given name in the given directory"
(pop-to-buffer (get-buffer-create (generate-new-buffer-name shell-name)))
(setq default-directory dir)
(shell (current-buffer))
(process-send-string nil (format "cd '%s'\n" dir)))
(defun git-dirs ()
"Find the directories of local git repos under the home dir."
(split-string (shell-command-to-string
"for FILE in `find ~ -name '.git'`; do dirname $FILE; done")))
(defun spawn-git-shells (repo-dirs)
(while (consp repo-dirs)
(let* ((repo-dir (car repo-dirs))
(dir-name (car (last (split-string repo-dir "/")))))
(progn (spawn-shell (format "%s repo shell" dir-name)
(format "%s/" repo-dir))
(process-send-string nil "git status\n")
(setq repo-dirs (cdr repo-dirs))))))
(spawn-git-shells (git-dirs))
(spawn-shell "home shell" (expand-file-name "~/"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment