From f657642113e93f35e31d9d18dde5a465b4b0e781 Mon Sep 17 00:00:00 2001 From: KemoNine Date: Sat, 8 Apr 2023 10:09:49 -0400 Subject: [PATCH] add prefix to some custom function, tweak keymap to run dired in left side window, tweak keymap to have better 'select all' function ; add persp-mode back to allow restoring prior sessions via auto-save --- common/_global.el | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/common/_global.el b/common/_global.el index a7b6cf9..4e0b012 100644 --- a/common/_global.el +++ b/common/_global.el @@ -8,7 +8,7 @@ (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) ; this goes in chemacs2 init -- DO NOT UNCOMMENT (package-initialize) ; this goes in chemacs2 init -- DO NOT UNCOMMENT (add-to-list 'package-selected-packages - '(burly rainbow-mode rainbow-delimiters markdown-mode devdocs devdocs-browser focus zoom popwin dired-single diredfl xclip doominhibitinhibit-modeline magit helpful helm helm-org helm-ls-git dired-rainbow dired-rainbow-listing dired-single dash s origami modus-themes use-package) + '(persp-mode burly rainbow-mode rainbow-delimiters markdown-mode devdocs devdocs-browser focus zoom popwin dired-single diredfl xclip doominhibitinhibit-modeline magit helpful helm helm-org helm-ls-git dired-rainbow dired-rainbow-listing dired-single dash s origami modus-themes use-package) ) (require 'use-package) @@ -192,7 +192,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; modern home/end via C-a and C-e -(defun my--smart-beginning-of-line () +(defun kmn/my--smart-beginning-of-line () "Move point to `beginning-of-line'. If repeat command it cycle position between `back-to-indentation' and `beginning-of-line'." (interactive "^") @@ -202,11 +202,11 @@ position between `back-to-indentation' and `beginning-of-line'." (beginning-of-line)) (back-to-indentation))) -(defun my--smart-end-of-line () +(defun kmn/my--smart-end-of-line () "Move point to `end-of-line'. If repeat command it cycle position between last non-whitespace and `end-of-line'." (interactive "^") - (if (and (eq last-command 'my--smart-end-of-line) + (if (and (eq last-command 'kmn/my--smart-end-of-line) (= (line-end-position) (point))) (skip-syntax-backward " " (line-beginning-position)) (end-of-line))) @@ -231,9 +231,10 @@ position between last non-whitespace and `end-of-line'." (global-set-key (kbd "C-g") 'goto-line) (global-set-key (kbd "C-c u") 'toggle-truncate-lines) (global-set-key (kbd "C-o") 'helm-find-files) -(global-set-key (kbd "C-k") 'dired) -(global-set-key (kbd "C-a") 'my--smart-beginning-of-line) -(global-set-key (kbd "C-e") 'my--smart-end-of-line) +(global-set-key (kbd "C-k") 'kmn/dired-default-directory-on-left) +(global-set-key (kbd "M-a") 'mark-whole-buffer) +(global-set-key (kbd "C-a") 'kmn/my--smart-beginning-of-line) +(global-set-key (kbd "C-e") 'knn/my--smart-end-of-line) (global-set-key (kbd "C-c w") (lambda () (interactive) @@ -567,3 +568,11 @@ position between last non-whitespace and `end-of-line'." (global-set-key (kbd "C-x r k") 'bookmark-delete) (global-set-key (kbd "C-x r f") 'burly-bookmark-frames) (global-set-key (kbd "C-x r w") 'burly-bookmark-windows) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; persp-mode +(setq persp-auto-resume-time -1.0) +(with-eval-after-load "persp-mode-autoloads" + (setq wg-morph-on nil) ;; switch off animation + (setq persp-autokill-buffer-on-remove 'kill-weak) + (add-hook 'window-setup-hook #'(lambda () (persp-mode 1))))