emacs working again
This commit is contained in:
parent
bd71f8d95a
commit
af59d33353
11 changed files with 7 additions and 497 deletions
|
@ -1,118 +0,0 @@
|
|||
(when (maybe-require-package 'meow)
|
||||
(defun meow-setup ()
|
||||
(setq meow-cheatsheet-physical-layout meow-cheatsheet-physical-layout-iso)
|
||||
(setq meow-cheatsheet-layout meow-cheatsheet-layout-qwertz)
|
||||
|
||||
(meow-thing-register 'angle
|
||||
'(pair (";") (":"))
|
||||
'(pair (";") (":")))
|
||||
|
||||
(setq meow-char-thing-table
|
||||
'((?f . round)
|
||||
(?d . square)
|
||||
(?s . curly)
|
||||
(?a . angle)
|
||||
(?r . string)
|
||||
(?v . paragraph)
|
||||
(?c . line)
|
||||
(?x . buffer)))
|
||||
|
||||
(meow-leader-define-key
|
||||
;; Use SPC (0-9) for digit arguments.
|
||||
'("1" . meow-digit-argument)
|
||||
'("2" . meow-digit-argument)
|
||||
'("3" . meow-digit-argument)
|
||||
'("4" . meow-digit-argument)
|
||||
'("5" . meow-digit-argument)
|
||||
'("6" . meow-digit-argument)
|
||||
'("7" . meow-digit-argument)
|
||||
'("8" . meow-digit-argument)
|
||||
'("9" . meow-digit-argument)
|
||||
'("0" . meow-digit-argument)
|
||||
'("-" . meow-keypad-describe-key)
|
||||
'("_" . meow-cheatsheet))
|
||||
|
||||
(meow-normal-define-key
|
||||
;; expansion
|
||||
'("0" . meow-expand-0)
|
||||
'("1" . meow-expand-1)
|
||||
'("2" . meow-expand-2)
|
||||
'("3" . meow-expand-3)
|
||||
'("4" . meow-expand-4)
|
||||
'("5" . meow-expand-5)
|
||||
'("6" . meow-expand-6)
|
||||
'("7" . meow-expand-7)
|
||||
'("8" . meow-expand-8)
|
||||
'("9" . meow-expand-9)
|
||||
'("ä" . meow-reverse)
|
||||
|
||||
;; movement
|
||||
'("i" . meow-prev)
|
||||
'("k" . meow-next)
|
||||
'("j" . meow-left)
|
||||
'("l" . meow-right)
|
||||
|
||||
'("z" . meow-search)
|
||||
'("-" . meow-visit)
|
||||
|
||||
;; expansion
|
||||
'("I" . meow-prev-expand)
|
||||
'("K" . meow-next-expand)
|
||||
'("J" . meow-left-expand)
|
||||
'("L" . meow-right-expand)
|
||||
|
||||
'("u" . meow-back-word)
|
||||
'("U" . meow-back-symbol)
|
||||
'("o" . meow-next-word)
|
||||
'("O" . meow-next-symbol)
|
||||
|
||||
'("a" . meow-mark-word)
|
||||
'("A" . meow-mark-symbol)
|
||||
'("s" . meow-line)
|
||||
'("S" . meow-goto-line)
|
||||
'("w" . meow-block)
|
||||
'("q" . meow-join)
|
||||
'("g" . meow-grab)
|
||||
'("G" . meow-pop-grab)
|
||||
'("m" . meow-swap-grab)
|
||||
'("M" . meow-sync-grab)
|
||||
'("p" . meow-cancel-selection)
|
||||
'("P" . meow-pop-selection)
|
||||
|
||||
'("x" . meow-till)
|
||||
'("y" . meow-find)
|
||||
|
||||
'("," . meow-beginning-of-thing)
|
||||
'("." . meow-end-of-thing)
|
||||
'(";" . meow-inner-of-thing)
|
||||
'(":" . meow-bounds-of-thing)
|
||||
|
||||
;; editing
|
||||
'("d" . meow-kill)
|
||||
'("f" . meow-change)
|
||||
'("t" . meow-delete)
|
||||
'("c" . meow-save)
|
||||
'("v" . meow-yank)
|
||||
'("V" . meow-yank-pop)
|
||||
|
||||
'("e" . meow-insert)
|
||||
'("E" . meow-open-above)
|
||||
'("r" . meow-append)
|
||||
'("R" . meow-open-below)
|
||||
|
||||
'("h" . undo-only)
|
||||
'("H" . undo-redo)
|
||||
|
||||
'("b" . open-line)
|
||||
'("B" . split-line)
|
||||
|
||||
'("ü" . indent-rigidly-left-to-tab-stop)
|
||||
'("+" . indent-rigidly-right-to-tab-stop)
|
||||
|
||||
;; ignore escape
|
||||
'("<escape>" . ignore)))
|
||||
|
||||
(meow-setup)
|
||||
(meow-global-mode 1))
|
||||
|
||||
(provide 'init-meow)
|
|
@ -1,4 +1,4 @@
|
|||
;;; init-company.el --- Companyy autocompletion
|
||||
;;; init-company.el --- Company autocompletion
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
(when (maybe-require-package 'company)
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
;;; init-company.el --- Companyy autocompletion
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
(when (maybe-require-package 'company)
|
||||
(diminish 'company-mode)
|
||||
(add-hook 'after-init-hook 'global-company-mode)
|
||||
(setq company-minimum-prefix-length 1
|
||||
company-idle-delay 0.1
|
||||
company-selection-wrap-around t
|
||||
company-tooltip-align-annotations t
|
||||
company-frontends '(company-pseudo-tooltip-frontend ; show tooltip even for single candidate
|
||||
company-echo-metadata-frontend))
|
||||
(define-key company-active-map (kbd "C-n") 'company-select-next)
|
||||
(define-key company-active-map (kbd "C-p") 'company-select-previous)
|
||||
)
|
||||
(provide 'init-company)
|
||||
;;; end of file init-company.el
|
|
@ -1,39 +0,0 @@
|
|||
;;; init-corfu.el --- Interactive completion in buffers -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
;; WAITING: haskell-mode sets tags-table-list globally, breaks tags-completion-at-point-function
|
||||
;; TODO Default sort order should place [a-z] before punctuation
|
||||
|
||||
(setq tab-always-indent 'complete)
|
||||
(when (maybe-require-package 'orderless)
|
||||
(with-eval-after-load 'vertico
|
||||
(require 'orderless)
|
||||
(setq completion-styles '(orderless basic))))
|
||||
(setq completion-category-defaults nil
|
||||
completion-category-overrides nil)
|
||||
(setq completion-cycle-threshold 4)
|
||||
|
||||
(when (maybe-require-package 'corfu)
|
||||
(setq-default corfu-auto t)
|
||||
(with-eval-after-load 'eshell
|
||||
(add-hook 'eshell-mode-hook (lambda () (setq-local corfu-auto nil))))
|
||||
(setq-default corfu-quit-no-match 'separator)
|
||||
(add-hook 'after-init-hook 'global-corfu-mode)
|
||||
|
||||
|
||||
|
||||
(with-eval-after-load 'corfu
|
||||
(corfu-popupinfo-mode))
|
||||
|
||||
;; Make Corfu also work in terminals, without disturbing usual behaviour in GUI
|
||||
(when (maybe-require-package 'corfu-terminal)
|
||||
(with-eval-after-load 'corfu
|
||||
(corfu-terminal-mode)))
|
||||
|
||||
;; TODO: https://github.com/jdtsmith/kind-icon
|
||||
)
|
||||
|
||||
|
||||
(provide 'init-corfu)
|
||||
;;; init-corfu.el ends here
|
|
@ -1,266 +0,0 @@
|
|||
;;; init-editing-utils.el --- Day-to-day editing helpers -*- lexical-binding: t -*-
|
||||
;;; Commentary:
|
||||
;;; Code:
|
||||
|
||||
(require-package 'unfill)
|
||||
|
||||
(when (fboundp 'electric-pair-mode)
|
||||
(add-hook 'after-init-hook 'electric-pair-mode))
|
||||
(add-hook 'after-init-hook 'electric-indent-mode)
|
||||
|
||||
(maybe-require-package 'list-unicode-display)
|
||||
|
||||
|
||||
;;; Some basic preferences
|
||||
|
||||
(setq-default
|
||||
blink-cursor-interval 0.4
|
||||
bookmark-default-file (locate-user-emacs-file ".bookmarks.el")
|
||||
buffers-menu-max-size 30
|
||||
case-fold-search t
|
||||
column-number-mode t
|
||||
ediff-split-window-function 'split-window-horizontally
|
||||
ediff-window-setup-function 'ediff-setup-windows-plain
|
||||
indent-tabs-mode nil
|
||||
create-lockfiles nil
|
||||
auto-save-default nil
|
||||
make-backup-files nil
|
||||
mouse-yank-at-point t
|
||||
save-interprogram-paste-before-kill t
|
||||
scroll-preserve-screen-position 'always
|
||||
set-mark-command-repeat-pop t
|
||||
tooltip-delay 1.5
|
||||
truncate-lines nil
|
||||
truncate-partial-width-windows nil)
|
||||
|
||||
(add-hook 'after-init-hook 'delete-selection-mode)
|
||||
|
||||
(add-hook 'after-init-hook 'global-auto-revert-mode)
|
||||
(setq global-auto-revert-non-file-buffers t
|
||||
auto-revert-verbose nil)
|
||||
(with-eval-after-load 'autorevert
|
||||
(diminish 'auto-revert-mode))
|
||||
|
||||
(add-hook 'after-init-hook 'transient-mark-mode)
|
||||
|
||||
|
||||
|
||||
;; Huge files
|
||||
|
||||
(when (fboundp 'so-long-enable)
|
||||
(add-hook 'after-init-hook 'so-long-enable))
|
||||
|
||||
(require-package 'vlf)
|
||||
|
||||
(defun ffap-vlf ()
|
||||
"Find file at point with VLF."
|
||||
(interactive)
|
||||
(let ((file (ffap-file-at-point)))
|
||||
(unless (file-exists-p file)
|
||||
(error "File does not exist: %s" file))
|
||||
(vlf file)))
|
||||
|
||||
|
||||
;;; A simple visible bell which works in all terminal types
|
||||
(require-package 'mode-line-bell)
|
||||
(add-hook 'after-init-hook 'mode-line-bell-mode)
|
||||
|
||||
|
||||
|
||||
;;; Newline behaviour (see also electric-indent-mode, enabled above)
|
||||
|
||||
(defun sanityinc/newline-at-end-of-line ()
|
||||
"Move to end of line, enter a newline, and reindent."
|
||||
(interactive)
|
||||
(move-end-of-line 1)
|
||||
(newline-and-indent))
|
||||
|
||||
(global-set-key (kbd "S-<return>") 'sanityinc/newline-at-end-of-line)
|
||||
|
||||
|
||||
|
||||
(with-eval-after-load 'subword
|
||||
(diminish 'subword-mode))
|
||||
|
||||
|
||||
|
||||
(when (fboundp 'display-line-numbers-mode)
|
||||
(setq-default display-line-numbers-width 3)
|
||||
(add-hook 'prog-mode-hook 'display-line-numbers-mode))
|
||||
|
||||
|
||||
|
||||
(when (boundp 'display-fill-column-indicator)
|
||||
(setq-default indicate-buffer-boundaries 'left)
|
||||
(setq-default display-fill-column-indicator-character ?┊)
|
||||
(add-hook 'prog-mode-hook 'display-fill-column-indicator-mode))
|
||||
|
||||
|
||||
|
||||
(when (require-package 'rainbow-delimiters)
|
||||
(add-hook 'prog-mode-hook 'rainbow-delimiters-mode))
|
||||
|
||||
|
||||
(when (maybe-require-package 'symbol-overlay)
|
||||
(dolist (hook '(prog-mode-hook html-mode-hook yaml-mode-hook conf-mode-hook))
|
||||
(add-hook hook 'symbol-overlay-mode))
|
||||
(with-eval-after-load 'symbol-overlay
|
||||
(diminish 'symbol-overlay-mode)
|
||||
(define-key symbol-overlay-mode-map (kbd "M-i") 'symbol-overlay-put)
|
||||
(define-key symbol-overlay-mode-map (kbd "M-I") 'symbol-overlay-remove-all)
|
||||
(define-key symbol-overlay-mode-map (kbd "M-n") 'symbol-overlay-jump-next)
|
||||
(define-key symbol-overlay-mode-map (kbd "M-p") 'symbol-overlay-jump-prev)))
|
||||
|
||||
|
||||
;;; Zap *up* to char is a handy pair for zap-to-char
|
||||
(global-set-key (kbd "M-Z") 'zap-up-to-char)
|
||||
|
||||
|
||||
|
||||
(require-package 'browse-kill-ring)
|
||||
(setq browse-kill-ring-separator "\f")
|
||||
(global-set-key (kbd "M-Y") 'browse-kill-ring)
|
||||
(with-eval-after-load 'browse-kill-ring
|
||||
(define-key browse-kill-ring-mode-map (kbd "C-g") 'browse-kill-ring-quit)
|
||||
(define-key browse-kill-ring-mode-map (kbd "M-n") 'browse-kill-ring-forward)
|
||||
(define-key browse-kill-ring-mode-map (kbd "M-p") 'browse-kill-ring-previous))
|
||||
(with-eval-after-load 'page-break-lines
|
||||
(add-to-list 'page-break-lines-modes 'browse-kill-ring-mode))
|
||||
|
||||
|
||||
;; Don't disable narrowing commands
|
||||
(put 'narrow-to-region 'disabled nil)
|
||||
(put 'narrow-to-page 'disabled nil)
|
||||
(put 'narrow-to-defun 'disabled nil)
|
||||
;; Don't disable case-change functions
|
||||
(put 'upcase-region 'disabled nil)
|
||||
(put 'downcase-region 'disabled nil)
|
||||
|
||||
|
||||
;; Show matching parens
|
||||
(add-hook 'after-init-hook 'show-paren-mode)
|
||||
|
||||
(when (fboundp 'repeat-mode)
|
||||
(add-hook 'after-init-hook 'repeat-mode))
|
||||
|
||||
|
||||
;;; Handy key bindings
|
||||
|
||||
(with-eval-after-load 'help
|
||||
(define-key help-map "A" 'describe-face))
|
||||
|
||||
(global-set-key (kbd "C-.") 'set-mark-command)
|
||||
(global-set-key (kbd "C-x C-.") 'pop-global-mark)
|
||||
|
||||
(when (maybe-require-package 'avy)
|
||||
(global-set-key (kbd "C-;") 'avy-goto-char-timer))
|
||||
|
||||
(require-package 'multiple-cursors)
|
||||
;; multiple-cursors
|
||||
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
|
||||
(global-set-key (kbd "C->") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "C-+") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "C-c C-<") 'mc/mark-all-like-this)
|
||||
|
||||
;; Train myself to use M-f and M-b instead
|
||||
(global-unset-key [M-left])
|
||||
(global-unset-key [M-right])
|
||||
|
||||
(defun kill-back-to-indentation ()
|
||||
"Kill from point back to the first non-whitespace character on the line."
|
||||
(interactive)
|
||||
(let ((prev-pos (point)))
|
||||
(back-to-indentation)
|
||||
(kill-region (point) prev-pos)))
|
||||
|
||||
(global-set-key (kbd "C-M-<backspace>") 'kill-back-to-indentation)
|
||||
|
||||
|
||||
|
||||
;;; Page break lines
|
||||
|
||||
(when (maybe-require-package 'page-break-lines)
|
||||
(add-hook 'after-init-hook 'global-page-break-lines-mode)
|
||||
(with-eval-after-load 'page-break-lines
|
||||
(diminish 'page-break-lines-mode)))
|
||||
|
||||
|
||||
|
||||
;; Shift lines up and down with M-up and M-down. When paredit is enabled,
|
||||
;; it will use those keybindings. For this reason, you might prefer to
|
||||
;; use M-S-up and M-S-down, which will work even in lisp modes.
|
||||
|
||||
(require-package 'move-dup)
|
||||
(global-set-key [M-S-up] 'move-dup-move-lines-up)
|
||||
(global-set-key [M-S-down] 'move-dup-move-lines-down)
|
||||
|
||||
(global-set-key (kbd "C-c d") 'move-dup-duplicate-down)
|
||||
(global-set-key (kbd "C-c u") 'move-dup-duplicate-up)
|
||||
|
||||
|
||||
;;; Fix backward-up-list to understand quotes, see http://bit.ly/h7mdIL
|
||||
|
||||
(defun sanityinc/backward-up-sexp (arg)
|
||||
"Jump up to the start of the ARG'th enclosing sexp."
|
||||
(interactive "p")
|
||||
(let ((ppss (syntax-ppss)))
|
||||
(cond ((elt ppss 3)
|
||||
(goto-char (elt ppss 8))
|
||||
(sanityinc/backward-up-sexp (1- arg)))
|
||||
((backward-up-list arg)))))
|
||||
|
||||
(global-set-key [remap backward-up-list] 'sanityinc/backward-up-sexp) ; C-M-u, C-M-up
|
||||
|
||||
|
||||
|
||||
;;; Cut/copy the current line if no region is active
|
||||
(require-package 'whole-line-or-region)
|
||||
(add-hook 'after-init-hook 'whole-line-or-region-global-mode)
|
||||
(with-eval-after-load 'whole-line-or-region
|
||||
(diminish 'whole-line-or-region-local-mode))
|
||||
|
||||
|
||||
|
||||
;; M-^ is inconvenient, so also bind M-j
|
||||
(global-set-key (kbd "M-j") 'join-line)
|
||||
|
||||
|
||||
;; Random line sorting
|
||||
(defun sanityinc/sort-lines-random (beg end)
|
||||
"Sort lines in region from BEG to END randomly."
|
||||
(interactive "r")
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(narrow-to-region beg end)
|
||||
(goto-char (point-min))
|
||||
(let ;; To make `end-of-line' and etc. to ignore fields.
|
||||
((inhibit-field-text-motion t))
|
||||
(sort-subr nil 'forward-line 'end-of-line nil nil
|
||||
(lambda (s1 s2) (eq (random 2) 0)))))))
|
||||
|
||||
|
||||
|
||||
(require-package 'highlight-escape-sequences)
|
||||
(add-hook 'after-init-hook 'hes-mode)
|
||||
|
||||
|
||||
(require-package 'which-key)
|
||||
(add-hook 'after-init-hook 'which-key-mode)
|
||||
(setq-default which-key-idle-delay 1.5)
|
||||
(with-eval-after-load 'which-key
|
||||
(diminish 'which-key-mode))
|
||||
|
||||
|
||||
(defun sanityinc/disable-features-during-macro-call (orig &rest args)
|
||||
"When running a macro, disable features that might be expensive.
|
||||
ORIG is the advised function, which is called with its ARGS."
|
||||
(let (post-command-hook
|
||||
font-lock-mode
|
||||
(tab-always-indent (or (eq 'complete tab-always-indent) tab-always-indent)))
|
||||
(apply orig args)))
|
||||
|
||||
(advice-add 'kmacro-call-macro :around 'sanityinc/disable-features-during-macro-call)
|
||||
|
||||
|
||||
(provide 'init-editing-utils)
|
||||
;;; init-editing-utils.el ends here
|
|
@ -1,6 +0,0 @@
|
|||
(require 'package)
|
||||
|
||||
;; We install seperate package repositories for each Emacs version to prevent bytecode incompatibility
|
||||
|
||||
; Standard Package repository
|
||||
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
|
|
@ -1,20 +0,0 @@
|
|||
(maybe-require-package 'evil)
|
||||
(maybe-require-package 'evil-collection)
|
||||
(maybe-require-package 'evil-goggles)
|
||||
|
||||
(setq
|
||||
evil-want-keybinding nil
|
||||
evil-want-C-u-scroll t
|
||||
evil-mode-beyond-eol t
|
||||
evil-mode-fine-undo t
|
||||
evil-undo-system 'undo-redo)
|
||||
|
||||
(evil-mode 1)
|
||||
|
||||
(evil-collection-init '(magit ibuffer)))
|
||||
|
||||
(setq evil-goggles-duration 0.15)
|
||||
(evil-goggles-mode t))
|
||||
|
||||
(provide 'init-evil)
|
||||
|
|
@ -1 +0,0 @@
|
|||
(use-package
|
|
@ -12,3 +12,6 @@
|
|||
(add-hook 'post-command-hook #'my-god-mode-update-cursor-type)
|
||||
|
||||
(define-key god-local-mode-map (kbd ".") #'repeat)
|
||||
|
||||
(provide 'init-god)
|
||||
;;; end of file init-god.el
|
||||
|
|
|
@ -15,32 +15,6 @@
|
|||
|
||||
|
||||
|
||||
;; Toggle between light and dark
|
||||
|
||||
(defun light ()
|
||||
"Activate a light color theme."
|
||||
(interactive)
|
||||
(setq custom-enabled-themes '(modus-operandi))
|
||||
(reapply-themes))
|
||||
|
||||
(defun dark ()
|
||||
"Activate a dark color theme."
|
||||
(interactive)
|
||||
(setq custom-enabled-themes '(modus-vivendi))
|
||||
(reapply-themes))
|
||||
|
||||
|
||||
(when (maybe-require-package 'dimmer)
|
||||
(setq-default dimmer-fraction 0.15)
|
||||
(setq dimmer-buffer-exclusion-regexps '(" \\*\\(LV\\|transient\\)\\*"
|
||||
"^ \\*.*posframe.*buffer.*\\*$"
|
||||
"^\\*Minibuf-[0-9]+\\*"
|
||||
"^.\\*which-key\\*$"
|
||||
"^.\\*Echo.*\\*"))
|
||||
(add-hook 'after-init-hook 'dimmer-mode)
|
||||
(with-eval-after-load 'dimmer
|
||||
(advice-add 'frame-set-background-mode :after (lambda (&rest args) (dimmer-process-all))))
|
||||
)
|
||||
|
||||
(provide 'init-themes)
|
||||
;;; init-themes.el ends here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue