[emacs] assimilate and try out magithub
[~bandali/configs] / init.org
index 5d5a624..d90812e 100644 (file)
--- a/init.org
+++ b/init.org
@@ -355,7 +355,7 @@ in my shell.
   (mapc #'disable-theme custom-enabled-themes))
 #+end_src
 
-** Server
+** COMMENT Server
 
 Start server if not already running. Alternatively, can be done by
 issuing =emacs --daemon= in the terminal, which can be automated with
@@ -371,7 +371,7 @@ See [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.htm
   :config (or (server-running-p) (server-mode)))
 #+end_src
 
-** Unicode support
+** COMMENT Unicode support
 
 Font stack with better unicode support, around =Ubuntu Mono= and
 =Hack=.
@@ -708,6 +708,7 @@ In short, my favourite way of life.
         org-edit-src-content-indentation 0
         org-email-link-description-format "Email %c: %s" ; %.30s
         org-log-done 'time)
+  (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
   :bind (:map org-mode-map ("M-L" . org-insert-last-stored-link))
   :hook ((org-mode . org-indent-mode)
          (org-mode . auto-fill-mode)
@@ -1773,6 +1774,58 @@ Hopefully temporary.
   (setq alert-default-style 'notifier))
 #+end_src
 
+** hl-todo
+
+#+begin_src emacs-lisp
+(use-package hl-todo
+  :defer 4
+  :config
+  (global-hl-todo-mode))
+#+end_src
+
+** shrink-path
+
+#+begin_src emacs-lisp
+(use-package shrink-path
+  :after eshell
+  :config
+  (setq eshell-prompt-regexp "\\(.*\n\\)*λ "
+        eshell-prompt-function #'+eshell/prompt)
+
+  (defun +eshell/prompt ()
+    (let ((base/dir (shrink-path-prompt default-directory)))
+      (concat (propertize (car base/dir)
+                          'face 'font-lock-comment-face)
+              (propertize (cdr base/dir)
+                          'face 'font-lock-constant-face)
+              (propertize (+eshell--current-git-branch)
+                          'face 'font-lock-function-name-face)
+              "\n"
+              (propertize "λ" 'face 'eshell-prompt-face)
+              ;; needed for the input text to not have prompt face
+              (propertize " " 'face 'default))))
+
+  (defun +eshell--current-git-branch ()
+    (let ((branch (car (loop for match in (split-string (shell-command-to-string "git branch") "\n")
+                             when (string-match "^\*" match)
+                             collect match))))
+      (if (not (eq branch nil))
+          (concat " " (substring branch 2))
+        ""))))
+#+end_src
+
+** magithub
+
+For when I /have to/ use GH.
+
+#+begin_src emacs-lisp
+(use-package magithub
+  :after magit
+  :config
+  (magithub-feature-autoinject t)
+  (setq magithub-clone-default-directory "~/src/git"))
+#+end_src
+
 * Email
 
 #+begin_src emacs-lisp