Ver Fonte

[emacs] No web lsps and add bash aliases to eshell

Colin Powell há 9 meses atrás
pai
commit
98796b74e2
3 ficheiros alterados com 20 adições e 2 exclusões
  1. 18 0
      emacs/.config/doom/config.el
  2. 1 1
      emacs/.config/doom/custom.el
  3. 1 1
      emacs/.config/doom/init.el

+ 18 - 0
emacs/.config/doom/config.el

@@ -112,3 +112,21 @@
 
 ;; Or globally
 (with-eval-after-load 'org (global-org-modern-mode))
+(require 'cl-lib)
+
+
+(defun eshell-load-bash-aliases ()
+  "Read Bash aliases and add them to the list of eshell aliases."
+  ;; Bash needs to be run - temporarily - interactively
+  ;; in order to get the list of aliases.
+  (with-temp-buffer
+    (call-process "bash" nil '(t nil) nil "-ci" "alias")
+    (goto-char (point-min))
+    (cl-letf (((symbol-function 'eshell-write-aliases-list) #'ignore))
+      (while (re-search-forward "alias \\(.+\\)='\\(.+\\)'$" nil t)
+        (eshell/alias (match-string 1) (match-string 2))))
+    (eshell-write-aliases-list)))
+
+;; We only want Bash aliases to be loaded when Eshell loads its own aliases,
+;; rather than every time `eshell-mode' is enabled.
+(add-hook 'eshell-alias-load-hook 'eshell-load-bash-aliases)

+ 1 - 1
emacs/.config/doom/custom.el

@@ -4,7 +4,7 @@
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
  '(magit-todos-insert-after '(bottom) nil nil "Changed by setter of obsolete option `magit-todos-insert-at'")
- '(package-selected-packages '(nov w3m vulpea ef-themes))
+ '(package-selected-packages '(helix-theme nov w3m vulpea ef-themes))
  '(safe-local-variable-values '((pytest-global-name . "docker-compose run --rm test --"))))
 (custom-set-faces
  ;; custom-set-faces was added by Custom.

+ 1 - 1
emacs/.config/doom/init.el

@@ -180,7 +180,7 @@
        ;;solidity          ; do you need a blockchain? No.
        ;;swift             ; who asked for emoji variables?
        ;;terra             ; Earth and Moon in alignment for performance.
-       (web +lsp)          ; the tubes
+       web                 ; the tubes
        yaml                ; JSON, but readable
        ;;zig               ; C, but simpler