diff options
author | Yuchen Pei <id@ypei.org> | 2023-06-26 15:17:20 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-06-26 15:17:20 +1000 |
commit | ea1e815c3dc1781aa5cb6d401e233c73fa8a108b (patch) | |
tree | 189aa1cc44277f5c298eed5230c4ae2784fafeec /emacs/.emacs.d/init/ycp-editing.el | |
parent | f77444c030038100908e298666f8f84f85e768cb (diff) |
Adapted more configs from other emacs configs
Including wasamasa and jwiegley
Diffstat (limited to 'emacs/.emacs.d/init/ycp-editing.el')
-rw-r--r-- | emacs/.emacs.d/init/ycp-editing.el | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/emacs/.emacs.d/init/ycp-editing.el b/emacs/.emacs.d/init/ycp-editing.el index ab1bc9e..7af3587 100644 --- a/emacs/.emacs.d/init/ycp-editing.el +++ b/emacs/.emacs.d/init/ycp-editing.el @@ -3,8 +3,6 @@ ;; Copyright (C) 2023 Free Software Foundation. ;; Author: Yuchen Pei <id@ypei.org> -;; Protesilaos Stavrou <info@protesilaos.com> -;; Maintainer: Yuchen Pei <id@ypei.org> ;; Package-Requires: ((emacs "28.2")) ;; This file is part of dotfiles. @@ -40,13 +38,15 @@ (setq show-paren-delay 0) (setq window-divider-default-bottom-width 1) (setq window-divider-default-places 'bottom-only) -(define-key input-decode-map [?\C-m] [C-m]) ; don't interpret C-m as RET +;; don't interpret C-m as RET +(define-key input-decode-map [?\C-m] [C-m]) +(setq save-place-file (locate-user-emacs-file "saveplace")) (my-package my-editing (:delay 5) (my-keybind global-map - "C-k" #'my-kill-forward - "M-k" #'my-kill-backward + "C-k" #'my-kill-line + "M-k" #'my-kill-line-backward "M-w" #'my-copy-line-or-region "C-o" #'my-new-line-above-or-below "C-<" #'my-escape-url-dwim @@ -66,9 +66,9 @@ "C-M-y" #'my-yank-primary "C-a" #'my-beginning-of-line-or-indentation "M-c" #'my-copy-buffer-file-name ; override capitalize - "M-o" #'delete-blank-lines ; alias for C-x C-o + "M-o" #'delete-blank-lines ; alias for C-x C-o "M-SPC" #'cycle-spacing - "M-z" #'zap-up-to-char ; NOT `zap-to-char' + "M-z" #'zap-up-to-char ; NOT `zap-to-char' "<C-M-backspace>" #'backward-kill-sexp ) (electric-pair-mode) @@ -118,7 +118,10 @@ (define-key global-map (kbd "C-x F") 'my-sudo-find-file) ;; find file -(ffap-bindings) +(my-package ffap + (ffap-bindings) + ;; Stop ffap from pinging things that look like domain names + (setq ffap-machine-p-known 'accept)) (put 'narrow-to-region 'disabled nil) @@ -128,8 +131,14 @@ (setq version-control t) (add-hook 'text-mode-hook #'turn-on-auto-fill) + +(my-add-hooks #'my-non-special-modes-setup '(text-mode prog-mode)) + (add-to-list 'auto-mode-alist '("\\(README\\|CHANGELOG\\|COPYING\\|LICENSE\\)\\'" . text-mode)) (add-hook 'before-save-hook 'time-stamp) + +(save-place-mode 1) + (provide 'ycp-editing) |