From 3931c978203ba84862f51d9601c429da3a001069 Mon Sep 17 00:00:00 2001
From: SqrtMinusOne Goto project root. TRAMP is a package that provides remote editing capacities. It is particularly useful for remote server management. Unfortunately, many Emacs packages don’t exactly moderate their rate of filesystem operations, and on TRAMP over network each operation adds additional overhead, so… it can get pretty slow. To debug these issues, set the following variable to 6:Lisp
org-journal-tags
"l" #'dired-find-file
"=" #'dired-narrow
"-" #'my/dired-create-empty-file-subtree
- "~" #'vterm
+ "~" #'eshell
"M-r" #'wdired-change-to-wdired-mode
"<left>" #'dired-up-directory
"<right>" #'dired-find-file
@@ -6028,6 +6029,17 @@ Didn’t work out as I expected, so I’ve made org-journal-tags
"sS" 'my/dired-open-this-subdir
"sQ" 'my/dired-kill-all-subdirs
(kbd "TAB") 'dired-hide-subdir))
+Other functions
+(defun my/dired-goto-project-root ()
+ (interactive)
+ (dired--find-possibly-alternative-file (projectile-project-root)))
+
+(with-eval-after-load 'dired
+ (general-define-key
+ :states '(normal)
+ :keymaps 'dired-mode-map
+ "H" #'my/dired-goto-project-root))
TRAMP
The function can be added in after-change-functions, which is executed on every text modification. This shouldn’t slow eshell down because eshell-send-input sets inhibit-modification-hooks to t.
(defun my/eshell-overlay-suggest-enable ()
- (interactive)
- (add-hook 'after-change-functions #'my/eshell-overlay-suggest nil t)
- (add-hook 'company-completion-started-hook #'my/eshell-overlay-suggest nil t)
- (add-hook 'company-after-completion-hook #'my/eshell-overlay-suggest nil t)
- ;; (setq-local company-idle-delay nil)
- )
+(define-minor-mode my/eshell-overlay-suggest-mode
+ "Fish-like suggestions for eshell."
+ :after-hook
+ (if my/eshell-overlay-suggest-mode
+ (progn
+ (add-hook 'after-change-functions #'my/eshell-overlay-suggest nil t)
+ (add-hook 'company-completion-started-hook #'my/eshell-overlay-suggest nil t)
+ (add-hook 'company-after-completion-hook #'my/eshell-overlay-suggest nil t))
+ (remove-hook 'after-change-functions #'my/eshell-overlay-suggest t)
+ (add-hook 'company-completion-started-hook #'my/eshell-overlay-suggest t)
+ (add-hook 'company-after-completion-hook #'my/eshell-overlay-suggest t)
+ (my/eshell-overlay-remove)))
-(add-hook 'eshell-mode-hook #'my/eshell-overlay-suggest-enable)
+;; (add-hook 'eshell-mode-hook #'my/eshell-overlay-suggest-mode)
Finally, a function that inserts the overlay in buffer if it’s available and calls company-complete if it’s not. I’ve bound it to <tab>.
(defun my/eshell-complete ()
(interactive)
@@ -6624,6 +6643,11 @@ Some other optimization settings:
(if (eq (selected-window) window)
(kill-buffer-and-window)
(select-window window))))))
+
Custom commands
+(defun eshell/prt ()
+ (if-let ((root (projectile-project-root)))
+ (eshell/cd root)
+ (message "Not in a project")))
Global keybindings
(general-define-key
:states '(normal)
@@ -10125,6 +10149,11 @@ I’ve seen a couple of cases where people would swap their username and ema
(use-package meme
:straight (:host github :repo "larsmagne/meme" :files (:defaults "images"))
:commands (meme))
+
Ed
+My text editor isn’t old enough.
+(use-package ed-mode
+ :straight (:host github :repo "ryanprior/ed-mode")
+ :commands (ed))
Guix settings