fix fuckup

This commit is contained in:
2023-10-05 21:58:52 +02:00
parent 2233131e99
commit 73f9aa0fe7

111
init.el
View File

@@ -73,9 +73,14 @@ 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))))
:hook (find-file . (lambda () (display-line-numbers-mode 1))))
(use-package dashboard
:ensure t
@@ -113,10 +118,10 @@ There are two things you can do about this warning:
(editorconfig-mode 1))
(use-package eshell
:hook (eshell-mode . (lambda () (linum-mode -1))))
:hook (eshell-mode . (lambda () (display-line-numbers-mode -1))))
(use-package evil
:after (:all undo-tree term)
:after (:all undo-tree)
:init
(setq evil-want-fine-undo t
evil-want-keybinding nil)
@@ -133,7 +138,6 @@ 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)
@@ -199,61 +203,24 @@ Argument E should be the event that triggered this action."
(use-package less-css-mode
:mode ("\\.less\\'" . less-css-mode))
(use-package linum
(use-package display-line-numbers
:init
(defvar linum-current-line 1 "Current line number.")
(defvar linum-format-fmt "" " ")
(defvar linum-format "" " ")
(defface linum-current-line
`((t :inherit linum
:foreground "chocolate"
:weight bold
))
"Face for displaying the current line number."
:group 'linum)
:config
(defadvice linum-update (before advice-linum-update activate)
"Set the current line."
(setq linum-current-line (line-number-at-pos)))
(defun custom-linum-numbering ()
(setq-local linum-format-fmt
(let ((width
(length (number-to-string (count-lines (point-min) (point-max))))))
(concat " %" (number-to-string width) "d "))))
(defun linum-format-func (line)
(let ((face
(if (= line linum-current-line)
'linum-current-line 'linum)))
(propertize (format linum-format-fmt line) 'face face)))
(setq linum-format 'linum-format-func)
(linum-mode t)
:hook (linum-before-numbering . custom-linum-numbering))
(set-face-attribute 'line-number nil :background "#27272D")
(set-face-attribute 'line-number nil :foreground "#6F6F72")
(set-face-attribute 'line-number-current-line nil :foreground "chocolate")
(set-face-attribute 'line-number-current-line nil :weight 'bold))
(use-package magit)
(use-package magit-popup)
(use-package multi-term
:after term
(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)))
:config
(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)))
(add-to-list 'mini-frame-ignore-commands 'evil-ex)
(mini-frame-mode t))
(use-package nasm-mode
:mode ("\\.nasm\\'" . nasm-mode))
@@ -377,37 +344,37 @@ Argument E should be the event that triggered this action."
(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
(command-code (aref message (+ start 6)))
(argument
(save-match-data
(substring message
(+ start 8)
(string-match "\r?\n" message
(+ start 8))))))
(+ 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))))))
(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))
(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))
(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))))
(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)