diff options
author | mms <michal@sapka.me> | 2024-01-19 15:22:13 +0100 |
---|---|---|
committer | mms <michal@sapka.me> | 2024-01-19 15:22:13 +0100 |
commit | 9ab57ee255a03b86ed7303aa94959e3b104e1719 (patch) | |
tree | 926293dc6d9460f1eab12231573b71abc8d5ac4e |
feat: extract into dedicated repo
-rw-r--r-- | .gitignore | 9 | ||||
-rw-r--r-- | config.org | 54 | ||||
-rw-r--r-- | early-init.el | 10 | ||||
-rw-r--r-- | init.el | 32 | ||||
-rw-r--r-- | mms-configuration.org | 193 | ||||
-rw-r--r-- | mms-gui.org | 155 | ||||
-rw-r--r-- | mms-keyboard.org | 134 | ||||
-rw-r--r-- | mms-misc-rss.org | 138 | ||||
-rw-r--r-- | mms-misc.org | 57 | ||||
-rw-r--r-- | mms-ox-publish.org | 71 | ||||
-rw-r--r-- | mms-ox-sprints.org | 61 | ||||
-rw-r--r-- | mms-ox.org | 83 | ||||
-rw-r--r-- | mms-prog-ruby.org | 49 | ||||
-rw-r--r-- | mms-prog.org | 72 |
14 files changed, 1118 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f6021e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +* + +!.gitignore +!init.el +!config.org +!early-init.el +!mms*org +!mms*/* + diff --git a/config.org b/config.org new file mode 100644 index 0000000..be397bb --- /dev/null +++ b/config.org @@ -0,0 +1,54 @@ +#+TITLE: Michał Sapka's Emacs Config +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + + +* General configuration + +** Treesitter + +Tresitter has huge problems working on FreeBSD. In my case it just throws errors around unsupported system type. +I'll return here on a later date + +*** TODO retry Trisitter on FreeBSD + +** Varia + +#+BEGIN_SRC emacs-lisp + (setq vc-follow-symlinks t) +#+END_SRC + + +* LSP + +I use Eglot for using LSPs. They are not perfect, but still very usable + +#+BEGIN_SRC emacs-lisp +(require 'eglot) +#+END_SRC + +** Ltex-ls + +#+BEGIN_SRC emacs-lisp + (with-eval-after-load 'eglot + (add-to-list 'eglot-server-programs + '(text-mode . ("doas" "jexec" "ltex" "/root/ltex/bin/ltex-ls"))) + + (setq-default eglot-workspace-configuration + '(:ltex (:additionalRules (:languageModel "/var/ngrams/"))))) +#+END_SRC + +* Writing + +** Markdown mode + +#+BEGIN_SRC emacs-lisp +(use-package markdown-mode) +#+END_SRC + + +* Local setup + +#+begin_src emacs-lisp + (load-file "~/.emacs.d/config_local.el") +#+end_src diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..ac0e195 --- /dev/null +++ b/early-init.el @@ -0,0 +1,10 @@ +;; Example Elpaca early-init.el -*- lexical-binding: t; -*- + +(setq package-enable-at-startup nil) +(setq vc-follow-symlinks t) + +;; Local Variables: +;; no-byte-compile: t +;; no-native-compile: t +;; no-update-autoloads: t +;; End: @@ -0,0 +1,32 @@ +(org-babel-load-file "~/.emacs.d/mms-configuration.org") +(org-babel-load-file "~/.emacs.d/mms-keyboard.org") +(org-babel-load-file "~/.emacs.d/mms-gui.org") + +(org-babel-load-file "~/.emacs.d/config.org") + + +(org-babel-load-file "~/.emacs.d/mms-prog.org") +(org-babel-load-file "~/.emacs.d/mms-prog-ruby.org") + +(org-babel-load-file "~/.emacs.d/mms-ox.org") +(org-babel-load-file "~/.emacs.d/mms-ox-sprints.org") +(org-babel-load-file "~/.emacs.d/mms-ox-publish.org") + +(org-babel-load-file "~/.emacs.d/mms-misc.org") +(org-babel-load-file "~/.emacs.d/mms-misc-rss.org") + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(auth-source-save-behavior nil) + '(mml-secure-openpgp-sign-with-sender t) + '(safe-local-variable-values '((org-num-skip-tags "UNNUMBERED")))) +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) +(put 'narrow-to-region 'disabled nil) diff --git a/mms-configuration.org b/mms-configuration.org new file mode 100644 index 0000000..63b9e1c --- /dev/null +++ b/mms-configuration.org @@ -0,0 +1,193 @@ +#+TITLE: mms Emacs Config - General settings +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 10 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Genral settings" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - general config" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "Just some basic stuff" +#+EXPORT_FILE_NAME: configuration + +This file sets generic things around my Emacs config. +All other files rely on this. + +* Lexical binding + +#+BEGIN_SRC emacs-lisp + ;;; -*- lexical-binding: t -*- +#+END_SRC + +* Basic configuration + +I want to use UTF-8 everywhere + +#+BEGIN_SRC emacs-lisp + (prefer-coding-system 'utf-8) + (set-default-coding-systems 'utf-8) + (set-language-environment "UTF-8") + (setq require-final-newline t) +#+END_SRC + +Emacs has this terrible habbit of wanting to write "yes" or "no" to confirm different things. +This changes it to simple "y" and "n" + +#+begin_src emacs-lisp + (setopt use-short-answers t) +#+end_src + +I will save a lot files in my temporary filder. + +#+begin_src emacs-lisp + (defvar mms-tmp-dir (concat (user-login-name) "/tmp")) + (make-directory mms-tmp-dir t) +#+end_src + +I don't want to pollute each and every one of my folders, so I'm keeping all backup files in one place. +On each of my systems I have a =~/tmp= folder just for custom temporary file. + +#+begin_src emacs-lisp + (setq backup-directory-alist `((".*" . ,mms-tmp-dir))) + (setq auto-save-file-name-transforms `((".*" ,mms-tmp-dir t))) +#+end_src + +Tramp can get /even slower/ with file locks, so I disable those +Or at least this is what I've been told. + +#+begin_src emacs-lisp + (setq remote-file-name-inhibit-locks t) +#+end_src + +Tabs, what are they good for? +Absolutelly nothing! +Let's use spaces everywhere + +#+begin_src emacs-lisp + (setq-default indent-tabs-mode nil) +#+end_src +* Package management + +Recently, I have migrated to Elpaca. +A lot of emacsers tend to use Straight, but Elpaca seems more modern with asynchronous loading of packages. +This, of course, is a can of worms. + +#+BEGIN_SRC emacs-lisp + (defvar elpaca-installer-version 0.6) + (defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) + (defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) + (defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) + (defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil + :files (:defaults (:exclude "extensions")) + :build (:not elpaca--activate-package))) + (let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (when (< emacs-major-version 28) (require 'subr-x)) + (condition-case-unless-debug err + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (call-process "git" nil buffer t "clone" + (plist-get order :repo) repo))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (kill-buffer buffer) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (load "./elpaca-autoloads"))) + (add-hook 'after-init-hook #'elpaca-process-queues) + (elpaca `(,@elpaca-order)) + #+end_src + +#+begin_src emacs-lisp + (elpaca elpaca-use-package + ;; Enable :elpaca use-package keyword. + (elpaca-use-package-mode) + ;; Assume :elpaca t unless otherwise specified. + (setq elpaca-use-package-by-default t)) +#+end_src + +We need to wait here for elpaca to actually load. +We will see this pattern again. + +#+begin_src emacs-lisp + (elpaca-wait) +#+end_src + +* Auto-complete in minibuffer + +Having autocomplete in emacs is one of most important things. +I've used =ido= before, but now I'm trying =vertico=. +I don't want a big plugin here, like helm. + +I left the optional params here from the tutorial in case I want to get /fancy/. + +#+begin_src emacs-lisp + (use-package vertico + :init + (vertico-mode) + + ;; Different scroll margin + ;; (setq vertico-scroll-margin 0) + + ;; Show more candidates + ;; (setq vertico-count 20) + + ;; Grow and shrink the Vertico minibuffer + ;; (setq vertico-resize t) + ) +#+end_src + +Marginalia adds extra information to the list + +#+begin_src emacs-lisp +(use-package marginalia + :init + (marginalia-mode)) +#+end_src + +* Variables + +I use two machines on different OSes (personal on FreeBSD and work on MacOS). +On a few occasions, I will use device to use correct behavior. + +#+begin_src emacs-lisp + (setq mms-is-voyager (string= (system-name) "voyager")) + (setq mms-is-mac (string= (system-name) "RN90Y7RDHT")) +#+end_src + +* Line numbering + +Most of the time, I want my line numbers. +I use Evil after all. + +But sometimes they are not needed. + +#+begin_src emacs-lisp + (defun mms-hide-line-numbers() + (interactive) + (display-line-numbers-mode 0)) +#+end_src + +* Allow for diminished mode + +Emacs is based od modes which may pollute the modeline. +Dimish will hide them from the modeline, even if they are enabled. + +#+begin_src emacs-lisp + (use-package diminish + :elpaca t) +#+end_src diff --git a/mms-gui.org b/mms-gui.org new file mode 100644 index 0000000..b7dcdc3 --- /dev/null +++ b/mms-gui.org @@ -0,0 +1,155 @@ +#+TITLE: mms Emacs Config - GUI look and feel +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 20 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name GUI +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - GUI look and feel" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "The way Emacs look in gui mode" +#+EXPORT_FILE_NAME: gui + +Here I set up how emacs looks when in GUI mode. + +* Generic thingies + +Let's start with some basic settings. + +#+BEGIN_SRC emacs-lisp + (tool-bar-mode -1) ; I am not a clicky button person + (setq visible-bell nil) ; I am also not a "scream at me" type of guy +#+END_SRC + +* Fonts + +I like to have readable fonts in all possible situations. +I never use two monitors at the same time due to space restrictions, so I just have two modes: clamshell (lid closed, only external display) and laptop (laptop undocked, only internal monitor is in use). +Having DPI problems on Xorg is always a thing, so it's easier to have explicit functions. +It's not my idea, all credits go to [[https://howardabrams.com/hamacs/ha-display.html][Howard Adams]]. + +I use Iosevka font. +It's a 2GiB [sic!] download, but I like the way it looks. +It is also available for FreeBSD and macOS: + +#+begin_src shell + doas pkg install iosevka # for FreeBSD + brew install iosevka # for MacOS +#+end_src + +#+begin_src emacs-lisp + (defun mms-mac-clamshell-font-mode () + ;; Set fonts for Macbook in clamshell mode + (interactive) + (set-face-attribute 'default nil :font "iosevka" :height 135)) + + (defun mms-mac-laptop-font-mode () + ;; Set fonts for Macbook in laptop mode + (interactive) + (set-face-attribute 'default nil :font "iosevka" :height 115)) + + (defun mms-voyager-clamshell-font-mode () + ;; Set fonts for Voyager in clamshell mode + (interactive) + (set-face-attribute 'default nil :font "iosevka" :height 135)) + + (defun mms-voyager-laptop-font-mode () + ;; Set fonts for Voyager in clamshell mode + (interactive) + (set-face-attribute 'default nil :font "iosevka" :height 115)) +#+end_src + +* Colors + +I, like everybody, like pretty colors. +I have no idea what it means. +All I know is that orange is a fruit, and not a color. +This is 1:1 copy of what [[https://howardabrams.com/hamacs/ha-display.html#orgb97059f][Howard Adams]] uses. + +#+begin_src emacs-lisp + (use-package color-theme-sanityinc-tomorrow + :ensure t) + + (defun mms-dark-room-mode() + (interactive) + (load-theme 'sanityinc-tomorrow-night t) + (set-face-attribute 'region nil :background "#000096") + (set-face-attribute 'mode-line nil :background "black") + (set-face-attribute 'mode-line-inactive nil :background "#444444")) + + (defun mms-light-room-mode () + (interactive) + (load-theme 'sanityinc-tomorrow-day t) + (set-face-attribute 'region nil :background "orange1") + (set-face-attribute 'mode-line nil :background "#cccccc") + (set-face-attribute 'mode-line-inactive nil :background "#888888")) +#+end_src + +* Auto-setup + +For most of the day I use my work MacBook (and I am just as sad as you are reading it) and I have a window behind me. +This makes using dark more impossible for most of the year, so light-room mode is the default there. +In the evening I move to my personal computer, and since the Sun is longer the problem (screw you, Sun!) I run dark room as default there. + +#+begin_src emacs-lisp + (defun mms-default-mac-mode () + (interactive) + (mms-light-room-mode) + (mms-mac-clamshell-font-mode)) + + (defun mms-default-voyager-mode () + (interactive) + (mms-light-room-mode) + (mms-voyager-clamshell-font-mode)) +#+end_src + +Lets auto enable those on Emacs start + +By default, all devices run in external-monitor mode, so I will call respective function in local configs. + +#+begin_src emacs-lisp + (with-eval-after-load 'color-theme-sanityinc-tomorrow + (if mms-is-voyager (mms-default-voyager-mode) (mms-default-mac-mode))) +#+end_src + +* Org-mode + +First of all, let's disable presenting emphasis markers + +#+begin_src emacs-lisp + (setq org-hide-emphasis-markers t) +#+end_src + +After that - I don't need line numbers + +#+begin_src emacs-lisp + (add-hook 'org-mode-hook (lambda () (mms-hide-line-numbers))) +#+end_src + +Then, let's add nice bullets + +#+begin_src emacs-lisp + (use-package org-bullets + :config + (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) +#+end_src + +Then, I want my headings to differ only by size. +I am no a fan of default xmass tree. + +#+begin_src emacs-lisp + (setq mms-org-font-color (face-foreground 'default nil 'default) + mms-org-headline `(:inherit default :weight bold :foreground ,mms-org-font-color) + ) + + (custom-set-faces + '(org-level-1 ((t (:inherit mms-org-headline :height 1.75)))) + '(org-level-2 ((t (:inherit mms-org-headline :height 1.5)))) + '(org-level-3 ((t (:inherit mms-org-headline :height 1.25)))) + '(org-level-4 ((t (:inherit mms-org-headline :height 1.1)))) + '(org-level-5 ((t (:inherit mms-org-headline :height 1.0)))) + `(org-document-title ((t (:inherit mms-org-headline :height 2.0)))) + ) +#+end_src + diff --git a/mms-keyboard.org b/mms-keyboard.org new file mode 100644 index 0000000..1d0e9a6 --- /dev/null +++ b/mms-keyboard.org @@ -0,0 +1,134 @@ +#+TITLE: mms's Emacs Config - Keyboard configuration +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdoneGeneral settings + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 10 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - keyboard config" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "evil mode, basic key bindings and misc" +#+EXPORT_FILE_NAME: keyboard + +* Evil mode + +I've been using Vim for a long time so those keybindings are a must. +My last attempt to use Emacs failed as I decided to learn Emacs native keybindings. +While those aren't *bad*, I much prefer the classic VIM style. +This time I am starting with Evil so anything I add to this config will be configured with those bindings at day 1. + +#+BEGIN_SRC emacs-lisp + (use-package evil + :elpaca t + :ensure t + :init + (setq evil-want-keybinding nil + evil-vsplit-window-right t + evil-split-window-below t) + :config + (evil-mode 1)) +#+END_SRC + +* Which key + +WK adds a on-the-fly cheatsheet. + +#+begin_src emacs-lisp + (use-package which-key + :ensure t + :config + (which-key-mode)) +#+end_src + +* Evil Collection + +Evil Collection is a ready-made package of evil mode keybings for multiple packages. +You can see the full list [[https://github.com/emacs-evil/evil-collection/tree/master/modes][on Github]]. +It saves me from doing /all that config/ by hand. +It's also good that those bindings are kinda good actually. + +#+BEGIN_SRC emacs-lisp +(use-package evil-collection + :elpaca t + :after evil + :ensure t + :config + (evil-collection-init)) +#+END_SRC + +* General + +I use General to manage keybindings. +People said it's good, and I have to find a downside. + +All those bindings here should be to moved dedicated sections, but for now they are here. + +#+BEGIN_SRC emacs-lisp + (use-package general + :ensure t + :elpaca t + :config + (setq general-use-package-emit-autoloads t) + (general-evil-setup)) +#+END_SRC + +I manage my packages via Elpaca. +It has the amazing capability of loading the packages asynchronously, speeding up Emacs start. +But this also means that order becomes a problem. +I will define keybindings using =general-*= functions all over the place, and the package may not be loaded yet. +To save myself the problem, just pause execution of the config until General is fully loaded. + +#+begin_src emacs-lisp + (elpaca-wait) +#+end_src + +* Basic keybindings + +I use =space= as my leader. +It's a muscle memory back from when I first learned Vim. + +#+begin_src emacs-lisp + (general-create-definer mms-leader-keys + :states '(normal insert visual emacs) + :keymaps 'override + :prefix "SPC" ;; set leader + :global-prefix "M-SPC") +#+end_src + +I want to access my config /blazingly fast/[tm] + +#+begin_src emacs-lisp + (mms-leader-keys + "o c" '((lambda () (interactive) (find-file "~/.emacs.d/")) :wk "Open config dir")) +#+end_src + +I also have a habit of wanting to quickly create new splits (/sigh/ windows) fast back from my Vim days. + +#+begin_src emacs-lisp + (general-create-definer mms-split-mgt-keys + :states '(normal visual) + :keymaps 'override + :prefix "s") + + (mms-split-mgt-keys + ;; Window splits + "s" '(evil-window-split :wk "Horizontal split window") + "v" '(evil-window-vsplit :wk "Vertical split window") + ;; Window motions + "h" '(evil-window-left :wk "Window left") + "j" '(evil-window-down :wk "Window down") + "k" '(evil-window-up :wk "Window up") + "l" '(evil-window-right :wk "Window right")) +#+end_src + +And I have a few keybindings that are here for now. +I'll move them to dedicated sections when I reach them. + +#+begin_src emacs-lisp + (mms-leader-keys + "c a" '(eglot-code-actions :wk "Code actions")) + + + +#+END_SRC diff --git a/mms-misc-rss.org b/mms-misc-rss.org new file mode 100644 index 0000000..af9647a --- /dev/null +++ b/mms-misc-rss.org @@ -0,0 +1,138 @@ +#+title: mms emacs config - misc - RSS +#+author: michał sapka (https://michal.sapka.me) +#+startup: showall indent logdone + +#+hugo_base_dir: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+hugo_weight: 400 +#+hugo_section: emacs/config +#+hugo_categories: emacs emacs-config +#+hugo_menu :menu "emacs-config" :name "RSS" +#+hugo_custom_front_matter: :abstract "my emacs config - RSS onfig" +#+hugo_custom_front_matter: :menu-abstract "Elfeed and literate config" +#+export_file_name: misc + +* Elfeed + +Elfeed is the single best RSS reader for Emacs and of the best out there. + +#+begin_src emacs-lisp + (use-package elfeed + :ensure t) +#+end_src + +* Elfeed-org + +I want to manage my subscription as org subtree - makes it easier to make sense of it. +Lucky, elfeed-org does exact this! + +You can read my intro to elfeed org [[https://michal.sapka.me/emacs/elfeed-literate-config/][on my website.]] + +#+begin_src emacs-lisp + (use-package elfeed-org + ;; :after elfeed + :ensure t + :config + (setq rmh-elfeed-org-files (list "~/.emacs.d/mms-misc-rss.org")) + (elfeed-org)) +#+end_src + +And some keybindings + +#+begin_src emacs-lisp + (mms-leader-keys + "m r" '(lambda () (interactive) (elfeed) :wk "Elfeed")) +#+end_src + +I also don't need line numbers when reading RSS item + +* Youtube + +YT is a sad state of the web. +Still, there is some good content there. +I want to use it inside emacs + +#+begin_src emacs-lisp + (use-package elfeed-tube + :ensure t ;; or :straight t + :after elfeed + :demand t + :config + ;; (setq elfeed-tube-auto-save-p nil) ; default value + ;; (setq elfeed-tube-auto-fetch-p t) ; default value + (elfeed-tube-setup) + + :bind (:map elfeed-show-mode-map + ("F" . elfeed-tube-fetch) + ([remap save-buffer] . elfeed-tube-save) + :map elfeed-search-mode-map + ("F" . elfeed-tube-fetch) + ([remap save-buffer] . elfeed-tube-save))) + + (use-package elfeed-tube-mpv + :ensure t ;; or :straight t + :bind (:map elfeed-show-mode-map + ("C-c C-f" . elfeed-tube-mpv-follow-mode) + ("C-c C-w" . elfeed-tube-mpv-where))) +#+end_src + +* Subscriptions :elfeed: +** Self :self: +*** [[https://michal.sapka.me/index.xml][MMS]] +** Blogs :blog: +*** [[https://world.hey.com/dhh/feed.atom][DHH]] +*** [[https://gideonwolfe.com/index.xml][Gideon Wolfe]] +*** [[https://fabiensanglard.net/rss.xml][Fabien Sangrald]] +*** [[https://grumpygamer.com/rss][Ron Gilbert]] +*** [[https://lukesmith.xyz/rss.xml][Luke Smith]] +*** [[https://rubenerd.com/feed/][Ruben Schade]] +*** [[https://a3nm.net/blog/feed.xml][Antoine Amarilli]] +*** https://brainbaking.com/index.xml +*** https://bt.ht/atom.xml +*** https://josem.co/articles/index.xml +*** https://robert.bearblog.dev/feed/ +*** https://www.datagubbe.se/atom.xml +*** https://xpil.eu/feed/ +*** https://www.zenspider.com/atom.xml +*** https://mwl.io/blog/feed +*** http://blog.wovenmemories.net/feed.xml +*** [[https://drewdevault.com/blog/index.xml][Drew DeVault]] +** https://unixsheikh.com/feed.rss +** https://blogrys.pl/feed.xml +** https://n3wjack.net/feed/ +** https://normalmo.de/index.xml +** https://frostyx.cz/feed.xml +** https://drew.idktellme.com/feeds/all.atom.xml +** https://takeonrules.com/index.xml +** https://tiredsysadmin.cc/rss.xml +** https://bsdly.blogspot.com/feeds/posts/default?alt=rss +** https://odysee.com/$/rss/@GaryHTech:0 +** https://odysee.com/$/rss/@fireship:6 +** https://tilvids.com/feeds/videos.xml?videoChannelId=2775 +** https://tilvids.com/feeds/videos.xml?videoChannelId=47 +** https://videos.lukesmith.xyz/feeds/videos.xml?sort=-publishedAt +** https://videos.danksquad.org/feeds/videos.xml?videoChannelId=2332 +** https://cprss.s3.amazonaws.com/rubyweekly.com.xml +** https://feeds.feedburner.com/digest-programming +** https://zendesk.engineering/feed +** https://shopify.engineering/blog.atom +** https://jvns.ca/atom.xml +** https://susam.net/blog/feed.xml +** https://dev.37signals.com/feed/posts.xml +** https://feeds.arstechnica.com/arstechnica/features +** https://frame.work/blog.rss +** https://www.pine64.org/feed/ +** https://monal-im.org/index.xml +** [[https://www.servethehome.com/feed/][Serve the Home]] +** Emacs :emacs: +*** https://howardism.org/index.xml +*** https://sqrtminusone.xyz/posts/index.xml +*** https://protesilaos.com/master.xml +*** https://pragmaticemacs.wordpress.com/feed/ +** Entertainment +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCrTNhL_yO3tPTdQ5XgmmWjA][RLM]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCLx053rWZxCiYWsBETgdKrQ][LGR]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UClOGLGPOqlAiLmOvXW5lKbw][Mandalore Gaming]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC4w1YQAJMWOz4qtxinq55LQ][Level1Techs]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCNmv1Cmjm3Hk8Vc9kIgv0AQ][Grim Beard]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCEHFikgnRuLd1HYKTLrae9Q][A Life Engineered]] +*** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCJ6KZTTnkE-s2XFJJmoTAkw][Accursed Farms]] diff --git a/mms-misc.org b/mms-misc.org new file mode 100644 index 0000000..241298d --- /dev/null +++ b/mms-misc.org @@ -0,0 +1,57 @@ +#+TITLE: mms Emacs Config - Misc +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Miscellaneous" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - miscellaneous onfig" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "mastodon and email" +#+EXPORT_FILE_NAME: misc + +* Intro + +Why not do some other cool things inside Emacs? +Those configs here are very rudementaty, and a work-in-progress. + +* Mastodon + +I use mastodon (use can find me on [[https://emacs.ch/@mms][emacs.ch]]). +Why not use it in Emacs? + +I need to add dedicated config for keybindings. + +#+begin_src emacs-lisp + (use-package mastodon + :ensure t + :config + (setq mastodon-instance-url "https://emacs.ch" + mastodon-active-user "mms") + ) +#+end_src + +* Email + +Oh email, how I love you! + +** Reading + +I use notmuch as my MUA. +You can find my guide on my [[https://michal.sapka.me/emacs/notmuch/][emacs site]]. + +#+BEGIN_SRC emacs-lisp + (use-package notmuch + :commands notmuch-hello + :config + (setq notmuch-search-oldest-first nil + notmuch-search-line-faces '(("gh-pr-todo" . ((t :foreground "#f77"))))) ) +#+END_SRC + +#+begin_src emacs-lisp + (mms-leader-keys + "m m" '(lambda () (interactive) (notmuch-hello) :wk "Notmuch hello")) +#+end_src + +** TODO composing diff --git a/mms-ox-publish.org b/mms-ox-publish.org new file mode 100644 index 0000000..3c30268 --- /dev/null +++ b/mms-ox-publish.org @@ -0,0 +1,71 @@ +#+TITLE: mms Emacs Config - Publishing +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Publishing" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - publishing to Hugo" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "how the sausage... this site is made" +#+EXPORT_FILE_NAME: publishing +* Introduction + +I have a website under https://michal.sapka.me. +It based on Hugo, but I want to /write/ in Org mode - and not in Markdown. + +* OX-Hugo + +Luckily, there is ready package called [[https://ox-hugo.scripter.co/][ox-hugo]]. + +#+begin_src emacs-lisp + (use-package ox-hugo + :ensure t + :after ox) +#+end_src + +* Local and remote writing + +I write in subpage-per-file, so I have a dedicated =blog.org=, =bsd.org=, =star-trek.org=, or =emacs.org=. +All those files are stored in a single location on my computer. + +#+begin_src emacs-lisp + (setq mms-homepage-local-dir "/home/mms/ghq/vcs.sapka.me/michal-sapka-me/content-org/") +#+end_src + +Sometimes however I want to edit them on a remote machine via =Tramp=. + +#+begin_src emacs-lisp + (setq mms-homepage-remote-dir (concat "/sshx:voy:" mms-homepage-local-dir)) +#+end_src + + +I have a ready =ssh_config= for the =voy= (short for =voyager=) connection: + +#+begin_src conf :tangle yes +Host voy + HostName 10.0.135 + User mms +#+end_src + +(don't worry, the device is not available outside my local network). + +I open the folder via: + +#+begin_src emacs-lisp + (defun mms-open-homepage-org-files () + (interactive) + (dired (if mms-is-voyager + mms-homepage-local-dir + mms-homepage-remote-dir))) + +#+end_src + +Finally, I want to have quick access + +#+begin_src emacs-lisp + (mms-leader-keys + "o h" (lambda () (interactive) (mms-open-homepage-org-files)) :wk "open homepage") +#+end_src + diff --git a/mms-ox-sprints.org b/mms-ox-sprints.org new file mode 100644 index 0000000..14923b6 --- /dev/null +++ b/mms-ox-sprints.org @@ -0,0 +1,61 @@ +#+TITLE: Michał Sapka's Emacs Config - Org - Sprints +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdone + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Sprints" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Sprints" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "how I avoid using Jira" +#+EXPORT_FILE_NAME: sprints + +* TODO Intro + +* Jira + +We use Jira, and I hate using Jira. +Why then not just use Org instead? + +** Export + +There is a ready to use package called =ox-jira= which exports to a Jira/Conflunce compatible format +#+begin_src emacs-lisp + (use-package ox-jira + :after ox + :ensure t) +#+end_src + +But copy paste is too much hustle for me and would force me to use Jira interface. +I have written a small function which will save a correctly formatted buffer on my HDD and then pass it to =go-jira= to update the data on remote + +#+begin_src emacs-lisp + (defun mms-emacs-jira-set-delivery-status + (&optional async subtreep visible-only body-only ext-plist) + (interactive) + (setq comment-msg "Updated delivery status _with the power of Emacs_") + (setq issue (org-entry-get (point) "ISSUE")) + + (org-export-to-file 'jira (concat "~/tmp/" issue) + async subtreep visible-only body-only ext-plist) + (shell-command (concat "~/.emacs.d/helpers/jira-sync " issue " \"" comment-msg "\""))) +#+end_src + +I need add a drawer with issue id +#+begin_quote +:properties: +:ISSUE: EXPVGA-380 +:end: +#+end_quote + +Lastly, I register it as an export option + +#+begin_src emacs-lisp + (with-eval-after-load 'ox-jira + (org-export-define-derived-backend 'mms-emacs-jira 'jira + :menu-entry + '(?j "Export to JIRA" + ((?u "Update in Jira" mms-emacs-jira-set-delivery-status)))) + ) +#+end_src diff --git a/mms-ox.org b/mms-ox.org new file mode 100644 index 0000000..f0fefee --- /dev/null +++ b/mms-ox.org @@ -0,0 +1,83 @@ +#+TITLE: mms Emacs Config - OX +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdoneGeneral settings + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Org mode" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Org mode" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "Basic org mode and babel config" +#+EXPORT_FILE_NAME: org + +* Todo + +I want to set done date autoatically + +#+begin_src +(setq org-log-done 'time) +#+end_src + + +* Babel + +Babel allows for evaluation of code blocks inside Org files. +I want to use all available languages. + +#+begin_src emacs-lisp + (org-babel-do-load-languages 'org-babel-load-languages + '((shell . t) + (js . t) + (emacs-lisp . t) + (clojure . t) + (python . t) + (ruby . t) + (dot . t) + (css . t) + (plantuml . t))) +#+end_src +Don't ask for confirmation when evaluating, don't be annoying. + +#+begin_src emacs-lisp + (setq org-confirm-babel-evaluate nil) + (setq org-babel-default-header-args '((:eval . "never-export") + (:exports . "both") + (:cache . "no") + (:results . "replace"))) +#+end_src + +Org-tempo allows for =<s<TAB>= quick expansion into a full-blown code block. +Pretty neat. + +#+begin_src emacs-lisp + (require 'org-tempo) + (setq org-structure-template-alist + '(("a" . "export ascii\n") + ("c" . "center\n") + ("C" . "comment\n") + ("e" . "example\n") + ("E" . "export") + ("h" . "export html\n") + ("l" . "export latex\n") + ("q" . "quote\n") + ("s" . "src") + ("v" . "verse\n"))) +#+end_src + +* Github export + +Why do markdown when you don't need to? + +#+begin_src emacs-lisp + (use-package ox-gfm) +#+end_src + +* Fast access + +Lastly, let's open my org folder /fast/ + +#+begin_src emacs-lisp + (mms-leader-keys + "o o" '((lambda () (interactive) (find-file "~/org")) :wk "Open org folder")) +#+end_src diff --git a/mms-prog-ruby.org b/mms-prog-ruby.org new file mode 100644 index 0000000..18908a1 --- /dev/null +++ b/mms-prog-ruby.org @@ -0,0 +1,49 @@ +#+TITLE: Michał Sapka's Emacs Config - Prog mode - Ruby +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdoneGeneral settings + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Ruby" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Ruby" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "My Ruby language setup" +#+EXPORT_FILE_NAME: ruby + +* Intro + +I am a Ruby developer by trade (and still /heart), but I am no longer a code + +* Irb + +Inf-Ruby allows for interactive REPL inside Emacs. +You can create a buffer with IRB, you can send code there and you can run =babel= code blocks in ruby. +Cool! + +#+begin_src emacs-lisp + (use-package inf-ruby + :ensure t) +#+end_src + +* Robe + +Yes, we have LSP but they work /poorly/ in my experience. +Robe is a major mode designed to work with Ruby so let's ride it. + +#+begin_src emacs-lisp + (use-package robe + :ensure t) +#+end_src + +And I want it to be enable whenever I am /doing ruby./ +#+begin_src emacs-lisp + (add-hook 'ruby-mode-hook 'robe-mode) + (add-hook 'ruby-ts-mode-hook 'robe-mode) +#+end_src + +Let's also add it to autocomplete (for the future, as I have yet to setup company) +#+begin_src emacs-lisp + (eval-after-load 'company + '(push 'company-robe company-backends)) +#+end_src diff --git a/mms-prog.org b/mms-prog.org new file mode 100644 index 0000000..9b45df0 --- /dev/null +++ b/mms-prog.org @@ -0,0 +1,72 @@ +#+TITLE: mms Emacs Config - Prog mode +#+AUTHOR: Michał Sapka (https://michal.sapka.me) +#+STARTUP: showall indent logdoneGeneral settings + +#+HUGO_BASE_DIR: ~/ghq/vcs.sapka.me/michal-sapka-me/ +#+HUGO_WEIGHT: 400 +#+HUGO_SECTION: emacs/config +#+HUGO_CATEGORIES: emacs emacs-config +#+HUGO_MENU :menu "emacs-config" :name "Ruby" +#+HUGO_CUSTOM_FRONT_MATTER: :abstract "My emacs config - Programmming" +#+HUGO_CUSTOM_FRONT_MATTER: :menu-abstract "Programming setup, generic" +#+EXPORT_FILE_NAME: programming + +* General + +#+begin_src emacs-lisp + (global-display-line-numbers-mode) ; By default I want line number everywhere +#+end_src +* Auto-complete + +Auto-complete at point is almost all I want from a programmers editor. +Luckily, =corfu= is am /amazing/ package for that + +#+begin_src emacs-lisp + (use-package corfu + :ensure t + ;; Optional customizations + :custom + ;; (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' + (corfu-auto t) ;; Enable auto completion + ;; (corfu-separator ?\s) ;; Orderless field separator + ;; (corfu-quit-at-boundary nil) ;; Never quit at completion boundary + ;; (corfu-quit-no-match nil) ;; Never quit, even if there is no match + ;; (corfu-preview-current nil) ;; Disable current candidate preview + ;; (corfu-preselect 'prompt) ;; Preselect the prompt + ;; (corfu-on-exact-match nil) ;; Configure handling of exact matches + ;; (corfu-scroll-margin 5) ;; Use scroll margin + + ;; Enable Corfu only for certain modes. + ;; :hook ((prog-mode . corfu-mode) + ;; (shell-mode . corfu-mode) + ;; (eshell-mode . corfu-mode)) + + ;; Recommended: Enable Corfu globally. This is recommended since Dabbrev can + ;; be used globally (M-/). See also the customization variable + ;; `global-corfu-modes' to exclude certain modes. + :init + (global-corfu-mode)) +#+end_src + +* Fast navigation + +This is not /strictly/ for prog, but quick buffer switch is great. +At a certain point I might move this to general config. +I use =consult= for the as-I-type propositions. + +#+begin_src emacs-lisp + (use-package consult + :ensure t) + #+end_src + +#+begin_src emacs-lisp + (with-eval-after-load 'general + (mms-leader-keys + "f g" '(lambda () (interactive) (consult-ripgrep)) :wk "Ripgrep" + "f i" '(lambda () (interactive) (consult-imenu)) :wk "Imenu" + "f F" '(lambda () (interactive) (consult-recent-file)) :wk "Recent file" + "f B" '(lambda () (interactive) (consult-bookmark)) :wk "Bookmark" + "f b" '(lambda () (interactive) (consult-buffer)) :wk "Buffer" + "f f" '(lambda () (interactive) (consult-find)) :wk "File" + )) +#+end_src |