diff --git a/fschl-ide.org b/IDE.org similarity index 97% rename from fschl-ide.org rename to IDE.org index 0ec7da3..5a2075a 100644 --- a/fschl-ide.org +++ b/IDE.org @@ -1,5 +1,5 @@ #+title: Setup Fschl Ide Configuration -#+PROPERTY: header-args:emacs-lisp :tangle ./fschl-ide.el :mkdirp yes +#+PROPERTY: header-args:emacs-lisp :tangle ./modules/fschl-ide.el :mkdirp yes :tangle-mode "ugo=r" * Basic configuration ** Additional Packages diff --git a/fschl-org.org b/Orgmode.org similarity index 91% rename from fschl-org.org rename to Orgmode.org index 3b97d76..19c76d1 100644 --- a/fschl-org.org +++ b/Orgmode.org @@ -1,5 +1,5 @@ #+title: Setup Fschl Org Configuration -#+PROPERTY: header-args:emacs-lisp :tangle ./fschl-org.el :mkdirp yes +#+PROPERTY: header-args:emacs-lisp :tangle ./modules/fschl-org.el :mkdirp yes :tangle-mode "ugo=r" * Basic configuration ** Additional Packages @@ -37,7 +37,7 @@ https://github.com/minad/org-modern (keymap-global-set "C-c o a" #'org-agenda) (keymap-global-set "" #'org-cycle-agenda-files) - (keymap-global-set "" #'find-file org-default-notes-file) + ;(keymap-global-set "" #'find-file org-default-notes-file) #+end_src * Setup Agenda Files @@ -71,7 +71,7 @@ https://github.com/minad/org-modern ("PHONE" :foreground "forest green" :weight bold)))) #+end_src -* TODO Add Week to Calendar +* Add Week to Calendar - [ ] this should go into 'fschl-ui.el' @@ -95,7 +95,7 @@ https://github.com/minad/org-modern - https://orgmode.org/manual/Template-elements.html - https://orgmode.org/manual/Template-expansion.html -** TODO Export Letter +** TODO Export Letter [0/1] - [ ] hide behind a 'latex installed' guard #+begin_src emacs-lisp (eval-after-load 'ox '(require 'ox-koma-letter)) @@ -122,6 +122,28 @@ https://github.com/minad/org-modern (expand-file-name (format "%s.org" name) "~/Documents/letters/") )) #+end_src +** Org-Tempo shortcuts + +#+begin_src emacs-lisp + + ;; This is needed as of Org 9.2 + (use-package org-tempo + :ensure nil + :after org + :config + (dolist (item '(("sh" . "src sh") + ("el" . "src emacs-lisp") + ("li" . "src lisp") + ("sc" . "src scheme") + ("ts" . "src typescript") + ("py" . "src python") + ("go" . "src go") + ("einit" . "src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes") + ("emodule" . "src emacs-lisp :tangle ~/.config/emacs/modules/fschl-MODULE.el :mkdirp yes") + ("yaml" . "src yaml") + ("json" . "src json"))) + (add-to-list 'org-structure-template-alist item))) +#+end_src ** Capture Templates #+begin_src emacs-lisp (setq org-capture-templates diff --git a/TODO.org b/TODO.org index 09c67d1..f3fde7b 100644 --- a/TODO.org +++ b/TODO.org @@ -16,7 +16,7 @@ solution, e.g. set it up to auto-tangle all .org files within/below - State "HOLD" from "TODO" [2024-02-21 Wed 17:19] \\ would make it impossible to use the config on windows. windows compatiblity is the only reason to keep this separate from my =guix home= config -*** TODO refactor to use crafted-emacs as git-submodule +*** DONE refactor to use crafted-emacs as git-submodule *** TODO attempt windows-compatibility for work ** Missing Features @@ -45,7 +45,9 @@ is it possible to detect based on existing content? *** TODO make org-roam work with simple key chords -*** TODO beautify org-mode +*** CANCELLED beautify org-mode +- State "CANCELLED" from "TODO" [2024-04-18 Thu 14:08] \\ + org-modern is fine enough - https://zhangda.wordpress.com/2016/02/15/configurations-for-beautifying-emacs-org-mode/ - https://zzamboni.org/post/beautifying-org-mode-in-emacs/ - https://lucidmanager.org/productivity/ricing-org-mode/ diff --git a/init.el b/init.el index ba1de36..8f2f57e 100644 --- a/init.el +++ b/init.el @@ -19,6 +19,9 @@ (require 'crafted-writing-packages) (add-to-list 'package-selected-packages 'vterm) +(add-to-list 'package-selected-packages 'all-the-icons-dired) +(add-to-list 'package-selected-packages 'ranger) +(add-to-list 'package-selected-packages 'dired-ranger) (package-install-selected-packages :noconfirm) @@ -36,6 +39,16 @@ (unless crafted-startup-inhibit-splash (setq initial-buffer-choice #'crafted-startup-screen)) +(defvar dw/is-termux + (string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a")))) + +(defvar dw/is-guix-system (and (eq system-type 'gnu/linux) + (file-exists-p "/etc/os-release") + (with-temp-buffer + (insert-file-contents "/etc/os-release") + (search-forward "ID=guix" nil t)) + t)) + (keymap-global-unset "M-#") (define-key global-map (kbd "s-b") 'switch-to-buffer) @@ -44,12 +57,34 @@ (define-key global-map (kbd "s-o") 'other-window) (define-key global-map (kbd "C-z") nil) -(defvar fschl-org-file (expand-file-name "fschl-org.el" user-emacs-directory)) -(when (and fschl-org-file - (file-exists-p fschl-org-file)) - (load fschl-org-file nil :nomessage)) +(use-package all-the-icons-dired) +(use-package dired-ranger) -(defvar fschl-ide-file (expand-file-name "fschl-ide.el" user-emacs-directory)) -(when (and fschl-ide-file - (file-exists-p fschl-ide-file)) - (load fschl-ide-file nil :nomessage)) +(defun dw/dired-mode-hook () + (interactive) + (dired-hide-details-mode 0) + (unless (or dw/is-termux + (string-equal "/gnu/store/" (expand-file-name default-directory))) + (all-the-icons-dired-mode 1)) + (hl-line-mode 1)) + + +(use-package dired + :ensure nil + :bind (:map dired-mode-map + ("b" . dired-up-directory) + ("H" . dired-hide-details-mode)) + :config + (setq dired-listing-switches "-agho --group-directories-first" + dired-omit-files "^\\.[^.].*" + dired-omit-verbose nil + dired-dwim-target 'dired-dwim-target-next + dired-hide-details-hide-symlink-targets nil + dired-kill-when-opening-new-dired-buffer t + delete-by-moving-to-trash t) + + (add-hook 'dired-mode-hook #'dw/dired-mode-hook) + (global-set-key (kbd "s-j") #'dired-jump)) + +(load (expand-file-name "modules/fschl-ide.el" user-emacs-directory)) +(load (expand-file-name "modules/fschl-org.el" user-emacs-directory)) diff --git a/init.org b/init.org index 595d654..41e9d4e 100644 --- a/init.org +++ b/init.org @@ -1,5 +1,5 @@ #+title: Setup Crafted Emacs User Configuration File -#+PROPERTY: header-args:emacs-lisp :tangle ./init.el :mkdirp yes +#+PROPERTY: header-args:emacs-lisp :tangle ./init.el :mkdirp yes :tangle-mode "ugo=r" * Basic configuration @@ -27,8 +27,14 @@ (require 'crafted-ui-packages) (require 'crafted-ide-packages) (require 'crafted-writing-packages) +#+end_src +** Add more packages +#+begin_src emacs-lisp (add-to-list 'package-selected-packages 'vterm) + (add-to-list 'package-selected-packages 'all-the-icons-dired) + (add-to-list 'package-selected-packages 'ranger) + (add-to-list 'package-selected-packages 'dired-ranger) (package-install-selected-packages :noconfirm) #+end_src @@ -50,6 +56,24 @@ (setq initial-buffer-choice #'crafted-startup-screen)) #+end_src +** Identify the system + +Some of my personal configuration depends on the system we're running on. +- [ ] add windows + +#+begin_src emacs-lisp + +(defvar dw/is-termux + (string-suffix-p "Android" (string-trim (shell-command-to-string "uname -a")))) + +(defvar dw/is-guix-system (and (eq system-type 'gnu/linux) + (file-exists-p "/etc/os-release") + (with-temp-buffer + (insert-file-contents "/etc/os-release") + (search-forward "ID=guix" nil t)) + t)) + +#+end_src ** Custom key remap #+begin_src emacs-lisp @@ -61,16 +85,43 @@ (define-key global-map (kbd "s-o") 'other-window) (define-key global-map (kbd "C-z") nil) #+end_src -** Load my custom files -#+begin_src emacs-lisp - (defvar fschl-org-file (expand-file-name "fschl-org.el" user-emacs-directory)) - (when (and fschl-org-file - (file-exists-p fschl-org-file)) - (load fschl-org-file nil :nomessage)) - (defvar fschl-ide-file (expand-file-name "fschl-ide.el" user-emacs-directory)) - (when (and fschl-ide-file - (file-exists-p fschl-ide-file)) - (load fschl-ide-file nil :nomessage)) +** Dired + +#+begin_src emacs-lisp + + (use-package all-the-icons-dired) + (use-package dired-ranger) + + (defun dw/dired-mode-hook () + (interactive) + (dired-hide-details-mode 0) + (unless (or dw/is-termux + (string-equal "/gnu/store/" (expand-file-name default-directory))) + (all-the-icons-dired-mode 1)) + (hl-line-mode 1)) + + + (use-package dired + :ensure nil + :bind (:map dired-mode-map + ("b" . dired-up-directory) + ("H" . dired-hide-details-mode)) + :config + (setq dired-listing-switches "-agho --group-directories-first" + dired-omit-files "^\\.[^.].*" + dired-omit-verbose nil + dired-dwim-target 'dired-dwim-target-next + dired-hide-details-hide-symlink-targets nil + dired-kill-when-opening-new-dired-buffer t + delete-by-moving-to-trash t) + + (add-hook 'dired-mode-hook #'dw/dired-mode-hook) + (global-set-key (kbd "s-j") #'dired-jump)) #+end_src +** Load my custom files +#+begin_src emacs-lisp + (load (expand-file-name "modules/fschl-ide.el" user-emacs-directory)) + (load (expand-file-name "modules/fschl-org.el" user-emacs-directory)) +#+end_src diff --git a/fschl-ide.el b/modules/fschl-ide.el similarity index 100% rename from fschl-ide.el rename to modules/fschl-ide.el diff --git a/fschl-org.el b/modules/fschl-org.el similarity index 90% rename from fschl-org.el rename to modules/fschl-org.el index 87882be..07b99df 100644 --- a/fschl-org.el +++ b/modules/fschl-org.el @@ -22,7 +22,7 @@ (keymap-global-set "C-c o a" #'org-agenda) (keymap-global-set "" #'org-cycle-agenda-files) -(keymap-global-set "" #'find-file org-default-notes-file) +;(keymap-global-set "" #'find-file org-default-notes-file) (setq org-agenda-files (quote ("~/Documents/Org/inbox.org" @@ -84,6 +84,24 @@ (let ((name (read-string "Filename: "))) (expand-file-name (format "%s.org" name) "~/Documents/letters/") )) +;; This is needed as of Org 9.2 +(use-package org-tempo + :ensure nil + :after org + :config + (dolist (item '(("sh" . "src sh") + ("el" . "src emacs-lisp") + ("li" . "src lisp") + ("sc" . "src scheme") + ("ts" . "src typescript") + ("py" . "src python") + ("go" . "src go") + ("einit" . "src emacs-lisp :tangle ~/.config/emacs/init.el :mkdirp yes") + ("emodule" . "src emacs-lisp :tangle ~/.config/emacs/modules/fschl-MODULE.el :mkdirp yes") + ("yaml" . "src yaml") + ("json" . "src json"))) + (add-to-list 'org-structure-template-alist item))) + (setq org-capture-templates '(("t" "todo list item" entry (file+olp+datetree "~/Documents/Org/inbox.org") diff --git a/fschl-publish.el b/modules/fschl-publish.el similarity index 100% rename from fschl-publish.el rename to modules/fschl-publish.el