nix

configuration files that power my machines
Log | Files | Refs | README | LICENSE

commit 140eadeb45a34d585fa1fddf23bdd233cbd9ec8e
parent 49c6b3f5d2130ef8563370743a7bcdd8d4228082
Author: mtmn <miro@haravara.org>
Date:   Fri, 17 Apr 2026 13:51:27 +0200

feat: redo overlays.nix, void config

Diffstat:
M.gitignore | 4+++-
Mflake.lock | 8++++----
Dhosts/proton/overlays/bin/.gitkeep | 0
Mhosts/proton/overlays/default.nix | 77+----------------------------------------------------------------------------
Dhosts/proton/overlays/home/.gitkeep | 0
Dhosts/proton/overlays/local/.gitkeep | 0
Mhosts/void/default.nix | 66+++++++++++++++++++++++++++++++++++++-----------------------------
Dhosts/void/overlays/bin/.gitkeep | 0
Dhosts/void/overlays/config/.gitkeep | 0
Mhosts/void/overlays/config/shell/rc/void | 0
Mhosts/void/overlays/default.nix | 77+----------------------------------------------------------------------------
Dhosts/void/overlays/home/.gitkeep | 0
Dhosts/void/overlays/local/.gitkeep | 0
Dhosts/wsl/overlays/bin/.gitkeep | 0
Dhosts/wsl/overlays/config/.gitkeep | 0
Mhosts/wsl/overlays/default.nix | 77+----------------------------------------------------------------------------
Dhosts/wsl/overlays/home/.gitkeep | 0
Dhosts/wsl/overlays/local/.gitkeep | 0
Amodules/mixins/dotfiles/config/emacs/.gitigonre | 4++++
Amodules/mixins/dotfiles/config/emacs/init.el | 28++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/completion.el | 139+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/core.el | 73+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/evil-setup.el | 57+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/files.el | 41+++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/git.el | 27+++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/keymaps.el | 98+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/lsp.el | 181+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/theme.el | 41+++++++++++++++++++++++++++++++++++++++++
Amodules/mixins/dotfiles/config/emacs/lisp/ui.el | 137+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mmodules/mixins/dotfiles/config/foot/foot.ini | 27+++++++++++++--------------
Dmodules/mixins/dotfiles/config/nvim/README.md | 22----------------------
Dmodules/mixins/dotfiles/config/nvim/TREESITTER.md | 73-------------------------------------------------------------------------
Mmodules/mixins/dotfiles/config/nvim/fnl/config/lsp.fnl | 1+
Mmodules/mixins/dotfiles/config/nvim/fnl/init.fnl | 2+-
Mmodules/mixins/dotfiles/config/river/init | 2+-
Mmodules/mixins/dotfiles/config/shell/profile/fzf | 8++++----
Mmodules/mixins/dotfiles/home/tmux.conf | 14+++++++-------
Amodules/mixins/overlays.nix | 76++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmodules/mixins/secrets.nix | 0
39 files changed, 976 insertions(+), 384 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -1,2 +1,4 @@ -hosts.nix result +modules/mixins/dotfiles/config/emacs +!modules/mixins/dotfiles/config/emacs/lisp +!modules/mixins/dotfiles/config/emacs/init.el diff --git a/flake.lock b/flake.lock @@ -30,11 +30,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1776425792, - "narHash": "sha256-Nu4f7N0XUpzNqqjrP6YqThz9nncS2DVoWiKlRlOGNY0=", + "lastModified": 1776430989, + "narHash": "sha256-KczCsRs+ThziFqHUqzKFeO+5D4INxsh7zu/4zZVk0kc=", "ref": "refs/heads/master", - "rev": "63e3d030978aaf2a6ebaf36de3c4290eb45ebaf8", - "revCount": 65, + "rev": "242526a56e02bd503939cb3e161038191c412d36", + "revCount": 66, "type": "git", "url": "ssh://git@codeberg.org/mtmn/corpus" }, diff --git a/hosts/proton/overlays/bin/.gitkeep b/hosts/proton/overlays/bin/.gitkeep diff --git a/hosts/proton/overlays/default.nix b/hosts/proton/overlays/default.nix @@ -1,76 +1 @@ -{ - config, - lib, - inputs, - ... -}: let - date = inputs.self.lastModifiedDate or "19700101000000"; - year = lib.substring 0 4 date; - monthNum = lib.substring 4 2 date; - month = lib.elemAt [ - "january" - "february" - "march" - "april" - "may" - "june" - "july" - "august" - "september" - "october" - "november" - "december" - ] (lib.toInt (lib.removePrefix "0" monthNum) - 1); - - tmplArgs = { - inherit year month; - homeDir = config.home.homeDirectory; - }; - - mkMapping = path: prefix: let - scan = dir: rel: - lib.concatLists (lib.mapAttrsToList (name: type: let - newRel = - if rel == "" - then name - else "${rel}/${name}"; - newPath = dir + "/${name}"; - in - if type == "directory" - then scan newPath newRel - else [ - { - name = newRel; - path = newPath; - } - ]) - (builtins.readDir dir)); - in - builtins.listToAttrs (map (file: let - isNix = lib.hasSuffix ".nix" file.name; - target = prefix + (lib.removeSuffix ".nix" file.name); - in - lib.nameValuePair target ( - if isNix - then { - text = import file.path tmplArgs; - force = true; - } - else { - source = file.path; - force = true; - } - )) (scan path "")); -in { - config = { - home.file = lib.mapAttrs (_: lib.mkForce) ( - (mkMapping ./home ".") - // (lib.mapAttrs (_: v: v // {executable = true;}) (mkMapping ./bin "bin/")) - // (mkMapping ./local ".local/") - ); - - xdg.configFile = lib.mapAttrs (_: lib.mkForce) (mkMapping ./config ""); - - home.sessionPath = ["$HOME/bin"]; - }; -} +import ../../../modules/mixins/overlays.nix ./. diff --git a/hosts/proton/overlays/home/.gitkeep b/hosts/proton/overlays/home/.gitkeep diff --git a/hosts/proton/overlays/local/.gitkeep b/hosts/proton/overlays/local/.gitkeep diff --git a/hosts/void/default.nix b/hosts/void/default.nix @@ -1,17 +1,22 @@ -{pkgs, ...}: let - inherit (pkgs) lib; - +{ + pkgs, + lib, + ... +}: let parts = { utils = with pkgs; [ shellcheck + unzip + zip eza + bat zoxide fzf tree-sitter shfmt gron + ncdu bear - ctags entr hyperfine gdb @@ -22,7 +27,6 @@ cmake moor buf - harper duc ]; @@ -49,6 +53,7 @@ podman skopeo tenv + act ]; lsp = with pkgs; [ @@ -58,6 +63,7 @@ gopls nixd zls + harper ]; data = with pkgs; [ @@ -65,17 +71,17 @@ jless jaq jq + pandoc datasette + difftastic tokyocabinet ]; vcs = with pkgs; [ - difftastic git-bug git-crypt git-absorb git-annex - gitleaks lazygit jujutsu jjui @@ -86,21 +92,16 @@ alejandra comma deadnix + statix nh - nix-du - nixos-anywhere nvd ragenix - statix nix-diff - nix-output-monitor - niv attic-client ]; net = with pkgs; [ bore-cli - curl inetutils lftp mosh @@ -113,7 +114,6 @@ thrift trickle websocat - wget xh ]; @@ -133,28 +133,19 @@ ocaml = with pkgs; [ ocaml - dune opam ]; - haskell = - (with pkgs.haskell.compiler; [ - ghc9124 - ]) - ++ (with pkgs.haskellPackages; [ - Cabal_3_16_1_0 - stack - purescript - purenix - ]) - ++ (with pkgs; [ - cabal2nix - ]); + purescript = with pkgs.haskellPackages; [ + purescript + purenix + ]; elm = with pkgs.elmPackages; [ elm elm-language-server elm-analyse + elm-format ]; lua = @@ -174,8 +165,25 @@ nodejs picard rustup + bun ]; }; in { - home.packages = lib.concatLists (lib.attrValues parts); + home.packages = lib.concatLists (with parts; [ + utils + media + ops + lsp + data + vcs + nix + net + web + llm + ocaml + purescript + elm + lua + other + ]); } diff --git a/hosts/void/overlays/bin/.gitkeep b/hosts/void/overlays/bin/.gitkeep diff --git a/hosts/void/overlays/config/.gitkeep b/hosts/void/overlays/config/.gitkeep diff --git a/hosts/void/overlays/config/shell/rc/void b/hosts/void/overlays/config/shell/rc/void Binary files differ. diff --git a/hosts/void/overlays/default.nix b/hosts/void/overlays/default.nix @@ -1,76 +1 @@ -{ - config, - lib, - inputs, - ... -}: let - date = inputs.self.lastModifiedDate or "19700101000000"; - year = lib.substring 0 4 date; - monthNum = lib.substring 4 2 date; - month = lib.elemAt [ - "january" - "february" - "march" - "april" - "may" - "june" - "july" - "august" - "september" - "october" - "november" - "december" - ] (lib.toInt (lib.removePrefix "0" monthNum) - 1); - - tmplArgs = { - inherit year month; - homeDir = config.home.homeDirectory; - }; - - mkMapping = path: prefix: let - scan = dir: rel: - lib.concatLists (lib.mapAttrsToList (name: type: let - newRel = - if rel == "" - then name - else "${rel}/${name}"; - newPath = dir + "/${name}"; - in - if type == "directory" - then scan newPath newRel - else [ - { - name = newRel; - path = newPath; - } - ]) - (builtins.readDir dir)); - in - builtins.listToAttrs (map (file: let - isNix = lib.hasSuffix ".nix" file.name; - target = prefix + (lib.removeSuffix ".nix" file.name); - in - lib.nameValuePair target ( - if isNix - then { - text = import file.path tmplArgs; - force = true; - } - else { - source = file.path; - force = true; - } - )) (scan path "")); -in { - config = { - home.file = lib.mapAttrs (_: lib.mkForce) ( - (mkMapping ./home ".") - // (lib.mapAttrs (_: v: v // {executable = true;}) (mkMapping ./bin "bin/")) - // (mkMapping ./local ".local/") - ); - - xdg.configFile = lib.mapAttrs (_: lib.mkForce) (mkMapping ./config ""); - - home.sessionPath = ["$HOME/bin"]; - }; -} +import ../../../modules/mixins/overlays.nix ./. diff --git a/hosts/void/overlays/home/.gitkeep b/hosts/void/overlays/home/.gitkeep diff --git a/hosts/void/overlays/local/.gitkeep b/hosts/void/overlays/local/.gitkeep diff --git a/hosts/wsl/overlays/bin/.gitkeep b/hosts/wsl/overlays/bin/.gitkeep diff --git a/hosts/wsl/overlays/config/.gitkeep b/hosts/wsl/overlays/config/.gitkeep diff --git a/hosts/wsl/overlays/default.nix b/hosts/wsl/overlays/default.nix @@ -1,76 +1 @@ -{ - config, - lib, - inputs, - ... -}: let - date = inputs.self.lastModifiedDate or "19700101000000"; - year = lib.substring 0 4 date; - monthNum = lib.substring 4 2 date; - month = lib.elemAt [ - "january" - "february" - "march" - "april" - "may" - "june" - "july" - "august" - "september" - "october" - "november" - "december" - ] (lib.toInt (lib.removePrefix "0" monthNum) - 1); - - tmplArgs = { - inherit year month; - homeDir = config.home.homeDirectory; - }; - - mkMapping = path: prefix: let - scan = dir: rel: - lib.concatLists (lib.mapAttrsToList (name: type: let - newRel = - if rel == "" - then name - else "${rel}/${name}"; - newPath = dir + "/${name}"; - in - if type == "directory" - then scan newPath newRel - else [ - { - name = newRel; - path = newPath; - } - ]) - (builtins.readDir dir)); - in - builtins.listToAttrs (map (file: let - isNix = lib.hasSuffix ".nix" file.name; - target = prefix + (lib.removeSuffix ".nix" file.name); - in - lib.nameValuePair target ( - if isNix - then { - text = import file.path tmplArgs; - force = true; - } - else { - source = file.path; - force = true; - } - )) (scan path "")); -in { - config = { - home.file = lib.mapAttrs (_: lib.mkForce) ( - (mkMapping ./home ".") - // (lib.mapAttrs (_: v: v // {executable = true;}) (mkMapping ./bin "bin/")) - // (mkMapping ./local ".local/") - ); - - xdg.configFile = lib.mapAttrs (_: lib.mkForce) (mkMapping ./config ""); - - home.sessionPath = ["$HOME/bin"]; - }; -} +import ../../../modules/mixins/overlays.nix ./. diff --git a/hosts/wsl/overlays/home/.gitkeep b/hosts/wsl/overlays/home/.gitkeep diff --git a/hosts/wsl/overlays/local/.gitkeep b/hosts/wsl/overlays/local/.gitkeep diff --git a/modules/mixins/dotfiles/config/emacs/.gitigonre b/modules/mixins/dotfiles/config/emacs/.gitigonre @@ -0,0 +1,4 @@ +/* +!init.el +!lisp/ +!lisp/* diff --git a/modules/mixins/dotfiles/config/emacs/init.el b/modules/mixins/dotfiles/config/emacs/init.el @@ -0,0 +1,28 @@ +;;; init.el --- Main Emacs configuration entry point +;;; Loads all configuration modules + +(let ((lisp-dir (expand-file-name "lisp" user-emacs-directory))) + (when (file-exists-p lisp-dir) + (add-to-list 'load-path lisp-dir))) + +(require 'core) +(require 'evil-setup) +(require 'theme) +(require 'completion) +(require 'files) +(require 'git) +(require 'lsp) +(require 'keymaps) +(require 'ui) +(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. + '(package-selected-packages nil)) +(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. + ) diff --git a/modules/mixins/dotfiles/config/emacs/lisp/completion.el b/modules/mixins/dotfiles/config/emacs/lisp/completion.el @@ -0,0 +1,139 @@ +;;; completion.el --- Completion system configuration +;;; Commentary: +;;; Fuzzy finder and completion setup + +;;; Code: + +;; Fuzzy finder setup (replacing fzf-lua with vertico/consult) +(use-package vertico + :ensure t + :init + (vertico-mode)) + +(use-package orderless + :ensure t + :custom + (completion-styles '(orderless basic)) + (completion-category-overrides '((file (styles basic partial-completion))))) + +(use-package marginalia + :ensure t + ;; Bind `marginalia-cycle' locally after `vertico-cycle' + :after vertico + :custom + (marginalia-annotators '(marginalia-annotators-heavy marginalia-annotators-light nil)) + :init + (marginalia-mode)) + +(use-package consult + :ensure t + ;; Replace bindings + :bind (("C-x M-:" . consult-complex-command) ; orig. repeat-complex-command + ("C-x b" . consult-buffer) ; orig. switch-to-buffer + ("C-x 4 b" . consult-buffer-other-window) + ("C-x 5 b" . consult-buffer-other-frame) + ("C-x r b" . consult-bookmark) ; orig. bookmark-jump + ("C-M-j" . consult-buffer-jump) ; orig. switch-to-buffer-other-window + ("C-M-k" . consult-buffer-other-window) + ("M-y" . consult-yank-pop) ; orig. yank-pop + ("M-g g" . consult-goto-line) ; orig. goto-line + ("M-g M-g" . consult-goto-line) ; orig. goto-line + ("M-g o" . consult-outline) ; orig. outline-browse + ("M-g m" . consult-mark) ; orig. pop-to-mark-command + ("M-g k" . consult-global-mark) ; orig. pop-global-mark + ("M-g i" . consult-imenu) ; orig. imenu + ("M-g I" . consult-imenu-multi) ; orig. imenu + ("M-s d" . consult-find) ; orig. find + ("M-s D" . consult-locate) ; orig. locate + ("M-s g" . consult-grep) ; orig. grep + ("M-s G" . consult-git-grep) ; orig. git-grep + ("M-s r" . consult-ripgrep) ; orig. rg + ("M-s l" . consult-line) ; orig. keep-lines + ("M-s L" . consult-line-multi) ; orig. keep-lines-read-only + ("M-s k" . consult-keep-lines) ; orig. keep-lines + ("M-s u" . consult-focus-lines) ; orig. flush-lines + ("M-s U" . consult-focus-lines-other-window) + ("M-s e" . consult-isearch-history) ; orig. isearch-edit-string + :map isearch-mode-map + ("M-e" . consult-isearch-history) ; orig. isearch-edit-string + ("M-s e" . consult-isearch-history) ; orig. isearch-edit-string + ("M-s l" . consult-line) ; needed by consult-line to detect isearch + ("M-s L" . consult-line-multi)) ; needed by consult-line to detect isearch + :init + ;; Optionally configure the register formatting. This improves the register + ;; preview for `consult-register', `consult-register-load' and others. + (setq register-preview-delay 0.5 + register-preview-function #'consult-register-format) + :config + (consult-customize + consult-theme :preview-key '(:debounce 0.2 any) + consult-ripgrep consult-git-grep consult-grep + consult-bookmark consult-recent-file consult-xref + :preview-key '(:debounce 0.4 any)) + (setq consult-narrow-key "<") ;; (kbd "<") is not recognized + (setq consult-line-numbers-widen t) + (setq consult-locate-args (list "locate" "--regex" "--ignore-case"))) + +(use-package embark + :ensure t + :bind + (("C-." . embark-act) ; pick some comfortable binding + ("C-;" . embark-dwim) ; good alternative: M-. + ("C-h B" . embark-bindings)) ; alternative for `describe-bindings' + :init + (setq prefix-help-command #'embark-prefix-help-command) + :config + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + +(use-package embark-consult + :ensure t + :after (embark consult) + :demand t) + +;; Completion system (replacing blink.cmp with corfu/company) +(use-package corfu + :ensure t + :custom + (corfu-cycle t) ;; Enable cycling for `corfu-next/previous' + (corfu-auto t) ;; Enable auto completion + (corfu-auto-delay 0.2) + (corfu-auto-prefix 2) + (corfu-separator ?\s) ;; Orderless field separator + (corfu-quit-at-boundary t) ;; Never quit at completion boundary + (corfu-quit-no-match t) ;; Never quit, even if there is no match + (corfu-preview-current t) ;; Insert current candidate preview on demand + (corfu-preselect 'prompt) ;; Always preselect the prompt + :init + (global-corfu-mode) + :bind + (:map corfu-map + ("TAB" . corfu-next) + ([tab] . corfu-next) + ("S-TAB" . corfu-previous) + ([backtab] . corfu-previous))) + +;; Add extensions for corfu +(use-package corfu-popupinfo + :after corfu + :hook (corfu-mode . corfu-popupinfo-mode)) + +;; Snippets (replacing LuaSnip with yasnippet) +(use-package yasnippet + :ensure t + :config + (yas-global-mode 1)) + +(use-package yasnippet-snippets + :ensure t + :after yasnippet) + +;; Better ordering of completion candidates +(use-package pcre2el + :ensure t) + +(provide 'completion) + +;;; completion.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/core.el b/modules/mixins/dotfiles/config/emacs/lisp/core.el @@ -0,0 +1,73 @@ +;;; core.el --- Core Emacs configuration +;;; Commentary: +;;; Basic settings and package management + +;;; Code: + +;; Package management +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +(add-to-list 'package-archives '("elpa" . "https://elpa.gnu.org/packages/") t) +(package-initialize) + +;; Ensure use-package is installed +(unless (package-installed-p 'use-package) + (package-refresh-contents) + (package-install 'use-package)) + +(eval-when-compile + (require 'use-package)) + +;; Basic Emacs settings +(setq inhibit-startup-message t) +(setq visible-bell t) +(setq make-backup-files nil) +(setq auto-save-default nil) +(setq-default tab-width 2) +(setq-default indent-tabs-mode nil) +(setq-default fill-column 80) +(setq-default word-wrap t) +(setq-default truncate-lines t) +(electric-pair-mode 1) +(show-paren-mode 1) +(column-number-mode 1) +(size-indication-mode 1) +(global-display-line-numbers-mode 1) + +;; Prefer tree-sitter modes when available +(setq major-mode-remap-alist + '((bash-mode . bash-ts-mode) + (c-mode . c-ts-mode) + (c++-mode . c++-ts-mode) + (css-mode . css-ts-mode) + (javascript-mode . js-ts-mode) + (js-mode . js-ts-mode) + (json-mode . json-ts-mode) + (python-mode . python-ts-mode) + (ruby-mode . ruby-ts-mode) + (rust-mode . rust-ts-mode) + (typescript-mode . tsx-ts-mode) + (html-mode . html-ts-mode))) + +;; Enable clipboard integration +(setq select-enable-clipboard t) +(setq select-enable-primary t) + +;; Set up backup, swap, and undo directories +(let ((backup-dir (expand-file-name "backup" user-emacs-directory)) + (autosave-dir (expand-file-name "autosave" user-emacs-directory)) + (undo-dir (expand-file-name "undo" user-emacs-directory))) + (when (not (file-exists-p backup-dir)) + (make-directory backup-dir t)) + (when (not (file-exists-p autosave-dir)) + (make-directory autosave-dir t)) + (when (not (file-exists-p undo-dir)) + (make-directory undo-dir t)) + + (setq backup-directory-alist `(("." . ,backup-dir))) + (setq auto-save-file-name-transforms `((".*" ,autosave-dir t))) + (setq undo-tree-history-directory-alist `(("." . ,undo-dir)))) + +(provide 'core) + +;;; core.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/evil-setup.el b/modules/mixins/dotfiles/config/emacs/lisp/evil-setup.el @@ -0,0 +1,57 @@ +;;; evil-setup.el --- Evil mode configuration +;;; Commentary: +;;; Evil mode setup with Vim-like keybindings + +;;; Code: + +(use-package evil + :ensure t + :init + (setq evil-want-integration t) + (setq evil-want-keybinding nil) + (setq evil-vsplit-window-right t) + (setq evil-split-window-below t) + (setq evil-want-C-u-scroll t) + (setq evil-undo-system 'undo-tree) + :config + (evil-mode 1) + (define-key evil-insert-state-map (kbd "C-g") 'evil-normal-state) + (define-key evil-insert-state-map (kbd "C-h") 'evil-delete-backward-char-and-join) + + ;; Use visual line motions even outside of visual-line-mode + (evil-global-set-key 'motion "j" 'evil-next-visual-line) + (evil-global-set-key 'motion "k" 'evil-previous-visual-line) + + ;; Set leader key to space + (evil-set-leader 'normal (kbd "SPC")) + + (setq evil-want-fine-undo t)) + +(use-package evil-collection + :after evil + :ensure t + :config + (evil-collection-init)) + +(use-package undo-tree + :ensure t + :after evil + :config + (global-undo-tree-mode 1) + (evil-set-undo-system 'undo-tree)) + +(use-package evil-surround + :ensure t + :after evil + :config + (global-evil-surround-mode 1)) + +(use-package evil-commentary + :ensure t + :after evil + :config + (evil-commentary-mode)) + +(provide 'evil-setup) + +;;; evil-setup.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/files.el b/modules/mixins/dotfiles/config/emacs/lisp/files.el @@ -0,0 +1,41 @@ +;;; files.el --- File and directory management +;;; Commentary: +;;; File explorer and directory operations + +;;; Code: + +;; File explorer configuration (replacing oil.nvim with dired) +(use-package dired + :ensure nil + :commands (dired dired-jump) + :config + (setq dired-listing-switches "-agho --group-directories-first") + (setq delete-by-moving-to-trash t) + (setq dired-recursive-deletes 'top) + (setq dired-recursive-copies 'always) + (evil-collection-define-key 'normal 'dired-mode-map + "h" 'dired-up-directory + "l" 'dired-find-file)) + +(use-package dired-x + :ensure nil + :after dired) + +(use-package dired-open + :ensure t + :config + (setq dired-open-extensions '(("gif" . "feh") + ("jpg" . "feh") + ("png" . "feh") + ("pdf" . "evince") + ("mkv" . "mpv") + ("mp4" . "mpv")))) + +;; Enable dired-hide-dotfiles +(use-package dired-hide-dotfiles + :ensure t + :hook (dired-mode . dired-hide-dotfiles-mode)) + +(provide 'files) + +;;; files.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/git.el b/modules/mixins/dotfiles/config/emacs/lisp/git.el @@ -0,0 +1,27 @@ +;;; git.el --- Git integration +;;; Commentary: +;;; Magit and git-related configuration + +;;; Code: + +;; Git integration (replacing neogit with magit) +(use-package magit + :ensure t + :commands (magit-status magit-get-current-branch) + :custom + (magit-display-buffer-function #'magit-display-buffer-same-window-except-diff-v1) + :config + ;; Evil integration for magit + (evil-collection-magit-setup)) + +;; Diff viewer (replacing diffview.nvim with ediff) +(use-package ediff + :ensure nil + :config + (setq ediff-window-setup-function 'ediff-setup-windows-plain) + (setq ediff-split-window-function 'split-window-horizontally) + (setq ediff-merge-split-window-function 'split-window-horizontally)) + +(provide 'git) + +;;; git.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/keymaps.el b/modules/mixins/dotfiles/config/emacs/lisp/keymaps.el @@ -0,0 +1,98 @@ +;;; keymaps.el --- Key mappings +;;; Commentary: +;;; Ported key mappings from Neovim + +;;; Code: + +(use-package evil + :after evil-collection + :config + ;; File navigation keymaps + (evil-define-key 'normal 'global (kbd "SPC SPC") 'consult-find) ; find files + (evil-define-key 'normal 'global (kbd "SPC f f") 'consult-find) ; find files (same as SPC SPC) + (evil-define-key 'normal 'global (kbd "SPC f r") 'consult-recent-file) ; recent files + (evil-define-key 'normal 'global (kbd "SPC f g") 'consult-ripgrep) ; grep project + (evil-define-key 'normal 'global (kbd "SPC f b") 'consult-buffer) ; buffers + (evil-define-key 'normal 'global (kbd "SPC f d") 'dired) ; dired file manager + + ;; Git keymaps + (evil-define-key 'normal 'global (kbd "SPC g s") 'magit-status) ; git status + (evil-define-key 'normal 'global (kbd "-") 'dired) ; Oil + (evil-define-key 'normal 'global (kbd "f") 'avy-goto-word) ; HopWord (using avy) + + ;; LSP keymaps (eglot) + (evil-define-key 'normal 'global (kbd "SPC g g") 'eldoc-doc-buffer) ; hover + (evil-define-key 'normal 'global (kbd "SPC g d") 'xref-find-definitions) ; definition + (evil-define-key 'normal 'global (kbd "SPC g D") 'ignore) ; declaration (ignore) + (evil-define-key 'normal 'global (kbd "SPC g i") 'eglot-find-implementation) ; implementation + (evil-define-key 'normal 'global (kbd "SPC g t") 'eglot-find-typeDefinition) ; type_definition + (evil-define-key 'normal 'global (kbd "SPC g r") 'xref-find-references) ; references + (evil-define-key 'normal 'global (kbd "SPC g S") 'eldoc) ; signature_help + (evil-define-key 'normal 'global (kbd "SPC r r") 'eglot-rename) ; rename + (evil-define-key 'normal 'global (kbd "SPC g a") 'eglot-code-actions) ; code_action + (evil-define-key 'normal 'global (kbd "SPC t r") 'consult-imenu) ; document_symbol + + ;; Todo toggle mappings + (evil-define-key 'normal 'global (kbd "SPC t a") 'insert-checkbox) + (evil-define-key 'normal 'global (kbd "SPC t t") 'toggle-checkbox) + + ;; Diagnostic keymaps (flymake) + (evil-define-key 'normal 'global (kbd "SPC g l") 'flymake-show-diagnostics-buffer) ; open_float + (evil-define-key 'normal 'global (kbd "SPC g p") 'flymake-goto-prev-error) ; goto_prev + (evil-define-key 'normal 'global (kbd "SPC g n") 'flymake-goto-next-error) ; goto_next + + ;; Visual formatting + (evil-define-key 'visual 'global (kbd "SPC g f") 'eglot-format) + + ;; Completion in insert mode + (evil-define-key 'insert 'global (kbd "C-SPC") 'completion-at-point) + + ;; Window management (winner mode) + (evil-define-key 'normal 'global (kbd "C-c w") 'winner-undo) + (evil-define-key 'normal 'global (kbd "C-c W") 'winner-redo) + + ;; Dashboard refresh + (evil-define-key 'normal 'global (kbd "SPC d") 'dashboard-refresh-buffer) + + ;; Which-key + (evil-define-key 'normal 'global (kbd "SPC h k") 'which-key-show-major-mode) + + ;; Project management + (evil-define-key 'normal 'global (kbd "SPC p p") 'project-switch-project) ; switch project + (evil-define-key 'normal 'global (kbd "SPC p f") 'project-find-file) ; find file in project + + ;; Delete without yank + (evil-define-key 'normal 'global (kbd "x") 'delete-char)) + +;; Helper functions for todo toggles +(defun insert-checkbox () + "Insert a new checkbox line." + (interactive) + (beginning-of-line) + (insert "- [ ] ") + (forward-char 4)) + +(defun toggle-checkbox () + "Toggle the state of a checkbox at point." + (interactive) + (save-excursion + (beginning-of-line) + (cond + ((looking-at "- \\[ \\]") + (replace-match "- [-]")) + ((looking-at "- \\[-\\]") + (replace-match "- [x]")) + ((looking-at "- \\[x\\]") + (replace-match "- [ ]"))))) + +;; Install avy for navigation (replacing hop.nvim) +(use-package avy + :ensure t + :config + (setq avy-background t) + (setq avy-style 'de-bruijn) + (setq avy-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l ?q ?w ?e ?r ?t ?y ?u ?i ?o ?p))) + +(provide 'keymaps) + +;;; keymaps.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/lsp.el b/modules/mixins/dotfiles/config/emacs/lisp/lsp.el @@ -0,0 +1,181 @@ +;;; lsp.el --- Language Server Protocol configuration +;;; Commentary: +;;; LSP setup with eglot and lsp-mode + +;;; Code: + +;; LSP support (replacing nvim-lspconfig with eglot/lsp-mode) +(use-package eglot + :ensure nil + :config + ;; Add support for the LSP servers used in the neovim config + (add-to-list 'eglot-server-programs + '((python-mode python-ts-mode) . ("basedpyright"))) + (add-to-list 'eglot-server-programs + '((c-mode c++-mode) . ("clangd"))) + (add-to-list 'eglot-server-programs + '(go-mode . ("gopls"))) + (add-to-list 'eglot-server-programs + '(gleam-mode . ("gleam"))) + (add-to-list 'eglot-server-programs + '(nix-mode . ("nixd"))) + (add-to-list 'eglot-server-programs + '((php-mode) . ("intelephense"))) + (add-to-list 'eglot-server-programs + '(rust-mode . ("rust-analyzer"))) + (add-to-list 'eglot-server-programs + '((typescript-mode typescript-ts-mode js-mode js-jsx-mode) . ("typescript-language-server" "--stdio"))) + (add-to-list 'eglot-server-programs + '(elm-mode . ("elm-language-server"))) + (add-to-list 'eglot-server-programs + '(zig-mode . ("zls"))) + + ;; Enable eglot for supported modes + :hook + ((python-mode . eglot-ensure) + (c-mode . eglot-ensure) + (c++-mode . eglot-ensure) + (go-mode . eglot-ensure) + (gleam-mode . eglot-ensure) + (nix-mode . eglot-ensure) + (php-mode . eglot-ensure) + (rust-mode . eglot-ensure) + (typescript-mode . eglot-ensure) + (js-mode . eglot-ensure) + (elm-mode . eglot-ensure) + (zig-mode . eglot-ensure))) + +;; LSP improvements with lsp-mode +(use-package lsp-mode + :ensure t + :commands (lsp lsp-deferred) + :init + (setq lsp-keymap-prefix "C-c l") + :config + (lsp-enable-which-key-integration t)) + +(use-package lsp-ui + :ensure t + :hook (lsp-mode . lsp-ui-mode) + :config + (setq lsp-ui-doc-enable t + lsp-ui-doc-position 'bottom + lsp-ui-sideline-enable t + lsp-ui-sideline-show-hover t)) + +(use-package lsp-treemacs + :ensure t + :after lsp-mode) + +;; Tree-sitter support with comprehensive grammar installation +(use-package tree-sitter + :ensure t + :config + (global-tree-sitter-mode) + (add-hook 'tree-sitter-after-on-hook #'tree-sitter-hl-mode)) + +(use-package tree-sitter-langs + :ensure t + :after tree-sitter + :config + ;; Ensure all popular tree-sitter grammars are installed + (dolist (lang-tree '((bash . bash-ts-mode) + (c . c-ts-mode) + (cpp . c++-ts-mode) + (csharp . csharp-ts-mode) + (css . css-ts-mode) + (elixir . elixir-ts-mode) + (elm . elm-ts-mode) + (go . go-ts-mode) + (html . html-ts-mode) + (java . java-ts-mode) + (javascript . js-ts-mode) + (json . json-ts-mode) + (julia . julia-ts-mode) + (lua . lua-ts-mode) + (markdown . markdown-ts-mode) + (nix . nix-ts-mode) + (ocaml . ocaml-ts-mode) + (php . php-ts-mode) + (python . python-ts-mode) + (ruby . ruby-ts-mode) + (rust . rust-ts-mode) + (scala . scala-ts-mode) + (sql . sql-ts-mode) + (toml . toml-ts-mode) + (typescript . tsx-ts-mode) + (typescriptreact . tsx-ts-mode) + (zig . zig-ts-mode))) + ;; Enable ts-modes for each language when available + (let ((ts-mode (cdr lang-tree))) + (when (fboundp ts-mode) + (add-to-list 'tree-sitter-major-mode-language-alist + `(,(replace-regexp-in-string "-mode$" "" (symbol-name ts-mode)) . + ,(replace-regexp-in-string "-mode$" "" (symbol-name (car lang-tree)))))))) + + ;; Auto-install any missing grammars + (ignore-errors + (tree-sitter-require 'bash) + (tree-sitter-require 'c) + (tree-sitter-require 'cpp) + (tree-sitter-require 'csharp) + (tree-sitter-require 'css) + (tree-sitter-require 'elixir) + (tree-sitter-require 'elm) + (tree-sitter-require 'go) + (tree-sitter-require 'html) + (tree-sitter-require 'java) + (tree-sitter-require 'javascript) + (tree-sitter-require 'json) + (tree-sitter-require 'julia) + (tree-sitter-require 'lua) + (tree-sitter-require 'markdown) + (tree-sitter-require 'nix) + (tree-sitter-require 'ocaml) + (tree-sitter-require 'php) + (tree-sitter-require 'python) + (tree-sitter-require 'ruby) + (tree-sitter-require 'rust) + (tree-sitter-require 'scala) + (tree-sitter-require 'sql) + (tree-sitter-require 'toml) + (tree-sitter-require 'typescript) + (tree-sitter-require 'zig))) + +;; Enable flymake for diagnostics (replacing neovim diagnostics) +(use-package flymake + :ensure nil + :hook (prog-mode . flymake-mode) + :config + ;; Remove default flymake keybindings + (define-key flymake-mode-map (kbd "M-n") nil) + (define-key flymake-mode-map (kbd "M-p") nil)) + +;; Auto-formatting on save (replacing neovim auto-format) +(use-package apheleia + :ensure t + :config + (apheleia-global-mode +1) + ;; Add formatters for different file types + (setf (alist-get 'python-mode apheleia-formatters) + '(ruff isort)) + (setf (alist-get 'rust-mode apheleia-formatters) + '(rustfmt)) + (setf (alist-get 'go-mode apheleia-formatters) + '(gofumpt)) + (setf (alist-get 'nix-mode apheleia-formatters) + '(nixfmt)) + (setf (alist-get 'typescript-mode apheleia-formatters) + '(prettier)) + (setf (alist-get 'js-mode apheleia-formatters) + '(prettier)) + (setf (alist-get 'json-mode apheleia-formatters) + '(prettier)) + (setf (alist-get 'css-mode apheleia-formatters) + '(prettier)) + (setf (alist-get 'web-mode apheleia-formatters) + '(prettier))) + +(provide 'lsp) + +;;; lsp.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/theme.el b/modules/mixins/dotfiles/config/emacs/lisp/theme.el @@ -0,0 +1,41 @@ +;;; theme.el --- Theme configuration +;;; Commentary: +;;; Doric dark theme setup with terminal optimization + +;;; Code: + +;; Theme configuration - Doric Dark theme +(use-package doric-themes + :ensure t + :config + ;; Load Doric Dark theme + (load-theme 'doric-dark t) + (setq doric-themes-mode-line-height 1.0) + (setq doric-themes-box-buttons 'all) + (setq doric-themes-disable-italic nil) + (setq doric-themes-disable-bold nil)) + +;; Terminal-specific settings +(defun my/terminal-setup () + "Setup for terminal Emacs." + (when (not (display-graphic-p)) + ;; Ensure colors work properly in terminal + (setq evil-default-cursor t) + + ;; Better font locking in terminal + (setq font-lock-maximum-decoration t) + + ;; Enable xterm-256color support + (when (and (not (display-graphic-p)) + (not (string-match "256color" (getenv "TERM")))) + (let ((term "xterm-256color")) + (set-terminal-coding-system 'utf-8) + (set-keyboard-coding-system 'utf-8) + (prefer-coding-system 'utf-8))))) + +;; Apply terminal setup +(my/terminal-setup) + +(provide 'theme) + +;;; theme.el ends here diff --git a/modules/mixins/dotfiles/config/emacs/lisp/ui.el b/modules/mixins/dotfiles/config/emacs/lisp/ui.el @@ -0,0 +1,137 @@ +;;; ui.el --- User interface enhancements +;;; Commentary: +;;; Modern UI-related packages and settings for terminal Emacs + +;;; Code: + +;; Which-key for showing available keybindings +(use-package which-key + :ensure t + :init (which-key-mode) + :config + (setq which-key-side-window-location 'bottom + which-key-sort-order #'which-key-key-order-alpha + which-key-sort-uppercase-first nil + which-key-add-column-padding 1 + which-key-max-display-columns nil + which-key-min-display-lines 6 + which-key-side-window-slot -10 + which-key-side-window-max-height 0.25)) + +;; Dashboard for startup screen +(use-package dashboard + :ensure t + :config + (dashboard-setup-startup-hook) + (setq dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + (registers . 5))) + (setq dashboard-banner-logo-title "Welcome to Emacs!") + (setq dashboard-startup-banner 'official) + (setq dashboard-center-content t) + (setq dashboard-show-shortcuts nil) + (setq dashboard-set-file-icons t) + (setq dashboard-set-heading-icons t)) + +;; Nerd icons (works in terminal with nerd-fonts) +(use-package nerd-icons + :ensure t) + +(use-package nerd-icons-dired + :ensure t + :hook (dired-mode . nerd-icons-dired-mode)) + +;; Rainbow delimiters for better code readability +(use-package rainbow-delimiters + :ensure t + :hook (prog-mode . rainbow-delimiters-mode)) + +;; Highlight indent guides +(use-package highlight-indent-guides + :ensure t + :hook ((prog-mode text-mode) . highlight-indent-guides-mode) + :config + (setq highlight-indent-guides-method 'character) + (setq highlight-indent-guides-responsive 'stack) + (setq highlight-indent-guides-delay 0.1)) + +;; Smartparens for better parenthesis handling +(use-package smartparens + :ensure t + :config + (require 'smartparens-config) + (smartparens-global-mode 1) + (show-smartparens-global-mode 1) + + ;; Keybindings for smartparens + (sp-with-modes '(markdown-mode gfm-mode) + (sp-local-pair "*" "*" :actions '(wrap)) + (sp-local-pair "_" "_" :actions '(wrap))) + + (sp-with-modes '(org-mode) + (sp-local-pair "~" "~" :actions '(wrap)) + (sp-local-pair "/" "/" :actions '(wrap)))) + +;; Git gutter in fringe +(if (display-graphic-p) + (use-package git-gutter-fringe + :ensure t + :hook (prog-mode . git-gutter-fringe-mode) + :config + (setq git-gutter-fr:side 'left-fringe) + (setq git-gutter:modified-sign "~") + (setq git-gutter:added-sign "+") + (setq git-gutter:deleted-sign "-")) + (use-package git-gutter + :ensure t + :hook (prog-mode . git-gutter-mode) + :config + (setq git-gutter:modified-sign "~") + (setq git-gutter:added-sign "+") + (setq git-gutter:deleted-sign "-"))) + +;; Focus mode for better code concentration +(use-package focus + :ensure t + :bind ("C-c f" . focus-mode)) + +;; Improved scrolling +(setq scroll-margin 10 + scroll-conservatively 101 + scroll-up-aggressively 0.01 + scroll-down-aggressively 0.01 + scroll-preserve-screen-position t + auto-window-vscroll nil) + +;; Better frame titles +(setq frame-title-format '("%b - Emacs")) + +;; Remove UI clutter +(when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) +(when (fboundp 'tool-bar-mode) (tool-bar-mode -1)) +(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) +(when (fboundp 'tooltip-mode) (tooltip-mode -1)) +(when (fboundp 'fringe-mode) (fringe-mode 1)) + +;; Highlight current line +(global-hl-line-mode 1) + +;; Show trailing whitespace +(setq show-trailing-whitespace t) + +;; Enable winner mode for window management +(winner-mode 1) + +;; Improve buffer names +(use-package uniquify + :config + (setq uniquify-buffer-name-style 'forward + uniquify-separator "/" + uniquify-after-kill-buffer-p t + uniquify-ignore-buffers-re "^\\*")) + +(provide 'ui) + +;;; ui.el ends here diff --git a/modules/mixins/dotfiles/config/foot/foot.ini b/modules/mixins/dotfiles/config/foot/foot.ini @@ -1,9 +1,8 @@ [main] -font=Intel One Mono:style=Regular:size=12 -font-bold=Intel One Mono:style=Regular:size=12 -font-italic=Intel One Mono:style=Regular:size=12 -font-bold-italic=Intel One Mono:style=Regular:size=12 -pad=2x2 +font=Ttyp0 OTB:style=Regular:size=13 +font-bold=Ttyp0 OTB:style=Regular:size=13 +font-italic=Ttyp0 OTB:style=Regular:size=13 +font-bold-italic=Ttyp0 OTB:style=Regular:size=13 [scrollback] lines=10000 @@ -17,31 +16,31 @@ blink=no [colors-dark] alpha = 0.85 -cursor=000000 ccaaee +cursor=181818 eeddbb -background=000000 -foreground=ffffff +background=181818 +foreground=e7e7e7 -selection-foreground=ffffff -selection-background=50447f +selection-foreground=e7e7e7 +selection-background=505050 -regular0=332d38 +regular0=2f2f2f regular1=eca28f regular2=b9d0aa regular3=c0b080 regular4=9fbfe7 regular5=e9acbf regular6=a0c0d0 -regular7=ffffff +regular7=e7e7e7 -bright0=332d38 +bright0=2f2f2f bright1=eca28f bright2=b9d0aa bright3=c0b080 bright4=9fbfe7 bright5=e9acbf bright6=a0c0d0 -bright7=ffffff +bright7=e7e7e7 [key-bindings] clipboard-copy=Control+Shift+c diff --git a/modules/mixins/dotfiles/config/nvim/README.md b/modules/mixins/dotfiles/config/nvim/README.md @@ -1,22 +0,0 @@ -To recompile `fnl` files into `lua` I use this shell function: - -```bash -nvimrecomp() { - nvim_config_path_path="$HOME/.config/nvim" - - mkdir -p "$nvim_config_path"/lua/config - - find "$nvim_config_path/fnl" -type f -name "*.fnl" | while read -r fnl_file; do - rel_path="${fnl_file#"$nvim_config_path"/fnl/}" - - if [ "$rel_path" = "init.fnl" ]; then - lua_file="$nvim_config_path/init.lua" - else - lua_file="$nvim_config_path/lua/${rel_path%.fnl}.lua" - fi - - fennel --compile "$fnl_file" | tee "$lua_file" > /dev/null - echo "$lua_file recompiled" - done -} -``` diff --git a/modules/mixins/dotfiles/config/nvim/TREESITTER.md b/modules/mixins/dotfiles/config/nvim/TREESITTER.md @@ -1,73 +0,0 @@ -# Neovim 0.12+ Tree-sitter Manual - -In Neovim 0.12 and later, Tree-sitter support is deeply integrated into the core. While plugins like `nvim-treesitter` provide management commands, Neovim itself handles the loading of parsers and queries through the standard **runtimepath (RTP)** mechanism. - -## 1. Storage Location - -By default, Neovim looks for Tree-sitter assets in any directory listed in your `runtimepath`. The standard user-writable location for these is: - -`~/.local/share/nvim/site/` (or `stdpath('data') .. '/site'`) - -### Directory Structure -```text -~/.local/share/nvim/site/ -├── parser/ # Compiled grammar libraries (.so or .dll) -│ ├── fennel.so -│ ├── purescript.so -│ └── ... -├── parser-info/ # Metadata used by management tools (optional) -│ ├── fennel.lua -│ └── ... -└── queries/ # Tree-sitter query files (.scm) - ├── fennel/ - │ ├── highlights.scm - │ ├── folds.scm - │ └── injections.scm - └── purescript/ - └── highlights.scm -``` - -## 2. Discovery Mechanism - -Neovim discovers Tree-sitter assets by searching for specific subdirectories in the RTP: - -1. **Parsers**: It looks for a `parser/` directory and attempts to load `<language>.so`. -2. **Queries**: It looks for `queries/<language>/` and loads `.scm` files (e.g., `highlights.scm`, `folds.scm`, `indents.scm`). - -You can verify if a directory is in your RTP by running: -```vim -:set runtimepath? -``` - -## 3. Manual Installation - -If you want to install a parser manually without a plugin: - -1. **Compile the Parser**: Use the `tree-sitter` CLI or a C compiler to generate a shared object (`.so`) from the grammar's `src/parser.c` (and `src/scanner.c` if it exists). -2. **Move the Parser**: Place the `.so` file in `~/.local/share/nvim/site/parser/<lang>.so`. -3. **Install Queries**: Copy the `.scm` files from the grammar's `queries/` directory (ensure they are compatible with Neovim) into `~/.local/share/nvim/site/queries/<lang>/`. - -## 4. Configuration and Activation - -Since Neovim 0.12 does not enable Tree-sitter automatically for every file, you should use an autocommand in your `init.lua` (or Fennel equivalent) to start the parser: - -```lua -vim.api.nvim_create_autocmd('FileType', { - callback = function() - local lang = vim.treesitter.language.get_lang(vim.bo.filetype) - if lang and pcall(vim.treesitter.language.inspect, lang) then - vim.treesitter.start(0, lang) - -- Optional: Enable folding - vim.wo.foldmethod = 'expr' - vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()' - end - end, -}) -``` - -## 5. Useful Commands - -- `:lua =vim.treesitter.language.inspect("fennel")`: Check if a language parser is correctly loaded. -- `:lua =vim.treesitter.get_parser(0):parse()`: Force a re-parse of the current buffer. -- `:InspectTree`: Open a window showing the syntax tree (built-in to Neovim 0.10+). -- `:EditQuery`: Open the query editor for the current language. diff --git a/modules/mixins/dotfiles/config/nvim/fnl/config/lsp.fnl b/modules/mixins/dotfiles/config/nvim/fnl/config/lsp.fnl @@ -51,6 +51,7 @@ :harper_ls {} :expert {} :ts_ls {} + :elmls {} :zls {}}] (each [server config (pairs servers)] (vim.lsp.enable server config)) diff --git a/modules/mixins/dotfiles/config/nvim/fnl/init.fnl b/modules/mixins/dotfiles/config/nvim/fnl/init.fnl @@ -33,7 +33,7 @@ {:lazy false :priority 1000 :config (fn [] - (vim.cmd.colorscheme :doric-dark) + (vim.cmd.colorscheme :doric-obsidian) (vim.api.nvim_set_hl 0 :Normal {:bg :NONE}) (vim.api.nvim_set_hl 0 :NormalFloat {:bg :NONE}) (vim.api.nvim_set_hl 0 :NormalNC {:bg :NONE}))}) diff --git a/modules/mixins/dotfiles/config/river/init b/modules/mixins/dotfiles/config/river/init @@ -7,7 +7,7 @@ alt="Mod4" term="foot" wobsock="$XDG_RUNTIME_DIR/wob.sock" -dmenu_args="-fn 'Ttyp0 OTB:size=10' -l 10 -h 20 -nb '#130911' -nf '#d0d0d0' -sb '#3f2f40' -sf '#d0d0d0' -nhb '#130911' -nhf '#1dbfcf'" +dmenu_args="-fn 'Ttyp0 OTB:size=10' -l 10 -h 20 -nb '#181818' -nf '#e7e7e7' -sb '#505050' -sf '#e7e7e7' -nhb '#181818' -nhf '#a0c0d0'" rivertile -view-padding 0 -outer-padding 0 -main-ratio 0.50 & diff --git a/modules/mixins/dotfiles/config/shell/profile/fzf b/modules/mixins/dotfiles/config/shell/profile/fzf @@ -3,8 +3,8 @@ export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS \ --ansi \ --layout=reverse \ --border=rounded \ - --color=bg+:#2a1f2e,bg:-1,spinner:#c084b8,hl:#e08060 \ - --color=fg:#c8b8bf,header:#c4607a,info:#7a6e7a,pointer:#c084b8 \ - --color=marker:#e06fad,fg+:#f0dfe5,prompt:#7a9fd4,hl+:#f0a070 \ - --color=border:#3d2a42 \ + --color=bg+:#505050,bg:-1,spinner:#e9acbf,hl:#eca28f \ + --color=fg:#e7e7e7,header:#eca28f,info:#a0c0d0,pointer:#e9acbf \ + --color=marker:#e9acbf,fg+:#e7e7e7,prompt:#9fbfe7,hl+:#eca28f \ + --color=border:#2f2f2f \ " diff --git a/modules/mixins/dotfiles/home/tmux.conf b/modules/mixins/dotfiles/home/tmux.conf @@ -8,19 +8,19 @@ set-option -g update-environment "WAYLAND_DISPLAY DISPLAY" set -g default-terminal "foot" set -g status-interval 30 -set -g status-style fg=#ffffff,bg=#332d38 +set -g status-style fg=#e7e7e7,bg=#2f2f2f set -g status-left '' set -g status-right '#(test -f /tmp/pracomer.log && cat /tmp/pracomer.log) %a %h-%d %H:%M #(cat /sys/class/power_supply/BAT*/capacity 2>/dev/null)%% ' -set -g pane-border-style fg=#332d38 -set -g pane-active-border-style fg=#50447f +set -g pane-border-style fg=#2f2f2f +set -g pane-active-border-style fg=#505050 -setw -g window-status-style fg=#a0c0d0,bg=#332d38 -setw -g window-status-current-style fg=#ffffff,bg=#50447f,bold +setw -g window-status-style fg=#a0c0d0,bg=#2f2f2f +setw -g window-status-current-style fg=#e7e7e7,bg=#505050,bold -set -g message-style fg=#ffffff,bg=#50447f -set -g message-command-style fg=#ffffff,bg=#50447f +set -g message-style fg=#e7e7e7,bg=#505050 +set -g message-command-style fg=#e7e7e7,bg=#505050 setw -g xterm-keys on set -ga terminal-overrides ',xterm*:XT' diff --git a/modules/mixins/overlays.nix b/modules/mixins/overlays.nix @@ -0,0 +1,76 @@ +overlayDir: { + config, + lib, + inputs, + ... +}: let + date = inputs.self.lastModifiedDate or "19700101000000"; + year = lib.substring 0 4 date; + monthNum = lib.substring 4 2 date; + month = lib.elemAt [ + "january" + "february" + "march" + "april" + "may" + "june" + "july" + "august" + "september" + "october" + "november" + "december" + ] (lib.toInt (lib.removePrefix "0" monthNum) - 1); + + tmplArgs = { + inherit year month; + homeDir = config.home.homeDirectory; + }; + + mkMapping = path: prefix: let + scan = dir: rel: + lib.concatLists (lib.mapAttrsToList (name: type: let + newRel = + if rel == "" + then name + else "${rel}/${name}"; + newPath = dir + "/${name}"; + in + if type == "directory" + then scan newPath newRel + else [ + { + name = newRel; + path = newPath; + } + ]) + (builtins.readDir dir)); + in + builtins.listToAttrs (map (file: let + isNix = lib.hasSuffix ".nix" file.name; + target = prefix + (lib.removeSuffix ".nix" file.name); + in + lib.nameValuePair target ( + if isNix + then { + text = import file.path tmplArgs; + force = true; + } + else { + source = file.path; + force = true; + } + )) (scan path "")); +in { + config = { + home.file = lib.mapAttrs (_: lib.mkForce) ( + lib.optionalAttrs (builtins.pathExists (overlayDir + "/home")) (mkMapping (overlayDir + "/home") ".") + // lib.optionalAttrs (builtins.pathExists (overlayDir + "/bin")) (lib.mapAttrs (_: v: v // {executable = true;}) (mkMapping (overlayDir + "/bin") "bin/")) + // lib.optionalAttrs (builtins.pathExists (overlayDir + "/local")) (mkMapping (overlayDir + "/local") ".local/") + ); + + xdg.configFile = lib.mapAttrs (_: lib.mkForce) ( + lib.optionalAttrs (builtins.pathExists (overlayDir + "/config")) (mkMapping (overlayDir + "/config") "") + ); + }; +} diff --git a/modules/mixins/secrets.nix b/modules/mixins/secrets.nix Binary files differ.