diff options
| author | tslil clingman <tslil@posteo.de> | 2024-07-08 10:25:18 +0200 |
|---|---|---|
| committer | tslil clingman <tslil@posteo.de> | 2024-07-08 10:28:29 +0200 |
| commit | 2d366c23976bf8735fd192c0c716f2c4821b718a (patch) | |
| tree | ecc2aac3460a4bfae46d461a9cfc19508e0f3848 | |
| parent | dee97a1838e82772abe745b18772e5d58ff1884a (diff) | |
[emacs] cleanup
| -rw-r--r-- | emacs/inits/23-text-related.el | 78 | ||||
| -rw-r--r-- | emacs/inits/70-global-keybinds.el | 29 |
2 files changed, 36 insertions, 71 deletions
diff --git a/emacs/inits/23-text-related.el b/emacs/inits/23-text-related.el index 7142980..162c29f 100644 --- a/emacs/inits/23-text-related.el +++ b/emacs/inits/23-text-related.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2024-05-26 11h27 CEST (00c25734)> +;; Time-stamp: <2024-07-08 10h18 CEST (anker)> ;; ----------------------------------------------------------------------------- ;; Spelling @@ -17,16 +17,10 @@ font-lock-keyword-face font-lock-function-name-face font-lock-variable-name-face))) -(setq sentence-end-double-space nil) -(add-hook 'mail-mode-hook (lambda () - (electric-pair-local-mode 1) - (turn-on-auto-fill) - (spell-fu-mode 1) - (company-mode 1))) +(setq sentence-end-double-space nil) (add-hook 'text-mode-hook (lambda () - ;; (set-input-method "Adga") (subword-mode 1) (electric-pair-local-mode 1) (turn-on-auto-fill) @@ -35,75 +29,25 @@ (use-package dictionary :ensure t :defer t) -(use-package ereader :ensure t :defer - :mode (("\\.epub$" . nov-mode))) - ;; ----------------------------------------------------------------------------- ;; Markdown (use-package markdown-mode :ensure t :defer t - :mode (("\\.md'" . markdown-mode)) :hook (markdown-mode . (lambda () (auto-fill-mode -1) (visual-line-mode)))) - ;; ----------------------------------------------------------------------------- ;; Org -;; (use-package org -;; :defer t -;; :bind (:map org-mode-map -;; ("M-h" . nil)) -;; ;; :hook (org-mode . (lambda () -;; ;; (activate-input-method default-input-method))) -;; :config -;; (setq org-use-sub-superscripts (quote {}) -;; org-modules nil)) - - -;; ----------------------------------------------------------------------------- -;; Deft - -;; (use-package deft -;; :ensure t -;; :defer t -;; :commands (deft) -;; :bind (("C-c C-z" . deft)) -;; :config -;; (setq deft-default-extension "md" -;; deft-directory "~/notes" -;; deft-use-filename-as-title nil -;; deft-use-filter-string-for-filename t -;; deft-file-naming-rules '((noslash . "_") -;; (nospace . "_") -;; (case-fn . downcase)) -;; deft-org-mode-title-prefix t) -;; ) - -;; ----------------------------------------------------------------------------- -;; Useful keybinds - -(defun vi-open-line-above () - "Insert a newline above the current line and put point at beginning." - (interactive) - (unless (bolp) - (beginning-of-line)) - (newline) - (forward-line -1) - (indent-according-to-mode)) - -(defun vi-open-line-below () - "Insert a newline below the current line and put point at beginning." - (interactive) - (unless (eolp) - (end-of-line)) - (newline-and-indent)) - -(global-set-key (kbd "M-o") 'vi-open-line-below) -(global-set-key (kbd "C-o") 'vi-open-line-above) - -(global-set-key (kbd "M-C-+") 'text-scale-increase) -(global-set-key (kbd "M-C--") 'text-scale-decrease) +(use-package org + :defer t + :bind (:map org-mode-map + ("M-h" . nil)) + ;; :hook (org-mode . (lambda () + ;; (activate-input-method default-input-method))) + :config + (setq org-use-sub-superscripts (quote {}) + org-modules nil)) diff --git a/emacs/inits/70-global-keybinds.el b/emacs/inits/70-global-keybinds.el index 1e3657e..045e62f 100644 --- a/emacs/inits/70-global-keybinds.el +++ b/emacs/inits/70-global-keybinds.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2023-08-29 09h09 CEST (anker)> +;; Time-stamp: <2024-07-08 10h27 CEST (anker)> (setq time-stamp-active t time-stamp-line-limit 3 @@ -20,6 +20,7 @@ (insert (concat "Time-stamp: " "<>")) (newline)) (time-stamp))) + (global-set-key (kbd "C-x t") 'insert-timestamp) (global-set-key (kbd "C-z") 'nil) @@ -34,14 +35,34 @@ (global-set-key (kbd "M-i") 'indent-region) -(global-set-key (kbd "C-v") 'delete-indentation) - ;; ----------------------------------------------------------------------------- ;; Killing + (global-set-key (kbd "C-c C-k") 'kill-whole-line) (global-set-key (kbd "M-z") 'zap-up-to-char) -(defun kill-region-or-backward-kill-word (arg) +(defun better-backward-kill-word (arg) (interactive "p") (if (region-active-p) (kill-region 0 0 t) (backward-kill-word arg))) + +(global-set-key (kdb "M-h") 'better-backward-kill-word) +(global-set-key (kbd "M-<Backspace>") 'better-backward-kill-word) + +;; ----------------------------------------------------------------------------- +;; Line entry + +(defun vi-open-line-below () + "Insert a newline below the current line and put point at beginning." + (interactive) + (unless (eolp) + (end-of-line)) + (newline-and-indent)) + +(global-set-key (kbd "M-o") 'vi-open-line-below) + +;; ----------------------------------------------------------------------------- +;; Zoom! Enhance! + +(global-set-key (kbd "M-C-+") 'text-scale-increase) +(global-set-key (kbd "M-C--") 'text-scale-decrease) |
