Last active
May 12, 2018 00:44
-
-
Save ojarjur/b90627beea05da05239e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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