From 3d4e9a0ecfc53beb95671b57d81c25457edc354e Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jun 2025 17:47:41 +0200 Subject: [PATCH] Move coding productivity related packages from configuration.org to init.el --- configuration.org | 129 ---------------------------------------------- init.el | 87 +++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 129 deletions(-) diff --git a/configuration.org b/configuration.org index 770859c..4cf0096 100644 --- a/configuration.org +++ b/configuration.org @@ -1,132 +1,3 @@ -* External packages to boost coding productivity - -** ~electric-operator~ to automatically add spaces around operators - -#+begin_src emacs-lisp -(use-package electric-operator - :config - ;; Apply electric-operator-mode to vala-mode, too - (apply #'electric-operator-add-rules-for-mode 'vala-mode - (electric-operator-get-rules-for-mode 'prog-mode)) - :hook - (c-mode-common . electric-operator-mode) - (python-mode . electric-operator-mode)) -#+end_src - -** ~rainbow-delimiters~ - -#+begin_src emacs-lisp -(use-package rainbow-delimiters - :hook - (prog-mode . rainbow-delimiters-mode)) -#+end_src - -** ~rainbow-identifiers~ - -#+begin_src emacs-lisp -(use-package rainbow-identifiers) -#+end_src - -** ~auto-highlight-symbol~ to hightlight current symbol - -Great help during refactoring. - -#+begin_src emacs-lisp -(use-package auto-highlight-symbol - :config - (global-auto-highlight-symbol-mode t)) -#+end_src - -** ~glasses~, to make ReallyLongCamelCaseWords more readable - -#+begin_src emacs-lisp -(use-package glasses - :delight " πŸ‘“" - :hook - (prog-mode . glasses-mode)) -#+end_src - -** ~hl-todo~ to highlight TODO comments - -#+begin_src emacs-lisp -(use-package hl-todo - :hook - (prog-mode . hl-todo-mode)) -#+end_src - -** ~bug-reference~ to turn bug/patch references to links - -#+begin_src emacs-lisp -(defvar gpolonkai/bug-reference-url-bug-string "issues" - "String to insert in a `bug-reference-url-format' for bug references.") - -(put 'gpolonkai/bug-reference-url-bug-string 'safe-local-variable 'stringp) - -(defvar gpolonkai/bug-reference-url-patch-string "merge_requests" - "String to insert in a `bug-reference-url-format' for patch references.") - -(defvar-local bug-reference-host "gitlab.com" - "The hostname to use in `bug-reference-url-format'.") - -(defvar-local bug-reference-group "gamesystems" - "The group name or username to use in `bug-reference-url-format'.") - -(defvar-local bug-reference-repository "game-app" - "The repository name to use in `bug-reference-url-format'.") - -(put 'gpolonkai/bug-reference-url-patch-string 'safe-local-variable 'stringp) - -(defun gpolonkai/bug-reference-url () - "Return a GitLab issue or Merge Request URL. -Intended as a value for `bug-referecne-url-format'." - (format "https://%s/%s/%s/%s/%s" - bug-reference-host - bug-reference-group - bug-reference-repository - (if (string-suffix-p "!" (match-string-no-properties 1)) - gpolonkai/bug-reference-url-patch-string - gpolonkai/bug-reference-url-bug-string) - (match-string-no-properties 2))) - -(use-package bug-reference - :custom - (bug-reference-bug-regexp (rx (group word-boundary - (: (| (: (in ?B ?b) "ug" (? " ") (? ?#)) - (: (in ?P ?p) "atch" (? " ") ?#) - (: "RFE" (? " ") ?#) - (: "PR " (+ (any "a-z+-")) "/") - (: "MR" (? " ") (? "!")))) - (group (+ (any "0-9")) (opt (: ?# (+ (any "0-9")))))))) - (bug-reference-url-format #'my-gitlab-url) - :hook - (text-mode . bug-reference-mode) - (prog-mode . bug-reference-prog-mode)) -#+end_src - -** ~highlight-indentation~ to highlight indentation levels - -#+begin_src emacs-lisp -(use-package highlight-indentation - :hook - (python-mode . highlight-indentation-mode)) -#+end_src - -** ~flycheck~ - -#+begin_src emacs-lisp -(use-package flycheck - :config - (global-flycheck-mode) - :custom - (flycheck-python-pylint-executable "python3")) -#+end_src - -** ~flycheck-pkg-config~ to aid FlyCheck using ~pkg-config~ - -#+begin_src emacs-lisp -(use-package flycheck-pkg-config) -#+end_src - * Utilities ** ~kubernetes~, a kubernetes dashboard diff --git a/init.el b/init.el index bc126df..a556466 100644 --- a/init.el +++ b/init.el @@ -1537,6 +1537,93 @@ order." (org-msg-greeting-fmt-mailto nil) (org-msg-signature "\n\nBest,\n\n,#+begin_signature\n-- *Gergely Polonkai* \\\\\n,#+end_signature")) +;; External packages to boost coding productivity + +(use-package electric-operator + :config + ;; Apply electric-operator-mode to vala-mode, too + (apply #'electric-operator-add-rules-for-mode 'vala-mode + (electric-operator-get-rules-for-mode 'prog-mode)) + :hook + (c-mode-common . electric-operator-mode) + (python-mode . electric-operator-mode)) + +(use-package rainbow-delimiters + :hook + (prog-mode . rainbow-delimiters-mode)) + +(use-package rainbow-identifiers) + +(use-package auto-highlight-symbol + :config + (global-auto-highlight-symbol-mode t)) + +(use-package glasses + :delight " πŸ‘“" + :hook + (prog-mode . glasses-mode)) + +(use-package hl-todo + :hook + (prog-mode . hl-todo-mode)) + +(defvar gpolonkai/bug-reference-url-bug-string "issues" + "String to insert in a `bug-reference-url-format' for bug references.") + +(put 'gpolonkai/bug-reference-url-bug-string 'safe-local-variable 'stringp) + +(defvar gpolonkai/bug-reference-url-patch-string "merge_requests" + "String to insert in a `bug-reference-url-format' for patch references.") + +(defvar-local bug-reference-host "gitlab.com" + "The hostname to use in `bug-reference-url-format'.") + +(defvar-local bug-reference-group "gamesystems" + "The group name or username to use in `bug-reference-url-format'.") + +(defvar-local bug-reference-repository "game-app" + "The repository name to use in `bug-reference-url-format'.") + +(put 'gpolonkai/bug-reference-url-patch-string 'safe-local-variable 'stringp) + +(defun gpolonkai/bug-reference-url () + "Return a GitLab issue or Merge Request URL. +Intended as a value for `bug-referecne-url-format'." + (format "https://%s/%s/%s/%s/%s" + bug-reference-host + bug-reference-group + bug-reference-repository + (if (string-suffix-p "!" (match-string-no-properties 1)) + gpolonkai/bug-reference-url-patch-string + gpolonkai/bug-reference-url-bug-string) + (match-string-no-properties 2))) + +(use-package bug-reference + :custom + (bug-reference-bug-regexp (rx (group word-boundary + (: (| (: (in ?B ?b) "ug" (? " ") (? ?#)) + (: (in ?P ?p) "atch" (? " ") ?#) + (: "RFE" (? " ") ?#) + (: "PR " (+ (any "a-z+-")) "/") + (: "MR" (? " ") (? "!")))) + (group (+ (any "0-9")) (opt (: ?# (+ (any "0-9")))))))) + (bug-reference-url-format #'my-gitlab-url) + :hook + (text-mode . bug-reference-mode) + (prog-mode . bug-reference-prog-mode)) + +(use-package highlight-indentation + :hook + (python-mode . highlight-indentation-mode)) + +(use-package flycheck + :config + (global-flycheck-mode) + :custom + (flycheck-python-pylint-executable "python3")) + +(use-package flycheck-pkg-config) + ;; I started moving my configuration to this Org file. It’s easier to document this way. (org-babel-load-file (expand-file-name "configuration.org" user-emacs-directory))