From ea1e815c3dc1781aa5cb6d401e233c73fa8a108b Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Mon, 26 Jun 2023 15:17:20 +1000 Subject: Adapted more configs from other emacs configs Including wasamasa and jwiegley --- emacs/.emacs.d/init/ycp-editing.el | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'emacs/.emacs.d/init/ycp-editing.el') 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 -;; Protesilaos Stavrou -;; Maintainer: Yuchen Pei ;; 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' "" #'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) -- cgit v1.2.3