Compare commits
1 commit
b2c45c5169
...
05312716ea
Author | SHA1 | Date | |
---|---|---|---|
05312716ea |
4 changed files with 51 additions and 37 deletions
23
flake.lock
generated
23
flake.lock
generated
|
@ -7,11 +7,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable"
|
"nixpkgs-stable": "nixpkgs-stable"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724577031,
|
"lastModified": 1724490633,
|
||||||
"narHash": "sha256-C3ufe7meLX9zNEOawPKdIpfmFQ+D5d2oqQ3iQMFdva4=",
|
"narHash": "sha256-Ok9pSW0ge++fbNDu6pac9tJaTSIfxaTyjl8Xvl2tCf4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "emacs-overlay",
|
"repo": "emacs-overlay",
|
||||||
"rev": "d945c2ba0421e0c1b239b5882f2c0725fe8cfba1",
|
"rev": "0780b82798307b08982e766e039f7a1680fadfe8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -36,22 +36,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra-package-haskell-ts-mode": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1724579033,
|
|
||||||
"narHash": "sha256-cwkJY5kLgcTuTMy2/5t/CkEnN1x7aj6BaSX1wYg7Vw8=",
|
|
||||||
"ref": "refs/heads/main",
|
|
||||||
"rev": "d9afd84e46b41c9912539face04ec7bb2a16ba78",
|
|
||||||
"revCount": 47,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/pranshu/haskell-ts-mode.git"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://codeberg.org/pranshu/haskell-ts-mode.git"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"extra-package-indent-bars": {
|
"extra-package-indent-bars": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
@ -223,7 +207,6 @@
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"emacs-overlay": "emacs-overlay",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"extra-package-copilot": "extra-package-copilot",
|
"extra-package-copilot": "extra-package-copilot",
|
||||||
"extra-package-haskell-ts-mode": "extra-package-haskell-ts-mode",
|
|
||||||
"extra-package-indent-bars": "extra-package-indent-bars",
|
"extra-package-indent-bars": "extra-package-indent-bars",
|
||||||
"extra-package-notmuch-notify": "extra-package-notmuch-notify",
|
"extra-package-notmuch-notify": "extra-package-notmuch-notify",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
url = "github:zerolfx/copilot.el";
|
url = "github:zerolfx/copilot.el";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
extra-package-haskell-ts-mode = {
|
|
||||||
url = "git+https://codeberg.org/pranshu/haskell-ts-mode.git";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ {flake-parts, ...}:
|
outputs = inputs @ {flake-parts, ...}:
|
||||||
|
|
55
init.el
55
init.el
|
@ -581,9 +581,49 @@
|
||||||
(eshell 'N)
|
(eshell 'N)
|
||||||
(add-hook 'kill-buffer-hook 'delete-frame nil 't)) ;; destroy frame on exit
|
(add-hook 'kill-buffer-hook 'delete-frame nil 't)) ;; destroy frame on exit
|
||||||
|
|
||||||
|
(defun ccr/eshell-history ()
|
||||||
|
"Interactive search eshell history."
|
||||||
|
(interactive)
|
||||||
|
(require 'em-hist)
|
||||||
|
(save-excursion
|
||||||
|
(eshell-bol)
|
||||||
|
(let* ((start-pos (point))
|
||||||
|
(end-pos (line-end-position))
|
||||||
|
(input (buffer-substring-no-properties start-pos end-pos)))
|
||||||
|
(message input)
|
||||||
|
(let* (
|
||||||
|
(history-shell (split-string (shell-command-to-string "history") "\n"))
|
||||||
|
(history-eshell (delete-dups (when (> (ring-size eshell-history-ring) 0)
|
||||||
|
(ring-elements eshell-history-ring))))
|
||||||
|
(history (append history-shell history-eshell))
|
||||||
|
;; (history-highlighted (mapcar #'(lambda (cmd)
|
||||||
|
;; (with-temp-buffer
|
||||||
|
;; (text-mode)
|
||||||
|
;; (insert cmd)
|
||||||
|
;; (forward-line 0)
|
||||||
|
;; ;; FIXME it breaks trying to highlight commands like `cd /ssh:host:~'
|
||||||
|
;; ;; (eshell-syntax-highlighting--parse-and-highlight 'command (point-max))
|
||||||
|
;; (add-face-text-property (point-min) (point-max) '(:background nil))
|
||||||
|
;; (buffer-string)))
|
||||||
|
;; history))
|
||||||
|
(command (completing-read
|
||||||
|
"Command: "
|
||||||
|
history
|
||||||
|
nil
|
||||||
|
nil
|
||||||
|
input
|
||||||
|
)))
|
||||||
|
(kill-region start-pos end-pos)
|
||||||
|
(insert command)
|
||||||
|
)))
|
||||||
|
(end-of-line))
|
||||||
|
|
||||||
|
(defun ccr/wrap-eshell-write-history (orig-fun &optional filename &rest _)
|
||||||
|
(apply orig-fun `(,filename 't)))
|
||||||
|
|
||||||
;; Wrapping this in order to merge histories from different shells
|
;; Wrapping this in order to merge histories from different shells
|
||||||
;; (advice-add 'eshell-write-history
|
(advice-add 'eshell-write-history
|
||||||
;; :around #'ccr/wrap-eshell-write-history)
|
:around #'ccr/wrap-eshell-write-history)
|
||||||
|
|
||||||
(add-to-list 'eshell-modules-list 'eshell-tramp) ;; to use sudo in eshell
|
(add-to-list 'eshell-modules-list 'eshell-tramp) ;; to use sudo in eshell
|
||||||
;; (add-to-list 'eshell-modules-list 'eshell-smart) ;; plan 9 style
|
;; (add-to-list 'eshell-modules-list 'eshell-smart) ;; plan 9 style
|
||||||
|
@ -604,14 +644,11 @@
|
||||||
:hook (eshell-mode . (lambda () (setq-local scroll-margin 0)))
|
:hook (eshell-mode . (lambda () (setq-local scroll-margin 0)))
|
||||||
:bind (("C-c o e" . project-eshell)
|
:bind (("C-c o e" . project-eshell)
|
||||||
:map eshell-mode-map
|
:map eshell-mode-map
|
||||||
("C-r" . eshell-atuin-history))) ;; i.e. just C-r in semi-char-mode
|
("C-r" . ccr/eshell-history))) ;; i.e. just C-r in semi-char-mode
|
||||||
|
|
||||||
(use-package eshell-command-not-found
|
(use-package esh-autosuggest
|
||||||
:custom ((eshell-command-not-found-command "command-not-found"))
|
;; :hook (eshell-mode . esh-autosuggest-mode) # FIXME otherwise emacs stucks
|
||||||
:hook ((eshell-mode . eshell-command-not-found-mode)))
|
)
|
||||||
|
|
||||||
(use-package eshell-atuin
|
|
||||||
:hook ((eshell-mode . eshell-atuin-mode)))
|
|
||||||
|
|
||||||
(use-package fish-completion-mode
|
(use-package fish-completion-mode
|
||||||
:hook ((eshell-mode . fish-completion-mode)))
|
:hook ((eshell-mode . fish-completion-mode)))
|
||||||
|
|
|
@ -53,12 +53,10 @@ pkgs: epkgs: let
|
||||||
eshell-syntax-highlighting
|
eshell-syntax-highlighting
|
||||||
fish-completion # fish completion for eshell
|
fish-completion # fish completion for eshell
|
||||||
eshell-prompt-extras
|
eshell-prompt-extras
|
||||||
eshell-atuin
|
esh-autosuggest
|
||||||
eshell-command-not-found
|
|
||||||
clipetty
|
clipetty
|
||||||
sideline
|
sideline
|
||||||
consult-eglot
|
sideline-flymake
|
||||||
# sideline-flymake
|
|
||||||
rainbow-delimiters
|
rainbow-delimiters
|
||||||
vertico
|
vertico
|
||||||
marginalia
|
marginalia
|
||||||
|
|
Reference in a new issue