Compare commits

...

2 commits

Author SHA1 Message Date
6e25f44300
refactor: remake pankomacs 2025-05-03 19:12:11 +01:00
d8e729c7d8
refactor: remake pankomacs 2025-05-03 18:04:12 +01:00
9 changed files with 150 additions and 208 deletions

View file

@ -1,35 +1,46 @@
#+html: <img src="media/panko.gif" align="right" width="4%"> #+title: Pankomacs
#+options: toc:nil #+options: toc:nil num:nil
** Pankomacs #+html: <img src="media/panko.gif" height="256px">
****** opinionated opinionated emacs configuration (ft. flakes) Pankomacs is an "opinionated opinionated emacs configuration" which uses flakes
and emacs-overlay to manage packages instead of straight.el. It tries to use
builtin tools when possible to keep the size of the configuration reasonable.
----- * How do I use this configuration?
#+html: <img src="media/screenshot.png" align="center"> Add pankomacs and nixpkgs (assuming you don't have it) into your flake inputs
like this:
#+begin_src nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
pankomacs = {
url = "git+https://copeberg.org/amadaluzia/pankomacs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
#+end_src
----- You can then, for example, use it in your NixOS configuration by using this in
your NixOS configuration:
#+begin_src nix
{ inputs, pkgs, ... }: {
services.emacs = {
enable = true;
package = inputs.pankomacs.lib.mkPankomacs {
inherit pkgs;
emacs = pkgs.emacs-pgtk; # non-specific
};
};
}
#+end_src
*** Disclaimer * Where did the name come from?
This config is bound to change for any reason if I feel like it that day. Pankomacs and "opinionated opinionated emacs configuration" came from a mix
between Emacs and [[https://www.instagram.com/fatfatpankocat/][fatfatpankocat]].
You are fine to use it, but do know that it may change for any reason on my end.
-----
*** What is this configuration?
This is a Nix flake for my Emacs configuration, similar to [[https://github.com/nix-community/kickstart-nix.nvim][kickstart-nix.nvim]].
This was put in my =~/.emacs.d/= so I added some files to exclude in my =.gitignore=.
-----
*** Where did the name come from?
Pankomacs and "opinionated opinionated emacs configuration" came from a mix between Emacs and [[https://www.instagram.com/fatfatpankocat/][fatfatpankocat]].
Other suggested named were "Plusmacs" based off of this discord conversation: Other suggested named were "Plusmacs" based off of this discord conversation:

View file

@ -1,24 +0,0 @@
;; -*- lexical-binding: t -*-
(defun config-init-dev ()
(use-package which-key
:defer t
:commands (which-key-mode)
:custom
(which-key-mode t))
(use-package envrc
:defer t
:commands (envrc-global-mode envrc-mode)
:custom
(envrc-global-mode t))
(use-package eglot
:defer t
:commands (eglot eglot-ensure)
:hook (prog-mode . eglot-ensure)
:config
(add-to-list 'eglot-server-programs '((nim-mode nimscript-mode) . ("nimlsp")))))
(provide 'config-dev)

View file

@ -1,29 +0,0 @@
;; -*- lexical-binding: t -*-
(defun config-init-ivy ()
(use-package ivy
:custom
(ivy-mode t)
(counsel-mode t)
(ivy-use-virtual-buffers t)
:bind (("C-s" . swiper-isearch)
("C-c C-r" . ivy-resume)
("<f6>" . ivy-resume)
("M-x" . counsel-M-x)
("C-x C-f" . counsel-find-file)
("<f1> f" . counsel-describe-function)
("<f1> v" . counsel-describe-variable)
("<f1> o" . counsel-describe-symbol)
("<f1> l" . counsel-find-library)
("<f2> i" . counsel-info-lookup-symbol)
("<f2> u" . counsel-unicode-char)
("C-c g" . counsel-git)
("C-c j" . counsel-git-grep)
("C-c k" . counsel-ag)
("C-x l" . counsel-locate)
("C-S-o" . counsel-rhythmbox)
:map minibuffer-local-map
("C-r" . counsel-minibuffer-history))))
(provide 'config-ivy)

View file

@ -1,61 +1,16 @@
;; -*- lexical-binding: t -*- ;;; config-languages --- Language configuration -*- lexical-binding: t -*-
(defun config-init-languages () ;;; Commentary:
;; I need to provide configuration for things like
;; Nix, Nim, etc. so why not just write it down
;; here?
;;; Code:
(defun init-languages-config ()
"Just provide some language configuration."
(use-package nix-ts-mode (use-package nix-ts-mode
:defer t :mode "\\.nix\\'"))
:commands (nix-ts-mode)
:mode "\\.nix\\'")
(use-package rust-ts-mode
:defer t
:commands (rust-ts-mode)
:mode "\\.rs\\'")
(use-package qml-mode
:defer t
:commands (qml-mode)
:mode "\\.qml\\'")
(use-package haskell-mode
:defer t
:commands (haskell-mode)
:mode "\\.hs\\'")
(use-package python
:defer t
:commands (python-ts-mode python-mode)
:custom
(python-indent-offset 4))
(use-package cc-mode
:defer t
:commands (c-ts-mode
c++-ts-mode
c++-mode
c-mode)
:custom
(c-basic-offset 4))
(use-package nushell-mode
:defer t
:commands (nushell-mode)
:mode "\\.nu\\'")
(use-package tuareg
:defer t
:commands (tuareg-mode tuareg-opam-mode)
:mode "\\.ml\\'")
(use-package nim-mode
:defer t
:commands (nim-mode)
:mode (("\\.nim\\'" . nim-mode)
("\\.nims\\'" . nimscript-mode)))
(use-package go-ts-mode
:defer t
:commands (go-ts-mode go-mod-ts-mode)
:mode (("\\.go\\'" . go-ts-mode)
("go.mod\\'" . go-mod-ts-mode))))
(provide 'config-languages) (provide 'config-languages)
;;; config-languages.el ends here

42
config/config-org.el Normal file
View file

@ -0,0 +1,42 @@
;;; config-org --- Configuration for Org-mode -*- lexical-binding: t -*-
;;; Commentary:
;; I need to do Org-mode configuration and this is
;; a decent place to do that.
;;; Code:
(defun init-org-config ()
"Just provide Org-mode configuration."
(defun my/org-mode-borders ()
(modify-all-frames-parameters
'((right-divider-width . 20)
(internal-border-width . 20)))
(dolist (face '(window-divider
window-divider-first-pixel
window-divider-last-pixel))
(face-spec-reset-face face)
(set-face-foreground face (face-attribute 'default :background)))
(set-face-background 'fringe (face-attribute 'default :background)))
(use-package org
:custom
;; Edit settings
(org-auto-align-tags nil)
(org-tags-column 0)
(org-fold-catch-invisible-edits 'show-and-error)
(org-special-ctrl-a/e t)
(org-insert-heading-respect-content t)
;; Org styling, hide markup etc.
(org-hide-emphasis-markers t)
(org-pretty-entities t)
(org-agenda-tags-column 0)
(org-ellipsis "")
:hook (org-mode . my/org-mode-borders))
(use-package org-modern
:hook (org-mode . org-modern-mode))
(use-package org-bullets
:hook org-mode))
(provide 'config-org)
;;; config-org.el ends here

View file

@ -1,24 +1,20 @@
;; -*- lexical-binding: t -*- ;;; config-ui --- UI configuration -*- lexical-binding: t -*-
;;; Commentary:
(defun config-init-ui () ;; I need to do UI configuration and this is a
(defun my/doom-modeline-for-new-frames (&optional frame) ;; decent place to do that.
(setq doom-modeline-height (+ (frame-char-height) 8))
(with-selected-frame (or frame (selected-frame))
(doom-modeline-mode 1)))
(use-package doom-modeline ;;; Code:
:defer t
:commands (doom-modeline-mode)
:custom
(doom-modeline-mode (not (daemonp)))
(doom-modeline-env-load-string "")
:hook ((server-after-make-frame) . my/doom-modeline-for-new-frames)
;; ^^^^^^^^^^^^^^^^^^^^^^^ this hook is my goat
)
(defun init-ui-config ()
"Just provide UI configuration."
(use-package base16-theme (use-package base16-theme
:config :config
(load-theme 'base16-rose-pine t))) (load-theme 'base16-rose-pine t))
(use-package doom-modeline
:custom
(doom-modeline-mode t)))
(provide 'config-ui) (provide 'config-ui)
;;; config-ui.el ends here

View file

@ -1,64 +1,62 @@
;;; config.el --- my emacs configuration -*- lexical-binding: t -*- ;;; config.el --- my emacs configuration -*- lexical-binding: t -*-
;; Author: Artur Manuel
;; URL: https://copeberg.org/amadaluzia/pankomacs
;; Version: 0.0.0
;;; Commentary: ;;; Commentary:
;; All this does is provide a configuration for Emacs to use. ;; Not much to gather here.
;;; Code: ;;; Code:
(require 'config-ui) (require 'config-ui)
(require 'config-dev) (require 'config-org)
(require 'config-ivy)
(require 'config-languages) (require 'config-languages)
(require 'use-package)
(defun config-initialise () (defun init-config ()
(config-init-dev) "The actual configuration to initialise at startup."
(config-init-ui)
(config-init-languages)
(config-init-ivy)
(use-package emacs (use-package emacs
:init :init
(setq frame-resize-pixelwise t (setq frame-resize-pixelwise t
window-resize-pixelwise t window-resize-pixelwise t
frame-inhibit-implied-resize t) frame-inhibit-implied-resize t)
(defun crm-indicator (args)
(cons (format "[CRM%s] %s"
(replace-regexp-in-string
"\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" ""
crm-separator)
(car args))
(cdr args)))
(advice-add #'completing-read-multiple :filter-args #'crm-indicator)
(setq minibuffer-prompt-properties
'(read-only t cursor-intangible t face minibuffer-prompt))
(add-hook 'minibuffer-setup-hook #'cursor-intangible-mode)
:custom :custom
(initial-scratch-message nil) ;; vertico setup
(inhibit-startup-screen t) (read-extended-command-predicate #'command-completion-default-include-p)
(inhibit-splash-screen t) (minibuffer-prompt-properties
(menu-bar-mode nil) '(read-only t cursor-intangible t face minibuffer-prompt))
(tool-bar-mode nil) (enable-recursive-buffer t)
(scroll-bar-mode nil) (tab-always-indent 'complete)
;; essentials for me
(delete-selection-mode t) (delete-selection-mode t)
(column-number-mode t) (column-number-mode t)
(enable-recursive-buffer t) ;; get rid of unneeded ui elements
(read-extended-command-predicate #'command-completion-default-include-p) (scroll-bar-mode nil)
(tab-always-indent 'complete) (tool-bar-mode nil)
(menu-bar-mode nil)
;; get rid of the startup screen
(initial-scratch-message nil)
(inhibit-startup-screen t)
:hook (prog-mode . display-line-numbers-mode)) :hook (prog-mode . display-line-numbers-mode))
(use-package savehist (use-package savehist
:defer t :defer t
:commands (savehist-mode) :commands (savehist-mode)
:custom :custom
(savehist-mode t))) (savehist-mode t))
(use-package ibuffer
:bind ("C-x C-b" . ibuffer))
(use-package which-key
:custom
(which-key-mode t))
(use-package icomplete
:custom
(fido-mode t)
(icomplete-vertical-mode t))
(use-package flycheck
:custom
(global-flycheck-mode t))
(init-ui-config)
(init-org-config)
(init-languages-config))
(add-hook #'after-init-hook #'config-initialise) (init-config)
(provide 'config) (provide 'config)
;;; config.el ends here ;;; config.el ends here

18
flake.lock generated
View file

@ -8,11 +8,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1743991507, "lastModified": 1746116666,
"narHash": "sha256-sRyA1LOsRSeF8W2drXEuGU2U+actcYEKdk1f+2kDKb8=", "narHash": "sha256-OVk7gw5B9BTpIK+zV1gMObiO6ERnM2iBv1qCd+mB8dk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "ac8af15c5f586879c08cd257b69749f791d94e68", "rev": "d496a053874af07a757eec3e26b4f3cb918aae9f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -23,11 +23,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1743827369, "lastModified": 1745930157,
"narHash": "sha256-rpqepOZ8Eo1zg+KJeWoq1HAOgoMCDloqv5r2EAa9TSA=", "narHash": "sha256-y3h3NLnzRSiUkYpnfvnS669zWZLoqqI6NprtLQ+5dck=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "42a1c966be226125b48c384171c44c651c236c22", "rev": "46e634be05ce9dc6d4db8e664515ba10b78151ae",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -39,11 +39,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1743813633, "lastModified": 1746055187,
"narHash": "sha256-BgkBz4NpV6Kg8XF7cmHDHRVGZYnKbvG0Y4p+jElwxaM=", "narHash": "sha256-3dqArYSMP9hM7Qpy5YWhnSjiqniSaT2uc5h2Po7tmg0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "7819a0d29d1dd2bc331bec4b327f0776359b1fa6", "rev": "3e362ce63e16b9572d8c2297c04f7c19ab6725a5",
"type": "github" "type": "github"
}, },
"original": { "original": {

15
lib.nix
View file

@ -18,19 +18,12 @@ let
epkgs: epkgs:
builtins.attrValues { builtins.attrValues {
inherit (epkgs) inherit (epkgs)
spacious-padding
doom-modeline
ivy
counsel
swiper
base16-theme base16-theme
doom-modeline
nix-ts-mode nix-ts-mode
haskell-mode flycheck
qml-mode org-bullets
tuareg org-modern
nushell-mode
nim-mode
envrc
; ;
treesit-grammars = epkgs.treesit-grammars.with-all-grammars; treesit-grammars = epkgs.treesit-grammars.with-all-grammars;
config = epkgs.trivialBuild { config = epkgs.trivialBuild {