Some more small changes

This commit is contained in:
Alexander Rosenberg 2024-12-22 15:19:28 -08:00
parent dc789627c0
commit 96b64a144e
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
3 changed files with 22 additions and 9 deletions

View File

@ -859,7 +859,7 @@ Return a hash table mapping module names to their output."
(defun eshell-starship--render-prompt () (defun eshell-starship--render-prompt ()
"Actually produce the prompt." "Actually produce the prompt."
(concat (concat
(unless (< (line-number-at-pos) 3) (unless (<= (line-number-at-pos) 3)
"\n") "\n")
(eshell-starship--build-module-string))) (eshell-starship--build-module-string)))

29
init.el
View File

@ -3,10 +3,12 @@
;;; Code: ;;; Code:
;; Some other config files ;; Some other config files
(add-to-list 'load-path "~/.emacs.d/elisp") (add-to-list 'load-path (expand-file-name "elisp" user-emacs-directory))
(add-to-list 'load-path (expand-file-name "third-party" user-emacs-directory))
;; Set package dir to follow no-littering conventions ;; Set package dir to follow no-littering conventions
(setq package-user-dir "~/.emacs.d/var/elpa") (setq package-user-dir (expand-file-name "var/elpa"
user-emacs-directory))
;; Use melpa ;; Use melpa
(require 'package) (require 'package)
@ -22,7 +24,8 @@
(eval-when-compile (eval-when-compile
(require 'use-package) (require 'use-package)
(setq use-package-always-ensure t (setq use-package-always-ensure t
package-user-dir "~/.emacs.d/var/elpa")) package-user-dir (expand-file-name "var/elpa"
user-emacs-directory)))
;; no-littering ;; no-littering
(use-package no-littering (use-package no-littering
@ -1291,8 +1294,7 @@ With PROJECT, give diagnostics for all buffers in the current project."
;; project.el ;; project.el
(use-package project (use-package project
:bind (("C-c v" . my/project-eshell-or-default) :bind (([remap project-compile] . my/project-compile-or-default)
([remap project-compile] . my/project-compile-or-default)
:map project-prefix-map :map project-prefix-map
("s" . my/project-eshell) ("s" . my/project-eshell)
("u" . my/project-run)) ("u" . my/project-run))
@ -1590,8 +1592,8 @@ otherwise, call `bibtex-find-text'."
:mode 'web-mode) :mode 'web-mode)
(define-innermode my/poly-php-innermode (define-innermode my/poly-php-innermode
:mode 'php-mode :mode 'php-mode
:head-matcher "\<\?php" :head-matcher (regexp-quote "<?php")
:tail-matcher "\?\>" :tail-matcher (regexp-quote "?>")
:head-mode 'body :head-mode 'body
:tail-mode 'body) :tail-mode 'body)
(define-polymode my/poly-web-mode (define-polymode my/poly-web-mode
@ -1859,7 +1861,7 @@ argument."
(sage-shell:read-command))))) (sage-shell:read-command)))))
;; fricas (because I like calculators) ;; fricas (because I like calculators)
(add-to-list 'load-path "/usr/lib/fricas/emacs/") (add-to-list 'load-path "/usr/lib/fricas/emacs")
(use-package fricas (use-package fricas
:ensure nil :ensure nil
:custom :custom
@ -2007,6 +2009,17 @@ If no name is given, list all bookmarks instead."
(set-face-attribute 'eshell-starship-icon-face nil (set-face-attribute 'eshell-starship-icon-face nil
:family "FiraCode Nerd Font")) :family "FiraCode Nerd Font"))
(defun my/open-shell-dwim (&optional arg)
"Open either an Eshell or eat terminal based on `default-directory'.
If `default-directory' is remote, call `my/project-eat-or-default'. Otherwise,
call `my/project-eshell-or-default'. ARG is the same as for either of the above
functions (only eshell uses it at the time of writing)."
(interactive "P")
(if (file-remote-p default-directory)
(my/project-eat-or-default)
(my/project-eshell-or-default arg)))
(keymap-global-set "C-c v" #'my/open-shell-dwim)
;; proced ;; proced
(use-package proced (use-package proced
:bind ("C-x j" . proced) :bind ("C-x j" . proced)