From e0f70b1254a61299b9a6546bac31282d96969150 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 9 Sep 2023 20:59:30 +0300 Subject: devtools.el: Rename & Update keybindings --- .emacs.d/init.el | 8 +-- .emacs.d/modules/thanos-dev.el | 131 ------------------------------------ .emacs.d/modules/thanos-devtools.el | 131 ++++++++++++++++++++++++++++++++++++ 3 files changed, 135 insertions(+), 135 deletions(-) delete mode 100644 .emacs.d/modules/thanos-dev.el create mode 100644 .emacs.d/modules/thanos-devtools.el diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 3bfb6b5..de51c25 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -18,8 +18,8 @@ (define-prefix-command 'Create) (define-key thanos/applications-map (kbd "C-c") 'Create) -(global-set-key (kbd "") 'keyboard-escape-quit) - +(define-key global-map (kbd "") 'keyboard-escape-quit) +(define-key global-map (kbd "M-") 'backward-kill-sexp) (add-to-list 'load-path "~/.emacs.d/modules") @@ -31,9 +31,9 @@ (require 'thanos-commands) ;; Misc commands to manage vm's and others (require 'thanos-books) ;; pdf-tools, nov-mode (require 'thanos-chat) ;; telega, erc, ement -(require 'thanos-dev) ;; Completions, programming lang specific customization, chatgpt etc. +(require 'thanos-devtools) ;; Completions, programming lang specific customization, chatgpt etc. (require 'thanos-dired) ;; Dired theming and custom functions -(require 'thanos-mu4e) ;; email +(require 'thanos-mu4e) ;; Email client (require 'thanos-multimedia) ;; emms, yeetube (require 'thanos-elfeed) ;; RSS diff --git a/.emacs.d/modules/thanos-dev.el b/.emacs.d/modules/thanos-dev.el deleted file mode 100644 index eb8a2c0..0000000 --- a/.emacs.d/modules/thanos-dev.el +++ /dev/null @@ -1,131 +0,0 @@ -;;; thanos-dev.el --- Developer Tools Configuration -*- lexical-binding: t; -*- - -;; Copyright (C) 2023 Thanos Apollo - -;; Author: Thanos Apollo -;; Keywords: extensions - -;; This program is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with this program. If not, see . - -;;; Commentary: -;; ╭━━━━┳╮╱╱╱╱╱╱╱╱╱╱╱╱╱╱╭━━━╮╱╱╱╱╱╭╮╭╮╱╱╱╱╱╱╱╱╭━━━╮ -;; ┃╭╮╭╮┃┃╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭━╮┃╱╱╱╱╱┃┃┃┃╱╱╱╱╱╱╱╱┃╭━━╯ -;; ╰╯┃┃╰┫╰━┳━━┳━╮╭━━┳━━╮┃┃╱┃┣━━┳━━┫┃┃┃╭━━╮╱╱╱╱┃╰━━┳╮╭┳━━┳━━┳━━╮ -;; ╱╱┃┃╱┃╭╮┃╭╮┃╭╮┫╭╮┃━━┫┃╰━╯┃╭╮┃╭╮┃┃┃┃┃╭╮┃╭━━╮┃╭━━┫╰╯┃╭╮┃╭━┫━━┫ -;; ╱╱┃┃╱┃┃┃┃╭╮┃┃┃┃╰╯┣━━┃┃╭━╮┃╰╯┃╰╯┃╰┫╰┫╰╯┃╰━━╯┃╰━━┫┃┃┃╭╮┃╰━╋━━┃ -;; ╱╱╰╯╱╰╯╰┻╯╰┻╯╰┻━━┻━━╯╰╯╱╰┫╭━┻━━┻━┻━┻━━╯╱╱╱╱╰━━━┻┻┻┻╯╰┻━━┻━━╯ -;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃┃ -;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╰╯ -;;; Code: -(require 'corfu) -(require 'orderless) -(require 'dabbrev) - -;; Completions -(setf dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'")) - -(setf completion-category-overrides '((file (style basic partial-completion))) - completion-styles '(orderless) - completion-cycle-threshold 2) - -;; Corfu -(global-corfu-mode) -(corfu-popupinfo-mode) - -(setf corfu-auto t - corfu-auto-delay 0.1 - corfu-auto-prefix 2 - corfu-cycle t - corfu-popupinfo-delay 0 - corfu-quit-at-boundary 'separator - corfu-quit-no-match t - corfu-preselect 'first - corfu-preview-current t - corfu-echo-mode t) - -(setq indent-tabs-mode nil) - -;; Register -(define-key global-map (kbd "C-x r d") 'bookmark-delete) -(define-key global-map (kbd "C-x r C-r") 'bookmark-rename) -(define-key global-map (kbd "C-x r .") 'consult-register) -(define-key corfu-map (kbd "RET") nil) ;; Leave my enter alone - -(defun insert-brackets (&optional arg) - "Insert brackets." - (interactive "P") - (insert-pair arg ?\[ ?\])) - -(global-set-key (kbd "C-x M-[") 'insert-brackets) - -;; Magit -(require 'magit) - -(defun project-magit () - "Run magit-status in the current project's root." - (interactive) - (magit-status (project-root (project-current t)))) - -(define-key project-prefix-map (kbd "s") 'project-magit) - -(setf magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) -(define-prefix-command 'thanos/magit) -(global-set-key (kbd "C-c g") 'thanos/magit) -(define-key thanos/magit (kbd "c") 'magit-clone) - -;; shell scripting -(define-auto-insert - '("\\.sh\\'" . "Bash skeleton") - '("Description:" - "#!/bin/bash\n\n")) - -(add-hook 'shell-script-mode #'auto-insert) - -;; Emacs lisp -(setf tab-always-indent 'complete) -(add-to-list 'completion-styles 'initials t) - -(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode) -(add-hook 'emacs-lisp-mode-hook #'display-line-numbers-mode) - -;; Disable checkdoc flycheck for org-src buffers -(add-hook 'org-src-mode-hook #'(lambda () - (flycheck-disable-checker 'emacs-lisp-checkdoc))) - -;; Common lisp -(setf inferior-lisp-program "sbcl") -(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode) - -;; Scheme -(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode) - -;; Python -(require 'python-mode) -(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) -(add-hook 'python-mode #'eglot) - -;; json -(require 'json-mode) -(add-to-list 'auto-mode-alist '("\\.json'" . json-mode)) - -;; ChatGPT -(require 'gptel) - -(define-key 'thanos/applications-map (kbd "c") 'gptel-send) - -(setf gptel-api-key (password-store-get "chatgpt/api") - gptel-model 'gpt-4-32k) - -(provide 'thanos-dev) -;;; thanos-dev.el ends here diff --git a/.emacs.d/modules/thanos-devtools.el b/.emacs.d/modules/thanos-devtools.el new file mode 100644 index 0000000..111e8c7 --- /dev/null +++ b/.emacs.d/modules/thanos-devtools.el @@ -0,0 +1,131 @@ +;;; thanos-dev.el --- Developer Tools Configuration -*- lexical-binding: t; -*- + +;; Copyright (C) 2023 Thanos Apollo + +;; Author: Thanos Apollo +;; Keywords: extensions + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: +;; ╭━━━━┳╮╱╱╱╱╱╱╱╱╱╱╱╱╱╱╭━━━╮╱╱╱╱╱╭╮╭╮╱╱╱╱╱╱╱╱╭━━━╮ +;; ┃╭╮╭╮┃┃╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃╭━╮┃╱╱╱╱╱┃┃┃┃╱╱╱╱╱╱╱╱┃╭━━╯ +;; ╰╯┃┃╰┫╰━┳━━┳━╮╭━━┳━━╮┃┃╱┃┣━━┳━━┫┃┃┃╭━━╮╱╱╱╱┃╰━━┳╮╭┳━━┳━━┳━━╮ +;; ╱╱┃┃╱┃╭╮┃╭╮┃╭╮┫╭╮┃━━┫┃╰━╯┃╭╮┃╭╮┃┃┃┃┃╭╮┃╭━━╮┃╭━━┫╰╯┃╭╮┃╭━┫━━┫ +;; ╱╱┃┃╱┃┃┃┃╭╮┃┃┃┃╰╯┣━━┃┃╭━╮┃╰╯┃╰╯┃╰┫╰┫╰╯┃╰━━╯┃╰━━┫┃┃┃╭╮┃╰━╋━━┃ +;; ╱╱╰╯╱╰╯╰┻╯╰┻╯╰┻━━┻━━╯╰╯╱╰┫╭━┻━━┻━┻━┻━━╯╱╱╱╱╰━━━┻┻┻┻╯╰┻━━┻━━╯ +;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱┃┃ +;; ╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╱╰╯ +;;; Code: +(require 'corfu) +(require 'orderless) +(require 'dabbrev) + +;; Completions +(setf dabbrev-ignored-buffer-regexps '("\\.\\(?:pdf\\|jpe?g\\|png\\)\\'")) + +(setf completion-category-overrides '((file (style basic partial-completion))) + completion-styles '(orderless) + completion-cycle-threshold 2) + +;; Corfu +(global-corfu-mode) +(corfu-popupinfo-mode) + +(setf corfu-auto t + corfu-auto-delay 0.1 + corfu-auto-prefix 2 + corfu-cycle t + corfu-popupinfo-delay 0 + corfu-quit-at-boundary 'separator + corfu-quit-no-match t + corfu-preselect 'first + corfu-preview-current t + corfu-echo-mode t) + +(setf indent-tabs-mode nil) + +;; Register +(define-key global-map (kbd "C-x r d") 'bookmark-delete) +(define-key global-map (kbd "C-x r C-r") 'bookmark-rename) +(define-key global-map (kbd "C-x r .") 'consult-register) +(define-key corfu-map (kbd "RET") nil) ;; Leave my enter alone + +(defun insert-brackets (&optional arg) + "Insert brackets." + (interactive "P") + (insert-pair arg ?\[ ?\])) + +(global-set-key (kbd "C-x M-[") 'insert-brackets) + +;; Magit +(require 'magit) + +(defun project-magit () + "Run magit-status in the current project's root." + (interactive) + (magit-status (project-root (project-current t)))) + +(define-key project-prefix-map (kbd "s") 'project-magit) + +(setf magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) +(define-prefix-command 'thanos/magit) +(global-set-key (kbd "C-c g") 'thanos/magit) +(define-key thanos/magit (kbd "c") 'magit-clone) + +;; shell scripting +(define-auto-insert + '("\\.sh\\'" . "Bash skeleton") + '("Description:" + "#!/bin/bash\n\n")) + +(add-hook 'shell-script-mode #'auto-insert) + +;; Emacs lisp +(setf tab-always-indent 'complete) +(add-to-list 'completion-styles 'initials t) + +(add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode) +(add-hook 'emacs-lisp-mode-hook #'display-line-numbers-mode) + +;; Disable checkdoc flycheck for org-src buffers +(add-hook 'org-src-mode-hook #'(lambda () + (flycheck-disable-checker 'emacs-lisp-checkdoc))) + +;; Common lisp +(setf inferior-lisp-program "sbcl") +(add-hook 'lisp-mode-hook #'rainbow-delimiters-mode) + +;; Scheme +(add-hook 'scheme-mode-hook #'rainbow-delimiters-mode) + +;; Python +(require 'python-mode) +(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode)) +(add-hook 'python-mode #'eglot) + +;; json +(require 'json-mode) +(add-to-list 'auto-mode-alist '("\\.json'" . json-mode)) + +;; ChatGPT +(require 'gptel) + +(define-key 'thanos/applications-map (kbd "c") 'gptel-send) + +(setf gptel-api-key (password-store-get "chatgpt/api") + gptel-model 'gpt-4-32k) + +(provide 'thanos-devtools) +;;; thanos-devtools.el ends here -- cgit v1.2.3