update emacs config for emacs 29

This commit is contained in:
2023-10-05 21:44:58 +02:00
parent 3eaa3045b2
commit 2233131e99

77
init.el
View File

@@ -73,11 +73,6 @@ There are two things you can do about this warning:
:hook rust-mode)
(use-package counsel
:config
(let ((done (where-is-internal #'ivy-done ivy-minibuffer-map t))
(alt (where-is-internal #'ivy-alt-done ivy-minibuffer-map t)))
(define-key counsel-find-file-map done #'ivy-alt-done)
(define-key counsel-find-file-map alt #'ivy-done))
:bind (("M-x" . counsel-M-x)
("C-x C-f" . counsel-find-file))
:hook (find-file . (lambda () (linum-mode 1))))
@@ -121,7 +116,7 @@ There are two things you can do about this warning:
:hook (eshell-mode . (lambda () (linum-mode -1))))
(use-package evil
:after (:all undo-tree)
:after (:all undo-tree term)
:init
(setq evil-want-fine-undo t
evil-want-keybinding nil)
@@ -138,6 +133,7 @@ There are two things you can do about this warning:
(define-key evil-normal-state-map "\C-w" nil)
(define-key evil-motion-state-map "\C-w" nil)
(define-key evil-motion-state-map "\C-f" nil)
(evil-set-initial-state 'term-mode 'emacs)
(evil-set-initial-state 'neotree-mode 'emacs)
(evil-set-initial-state 'dired-mode 'emacs)
(evil-set-initial-state 'dashboard-mode 'emacs)
@@ -240,13 +236,24 @@ Argument E should be the event that triggered this action."
(use-package magit-popup)
(use-package mini-frame
:init
(setq x-gtk-resize-child-frames 'resize-mode
mini-frame-show-parameters '((top . 10.0) (width . 1.0) (left . 0.0)))
(use-package multi-term
:after term
:config
(add-to-list 'mini-frame-ignore-commands 'evil-ex)
(mini-frame-mode t))
(setq multi-term-buffer-name "term"
multi-term-program "/bin/bash"
term-bind-key-alist
(list (cons "C-c C-c" 'term-interrupt-subjob)
(cons "C-c C-j" 'term-line-mode)
(cons "C-c C-k" 'term-char-mode)
(cons "M-DEL" 'term-send-backward-kill-word)
(cons "M-d" 'term-send-forward-kill-word)
(cons "<C-left>" 'term-send-backward-word)
(cons "<C-right>" 'term-send-forward-word)
(cons "C-r" 'term-send-reverse-search-history)
(cons "C-y" 'term-send-raw)))
:bind (([f5] . multi-term)
("C-M-<tab>" . multi-term-next)
("C-M-<iso-lefttab>" . multi-term-prev)))
(use-package nasm-mode
:mode ("\\.nasm\\'" . nasm-mode))
@@ -362,6 +369,52 @@ Argument E should be the event that triggered this action."
:config
(tab-bar-mode t))
(use-package term
:config
;; https://web.archive.org/web/20181111010613/ ->
;; -> http://paralambda.org/2012/07/02/using-gnu-emacs-as-a-terminal-emulator/
(defun term-handle-ansi-terminal-messages (message)
(while (string-match "\eAnSiT.+\n" message)
;; Extract the command code and the argument.
(let* ((start (match-beginning 0))
(command-code (aref message (+ start 6)))
(argument
(save-match-data
(substring message
(+ start 8)
(string-match "\r?\n" message
(+ start 8))))))
;; Delete this command from MESSAGE.
(setq message (replace-match "" t t message))
(cond ((= command-code ?c)
(setq term-ansi-at-dir argument))
((= command-code ?h)
(setq term-ansi-at-host argument))
((= command-code ?u)
(setq term-ansi-at-user argument))
((= command-code ?e)
(save-excursion
(find-file-other-window argument)))
((= command-code ?x)
(save-excursion
(find-file argument))))))
(when (and term-ansi-at-host term-ansi-at-dir term-ansi-at-user)
(setq buffer-file-name
(format "%s@%s:%s" term-ansi-at-user term-ansi-at-host term-ansi-at-dir))
(set-buffer-modified-p nil)
(setq default-directory
(if (string= term-ansi-at-host (system-name))
(concatenate 'string term-ansi-at-dir "/")
(format "/%s@%s:%s/" term-ansi-at-user term-ansi-at-host term-ansi-at-dir))))
message)
(setq term-scroll-to-bottom-on-output t)
(setq term-suppress-hard-newline t)
:hook ((term-mode . (lambda ()
(linum-mode -1)
(setq-local global-hl-line-mode nil)))))
(use-package terraform-mode)
(use-package toml-mode