Removed bloat

This commit is contained in:
Aleksandr Lebedev 2025-11-05 17:37:42 +01:00
parent 24a98d8848
commit 1d4a8f7126

View file

@ -1,107 +1,6 @@
#+TITLE: KyleKrein's GNU Emacs Config #+TITLE: KyleKrein's GNU Emacs Config
#+STARTUP: showeverything #+STARTUP: showeverything
#+OPTIONS: toc:2
#+PROPERTY: header-args:emacs-lisp :lexical t #+PROPERTY: header-args:emacs-lisp :lexical t
* Table of contents :toc:
- [[#some-random-stuff-to-load-first][Some random stuff to load first]]
- [[#recent-files][Recent Files]]
- [[#golden-ratio][Golden ratio]]
- [[#duplicate-line][Duplicate line]]
- [[#keybindings][Keybindings]]
- [[#focus-new-windows][Focus new windows]]
- [[#support-functions][Support functions]]
- [[#git-package][Git package]]
- [[#emacs-function-launcher][Emacs function launcher]]
- [[#copy-to-clipboard][Copy to clipboard]]
- [[#detect-wsl][Detect WSL]]
- [[#is-android][Is Android]]
- [[#notifications][Notifications]]
- [[#app-launcher][App Launcher]]
- [[#standalone-run][Standalone run]]
- [[#backup-files-tilda-files][Backup files (tilda files)]]
- [[#dashboard][Dashboard]]
- [[#diminish][Diminish]]
- [[#dired-file-manager][DIRED (File manager)]]
- [[#emoji][Emoji]]
- [[#copy-to-clipboard-1][Copy to clipboard]]
- [[#standalone-emoji-picker][Standalone emoji picker]]
- [[#ediff][EDIFF]]
- [[#emacs-everywhere][Emacs Everywhere]]
- [[#fonts][Fonts]]
- [[#sane-defaults][Sane defaults]]
- [[#battery-info][Battery info]]
- [[#epub-support-reader-in-emacs][Epub support (Reader in Emacs)]]
- [[#magit][MAGIT]]
- [[#modeline][Modeline]]
- [[#drawing-tools][Drawing tools]]
- [[#rainbow-delimiters][RAINBOW DELIMITERS]]
- [[#calendar][Calendar]]
- [[#org-babel][Org Babel]]
- [[#org-mode][ORG MODE]]
- [[#org-copy-link][Org Copy Link]]
- [[#enabling-table-of-contents][Enabling Table of Contents]]
- [[#modern-org-mode][Modern Org Mode]]
- [[#org-level-headers][Org Level Headers]]
- [[#source-code-block-tag-expansion][Source Code Block Tag Expansion]]
- [[#insert-pictures][Insert pictures]]
- [[#update-org-tables][Update org tables]]
- [[#org-transclusion][Org transclusion]]
- [[#org-roam][ORG ROAM]]
- [[#org-roam-itself][Org Roam itself]]
- [[#ripgrep-files][Ripgrep files]]
- [[#org-roam-ui][Org Roam UI]]
- [[#inbox][Inbox]]
- [[#org-agenda][Org Agenda]]
- [[#refresh][Refresh]]
- [[#auto-update-agenda][Auto update agenda]]
- [[#todos-only-from-projects][TODOs only from Projects]]
- [[#small-settings][Small settings]]
- [[#todos-in-today][Todos in Today]]
- [[#notifications-1][Notifications]]
- [[#rainbow-mode][RAINBOW MODE]]
- [[#ai][AI]]
- [[#gptel][GPT.el]]
- [[#minuet][Minuet]]
- [[#shells-and-terminals][SHELLS AND TERMINALS]]
- [[#eshell][Eshell]]
- [[#vterm][Vterm]]
- [[#vterm-toggle][Vterm-Toggle]]
- [[#sudo-edit][SUDO EDIT]]
- [[#password-store][Password store]]
- [[#cmake-projects][CMake Projects]]
- [[#direnv][Direnv]]
- [[#language-support][Language support]]
- [[#nix][Nix]]
- [[#glsl][GLSL]]
- [[#qml][QML]]
- [[#rmlui][RmlUi]]
- [[#cmake][CMake]]
- [[#global-treesitter][Global treesitter]]
- [[#eglot][Eglot]]
- [[#nerd-icons][Nerd Icons]]
- [[#nerd-icons-completion][Nerd Icons Completion]]
- [[#persist-state][Persist state]]
- [[#multiple-cursors][Multiple cursors]]
- [[#buffer-move][Buffer Move]]
- [[#completions][Completions]]
- [[#corfu][Corfu]]
- [[#cape][Cape]]
- [[#vertico][Vertico]]
- [[#orderless][Orderless]]
- [[#consult][Consult]]
- [[#descriptions][Descriptions]]
- [[#communication][Communication]]
- [[#theme][Theme]]
- [[#theme-loading][Theme loading]]
- [[#transparency][Transparency]]
- [[#which-key][WHICH-KEY]]
- [[#emacs-on-android][Emacs on Android]]
- [[#fonts-1][Fonts]]
- [[#settings][Settings]]
- [[#emacs-on-wsl][Emacs on WSL]]
- [[#clipboard-fix][Clipboard fix]]
* Some random stuff to load first * Some random stuff to load first
** Recent Files ** Recent Files
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -136,8 +35,6 @@
(global-set-key (kbd "M-o") 'other-window) (global-set-key (kbd "M-o") 'other-window)
(global-set-key (kbd "C-c o t") 'vterm-toggle) (global-set-key (kbd "C-c o t") 'vterm-toggle)
(global-set-key (kbd "C-c o a") 'org-agenda) (global-set-key (kbd "C-c o a") 'org-agenda)
(global-set-key (kbd "C-c o d") 'dashboard-open)
(global-set-key (kbd "C-c o p") 'pass)
(global-set-key (kbd "C-c o m") 'magit) (global-set-key (kbd "C-c o m") 'magit)
(global-set-key (kbd "C-.") 'kylekrein/duplicate-line) (global-set-key (kbd "C-.") 'kylekrein/duplicate-line)
@ -185,36 +82,6 @@ Found this [[https://emacs.stackexchange.com/questions/21770/automatically-switc
:vc (:url ,url :rev :newest) :vc (:url ,url :rev :newest)
:ensure nil)))) :ensure nil))))
#+end_src #+end_src
** Emacs function launcher
Launches emacs function as a window
#+begin_src emacs-lisp
(defun create-launcher-frame ()
(make-frame '((name . "emacs-run-launcher")
(minibuffer . only)
(fullscreen . 0)
(undecorated . t)
(internal-border-width . 10)
(width . 80)
(height . 11))))
(defun emacs-run-launcher (func)
"Create and select a frame called emacs-run-launcher which consists only of a minibuffer and has specific dimensions. Runs func on that frame, which is an emacs command that prompts you to select something and open it dmenu like behaviour. Delete the frame after that command has exited"
(interactive)
(with-selected-frame
(make-frame '((name . "emacs-run-launcher")
(minibuffer . only)
(fullscreen . 0) ; no fullscreen
(undecorated . t) ; remove title bar
;;(auto-raise . t) ; focus on this frame
;;(tool-bar-lines . 0)
;;(menu-bar-lines . 0)
(internal-border-width . 10)
(width . 80)
(height . 11)))
(unwind-protect
(funcall func)
(delete-frame))))
#+end_src
** Copy to clipboard ** Copy to clipboard
Copies to both kill ring and system clipboard Copies to both kill ring and system clipboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -288,204 +155,31 @@ Using [[https://github.com/gkowzan/alert-toast][Alert toast]]
((kylekrein/detect-wsl) 'toast) ((kylekrein/detect-wsl) 'toast)
(t 'libnotify))) (t 'libnotify)))
#+end_src #+end_src
* App Launcher
This code creates a menu to launch linux apps, that have Desktop entry.
Code was taken from [[https://github.com/SebastienWae/app-launcher/blob/main/app-launcher.el][this awesome repo]]
#+begin_src emacs-lisp
(git-package "https://github.com/SebastienWae/app-launcher")
(use-package app-launcher)
#+end_src
** Standalone run
This code snippet runs app launcher without emacs frame
To use it, create a global keyboard shortcut with the following code
~emacsclient -cF "((visibility . nil))" -e "(emacs-run-app-launcher)"~
#+begin_src emacs-lisp
(defun emacs-run-app-launcher()
(emacs-run-launcher 'app-launcher-run-app))
#+end_src
* Backup files (tilda files) * Backup files (tilda files)
By default, Emacs creates automatic backups of files in their original directories, such “file.el” and the backup “file.el~”. This leads to a lot of clutter, so lets tell Emacs to put all backups that it creates in the ~.emacs.d~ directory. By default, Emacs creates automatic backups of files in their original directories, such “file.el” and the backup “file.el~”. This leads to a lot of clutter, so lets tell Emacs to put all backups that it creates in the ~.emacs.d~ directory.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq backup-directory-alist '((".*" . "~/.emacs.d/tildafiles"))) (setq backup-directory-alist '((".*" . "~/.emacs.d/tildafiles")))
#+end_src #+end_src
* Dashboard
Emacs Dashboard is an extensible startup screen showing you recent files, bookmarks, agenda items and an Emacs banner.
#+begin_src emacs-lisp
(use-package dashboard
:ensure t
:after (:all nerd-icons org org-agenda org-roam)
:init
(setq initial-buffer-choice (lambda () (get-buffer-create dashboard-buffer-name)))
(setq dashboard-week-agenda t)
;;(setq dashboard-filter-agenda-entry 'dashboard-no-filter-agenda)
(setq dashboard-display-icons-p t) ; display icons on both GUI and terminal
(setq dashboard-icon-type 'nerd-icons) ; use `nerd-icons' package
(setq dashboard-set-heading-icons t)
(setq dashboard-projects-backend 'project-el)
(setq dashboard-set-file-icons t)
(setq dashboard-banner-logo-title "Emacs Is More Than A Text Editor!\nPowered by Nix")
;;(setq dashboard-startup-banner 'logo) ;; use standard emacs logo as banner
(setq dashboard-center-content nil) ;; set to 't' for centered content
(setq dashboard-items '((recents . 5)
(agenda . 5 )
(bookmarks . 3)
(projects . 3)
(registers . 3)))
(setq dashboard-startupify-list '(dashboard-insert-banner
dashboard-insert-newline
dashboard-insert-banner-title
dashboard-insert-newline
dashboard-insert-navigator
dashboard-insert-newline
dashboard-insert-init-info
;dashboard-insert-items
dashboard-insert-newline
dashboard-insert-footer))
(setq dashboard-navigator-buttons
`(;; Line 1
((,(nerd-icons-mdicon "nf-md-inbox" :height 1.1 :v-adjust 0.0)
"To Inbox"
"Capture to inbox"
(lambda (&rest _) (kylekrein/org-roam-capture-inbox)))
(,(nerd-icons-mdicon "nf-md-calendar" :height 1.1 :v-adjust 0.0)
"Agenda"
"View agenda"
(lambda (&rest _) (org-agenda)))
(,(nerd-icons-mdicon "nf-md-note" :height 1.1 :v-adjust 0.0)
"Note"
"Find a note"
(lambda (&rest _) (org-roam-node-find))))
;; Line 2
((,(nerd-icons-mdicon "nf-md-sync" :height 1.1 :v-adjust 0.0)
"Sync"
"Sync org-roam and agenda"
(lambda (&rest _)
(org-roam-db-sync)
(kylekrein/org-roam-refresh-agenda-list)
(org-agenda-redo)
(message "Org-Roam and Agenda synced!")))
(,(nerd-icons-mdicon "nf-md-calendar_today" :height 1.1 :v-adjust 0.0)
"Today"
"View today's tasks"
(lambda (&rest _) (org-agenda nil "a"))))))
:custom
(dashboard-modify-heading-icons '((recents . "nf-oct-file_text")
(bookmarks . "nf-oct-book")))
:config
(dashboard-setup-startup-hook)
(let ((banner-file "~/.emacs.d/nixmacs.xpm"))
(when (file-exists-p (expand-file-name banner-file))
(setq dashboard-startup-banner ,banner-file))))
#+end_src
* Diminish * Diminish
This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add :diminish to any use-package block to hide that particular mode in the modeline. This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add :diminish to any use-package block to hide that particular mode in the modeline.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package diminish :ensure t) (use-package diminish :ensure t)
#+end_src
* DIRED (File manager)
#+begin_src emacs-lisp
(use-package dired-open
:ensure t
:config
(setq dired-open-extensions '(("gif" . "gwenview")
("jpg" . "gwenview")
("png" . "gwenview")
("mkv" . "vlc")
("mp4" . "vlc"))))
(use-package dired
:config
(setq dired-listing-switches
"--almost-all --human-readable --group-directories-first --no-group")
;; this command is useful when you want to close the window of `dirvish-side'
;; automatically when opening a file
(put 'dired-find-alternate-file 'disabled nil))
(use-package dirvish
:ensure t
:init
(dirvish-override-dired-mode)
:custom
(dirvish-quick-access-entries ; It's a custom option, `setq' won't work
'(("h" "~/" "Home")
("d" "~/Downloads/" "Downloads")))
:config
;;(dirvish-peek-mode) ; Preview files in minibuffer
(dirvish-side-follow-mode) ; similar to `treemacs-follow-mode'
(setq dirvish-mode-line-format
'(:left (sort symlink) :right (omit yank index)))
(setq dirvish-attributes ; The order *MATTERS* for some attributes
'(vc-state subtree-state nerd-icons collapse git-msg file-time file-size)
dirvish-side-attributes
'(vc-state nerd-icons collapse file-size))
;; open large directory (over 20000 files) asynchronously with `fd' command
(setq dirvish-large-directory-threshold 20000)
(setq dirvish-use-mode-line nil)
(setq dirvish-default-layout '(0 0.4 0.6))
:bind ; Bind `dirvish-fd|dirvish-side|dirvish-dwim' as you see fit
(("C-c f" . dirvish-dwim)
("C-c o f" . dirvish-side)
:map dirvish-mode-map ; Dirvish inherits `dired-mode-map'
(";" . dired-up-directory) ; So you can adjust `dired' bindings here
("?" . dirvish-dispatch) ; [?] a helpful cheatsheet
("a" . dirvish-setup-menu) ; [a]ttributes settings:`t' toggles mtime, `f' toggles fullframe, etc.
("f" . dirvish-file-info-menu) ; [f]ile info
("o" . dirvish-quick-access) ; [o]pen `dirvish-quick-access-entries'
("s" . dirvish-quicksort) ; [s]ort flie list
("r" . dirvish-history-jump) ; [r]ecent visited
("l" . dirvish-ls-switches-menu) ; [l]s command flags
("v" . dirvish-vc-menu) ; [v]ersion control commands
("*" . dirvish-mark-menu)
("y" . dirvish-yank-menu)
("N" . dirvish-narrow)
("^" . dirvish-history-last)
("TAB" . dirvish-subtree-toggle)
("M-f" . dirvish-history-go-forward)
("M-b" . dirvish-history-go-backward)
("M-e" . dirvish-emerge-menu)))
#+end_src #+end_src
* Emoji * Emoji
** Copy to clipboard ** Copy to clipboard
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package emojify :ensure t)
(defun kylekrein/copy-emoji-to-clipboard() (defun kylekrein/copy-emoji-to-clipboard()
(interactive) (interactive)
(require 'emojify) (let ((emoji (emoji--read-emoji)))
;;(let ((emoji (emoji--read-emoji))) ;;works without external package, but not so pretty
(let ((emoji (emojify-completing-read "Copy Emoji: ")))
(when emoji (when emoji
(kylekrein/copy-to-clipboard emoji) (kylekrein/copy-to-clipboard emoji)
(message "Copied: %s" (current-kill 0 t))))) (message "Copied: %s" (current-kill 0 t)))))
#+end_src #+end_src
** Standalone emoji picker
To use it, create a global keyboard shortcut with the following code
~emacsclient -cF "((visibility . nil))" -e "(emacs-run-emoji-picker)"~
#+begin_src emacs-lisp
(defun emacs-run-emoji-picker ()
"Create and select a frame called emacs-run-launcher which consists only of a minibuffer and has specific dimensions. Runs func on that frame, which is an emacs command that prompts you to select something and open it dmenu like behaviour. Delete the frame after some time after that command has exited in order to keep copied text in system clipboard"
(interactive)
(let ((launcher-frame (create-launcher-frame)))
(with-selected-frame launcher-frame
(kylekrein/copy-emoji-to-clipboard)
(make-frame-invisible launcher-frame)
(run-at-time "60 sec" nil (lambda (frame) (delete-frame frame)) launcher-frame))))
#+end_src
* EDIFF * EDIFF
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq ediff-split-window-function 'split-window-horizontally) (setq ediff-split-window-function 'split-window-horizontally)
;;(setq ediff-window-setup-function 'ediff-setup-windows-plain) ;;(setq ediff-window-setup-function 'ediff-setup-windows-plain)
#+end_src #+end_src
* Emacs Everywhere
Doesn't work on Hyprland (22.05.2025)
#+begin_src emacs-lispp
(use-package emacs-everywhere :ensure t)
#+end_src
* Fonts * Fonts
Defining the various fonts that Emacs will use. Defining the various fonts that Emacs will use.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -591,21 +285,6 @@ The modeline is the bottom status bar that appears in Emacs windows. While you
doom-modeline-time t ;; shows time doom-modeline-time t ;; shows time
doom-modeline-persp-icon nil)) ;; adds folder icon next to persp name doom-modeline-persp-icon nil)) ;; adds folder icon next to persp name
#+end_src #+end_src
* Drawing tools
[[https://github.com/misohena/el-easydraw][el-easydraw]]
#+begin_src emacs-lisp
;;(use-package el-easydraw :ensure t :demand nil)
(with-eval-after-load 'org
(require 'edraw-org)
(edraw-org-setup-default))
;; When using the org-export-in-background option (when using the
;; asynchronous export function), the following settings are
;; required. This is because Emacs started in a separate process does
;; not load org.el but only ox.el.
(with-eval-after-load "ox"
(require 'edraw-org)
(edraw-org-setup-exporter))
#+end_src
* RAINBOW DELIMITERS * RAINBOW DELIMITERS
Adding rainbow coloring to parentheses. Adding rainbow coloring to parentheses.
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -639,14 +318,11 @@ Adding rainbow coloring to parentheses.
* Org Babel * Org Babel
[[https://orgmode.org/worg//org-contrib/babel/languages/ob-doc-C.html][How to use C++ code blocks (tables included)]] [[https://orgmode.org/worg//org-contrib/babel/languages/ob-doc-C.html][How to use C++ code blocks (tables included)]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
(git-package "https://github.com/ljos/ob-prolog")
(use-package ob-prolog)
(org-babel-do-load-languages (org-babel-do-load-languages
'org-babel-load-languages 'org-babel-load-languages
'((shell . t) '((shell . t)
(C . t) (C . t)
(python . t) (python . t)))
(prolog . t)))
#+end_src #+end_src
* ORG MODE * ORG MODE
** Org Copy Link ** Org Copy Link
@ -659,15 +335,6 @@ Adding rainbow coloring to parentheses.
:follow (lambda (link) (kill-new link)) :follow (lambda (link) (kill-new link))
:export (lambda (_ desc &rest _) desc))) :export (lambda (_ desc &rest _) desc)))
#+end_src #+end_src
** Enabling Table of Contents
#+begin_src emacs-lisp
(setq org-directory "~/Documents/org")
(use-package toc-org
:ensure t
:commands toc-org-enable
:init (add-hook 'org-mode-hook 'toc-org-enable))
#+end_src
** Modern Org Mode ** Modern Org Mode
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -706,17 +373,6 @@ Org-tempo is not a separate package but a module within org that can be enabled.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(require 'org-tempo) (require 'org-tempo)
#+end_src #+end_src
** Insert pictures
[[https://github.com/abo-abo/org-download][Org-download]]
#+begin_src emacs-lisp
(use-package org-download :ensure t)
(require 'org-download)
;; Drag-and-drop to `dired`
(add-hook 'dired-mode-hook 'org-download-enable)
(setq org-download-method 'attach) ;;attach or directory
;; (setq-default org-download-image-dir "~/Pictures/foo") ;;for directory
#+end_src
** Update org tables ** Update org tables
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun org-update-table-by-name (name) (defun org-update-table-by-name (name)
@ -792,12 +448,6 @@ Org-tempo is not a separate package but a module within org that can be enabled.
(consult-ripgrep org-roam-directory))) (consult-ripgrep org-roam-directory)))
(global-set-key (kbd "C-c n r") #'kylekrein/org-roam-ripgrep) (global-set-key (kbd "C-c n r") #'kylekrein/org-roam-ripgrep)
#+end_src #+end_src
** Org Roam UI
#+begin_src emacs-lisp
(use-package org-roam-ui
:ensure t
:after org-roam)
#+end_src
** Inbox ** Inbox
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun kylekrein/org-roam-capture-inbox () (defun kylekrein/org-roam-capture-inbox ()
@ -862,33 +512,6 @@ Collect and show todos only defined in files with tag ~Project~
;; Prefer rescheduling to future dates and times ;; Prefer rescheduling to future dates and times
(setq org-read-date-prefer-future 'time) (setq org-read-date-prefer-future 'time)
#+end_src #+end_src
** Todos in Today
Automatically copies all *DONE* TODOs to Today's daily
#+begin_src emacs-lisp
(defun kylekrein/org-roam-copy-todo-to-today ()
(interactive)
(let ((org-refile-keep t) ;; Set this to nil to delete the original!
(org-roam-dailies-capture-templates
'(("t" "tasks" entry "%?"
:if-new (file+head+olp "%<%Y-%m-%d>.org" "#+title: %<%Y-%m-%d>\n#+filetags: Daily\n" ("Completed Tasks:")))))
(org-after-refile-insert-hook #'save-buffer)
today-file
pos)
(save-window-excursion
(org-roam-dailies--capture (current-time) t)
(setq today-file (buffer-file-name))
(setq pos (point)))
;; Only refile if the target file is different than the current file
(unless (equal (file-truename today-file)
(file-truename (buffer-file-name)))
(org-refile nil nil (list "Tasks" today-file nil pos)))))
(add-to-list 'org-after-todo-state-change-hook
(lambda ()
(when (equal org-state "DONE")
(kylekrein/org-roam-copy-todo-to-today))))
#+end_src
** Notifications ** Notifications
*** Appt *** Appt
Internal emacs tool and [[https://github.com/jwiegley/alert][alert]]. Settings for alert are at the beginning of this file. Internal emacs tool and [[https://github.com/jwiegley/alert][alert]]. Settings for alert are at the beginning of this file.
@ -1046,47 +669,6 @@ Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets t
(reusable-frames . visible) (reusable-frames . visible)
(window-height . 0.3))))) (window-height . 0.3)))))
#+end_src #+end_src
* SUDO EDIT
[[https://github.com/nflath/sudo-edit][sudo-edit]] gives us the ability to open files with sudo privileges or switch over to editing with sudo privileges if we initially opened the file without such privileges.
#+begin_src emacs-lisp
(use-package sudo-edit
:ensure t)
#+end_src
* Password store
[[https://github.com/NicolasPetton/pass][Pass]] is a package that interacts with [[https://www.passwordstore.org/][Standard UNIX password manager]]
#+begin_src emacs-lisp
(use-package pass
:ensure t)
(setq epg-pinentry-mode 'loopback)
#+end_src
This code snippet runs allows to get field for a password entry without emacs frame
To use it, create a global keyboard shortcut with the following code
~emacsclient -cF "((visibility . nil))" -e "(emacs-run-password-copy-field)"~
#+begin_src emacs-lisp
(defun emacs--run-password-copy-field ()
(interactive)
(let* ((entry (password-store--completing-read))
(field (password-store-read-field entry))
(value (if (string= field "secret")
(password-store-get entry)
(password-store-get-field entry field))))
(password-store--save-field-in-kill-ring entry value field)
(alert (format "%s:%s\nClipboard will be cleared in 45 seconds" entry field)
:title "Copied"
:severity 'trivial
:category 'pass
:id 'pass)))
(defun emacs-run-password-copy-field()
(let ((launcher-frame (create-launcher-frame)))
(with-selected-frame launcher-frame
(emacs--run-password-copy-field)
(make-frame-invisible launcher-frame)
(run-at-time "60 sec" nil (lambda (frame) (delete-frame frame)) launcher-frame))))
#+end_src
* CMake Projects * CMake Projects
#+begin_src emacs-lisp #+begin_src emacs-lisp
(git-package "https://github.com/darcamo/cmake-integration.git") (git-package "https://github.com/darcamo/cmake-integration.git")
@ -1216,43 +798,11 @@ Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM,
lsp-nix-nixd-nixos-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options" lsp-nix-nixd-nixos-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options"
lsp-nix-nixd-home-manager-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options.home-manager.users.type.getSubOptions []")) lsp-nix-nixd-home-manager-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options.home-manager.users.type.getSubOptions []"))
#+end_src #+end_src
[[https://github.com/emacs-twist/nix3.el][nix3.el]]
#+begin_src emacs-lisp
(use-package promise :ensure t) ;; nix3 dependency
(git-package "https://github.com/emacs-twist/nix3.el")
(use-package nix3
:init
(let* ((mainpkg-dir (file-name-directory (locate-library "nix3")))
(subpkg-dir (expand-file-name "extra" mainpkg-dir)))
(add-to-list 'load-path subpkg-dir)))
(use-package magit-nix3
:after magit-status
:config
(magit-nix3-flake-mode t))
#+end_src
** GLSL ** GLSL
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package glsl-mode (use-package glsl-mode
:ensure t) :ensure t)
#+end_src #+end_src
** QML
#+begin_src emacs-lisp
(git-package "https://github.com/xhcoding/qml-ts-mode")
(use-package qml-ts-mode
:after lsp-mode
:config
(add-to-list 'lsp-language-id-configuration '(qml-ts-mode . "qml-ts"))
(add-to-list 'auto-mode-alist '("\\.qml\\'" . qml-ts-mode))
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("qmlls"))
:activation-fn (lsp-activate-on "qml-ts")
:server-id 'qmlls))
(add-hook 'qml-ts-mode-hook (lambda ()
(setq-local electric-indent-chars '(?\n ?\( ?\) ?{ ?} ?\[ ?\] ?\; ?,))
(lsp-deferred))))
#+end_src
** RmlUi ** RmlUi
#+begin_src emacs-lisp #+begin_src emacs-lisp
(add-to-list 'auto-mode-alist '("\\.rml\\'" . html-ts-mode)) (add-to-list 'auto-mode-alist '("\\.rml\\'" . html-ts-mode))
@ -1331,46 +881,6 @@ Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM,
. ("ty"))) . ("ty")))
(add-hook 'python-ts-mode-hook #'eglot-ensure)) (add-hook 'python-ts-mode-hook #'eglot-ensure))
#+end_src #+end_src
*** Lobster
Made from [[https://github.com/lite-xl/lite-xl-plugins/blob/master/plugins/language_lobster.lua]]
#+begin_src emacs-lisp
(require 'font-lock)
(defgroup lobster-mode nil
"Major mode for editing Lobster language code."
:group 'languages)
(defvar lobster-keywords
'("import" "from" "def" "fn" "return" "program" "private" "resource"
"if" "guard" "for" "while" "else" "enum" "enum_flags"
"int" "float" "string" "any" "void" "is" "typeof" "var" "let"
"pakfile" "switch" "case" "default" "namespace" "constructor"
"operator" "super" "abstract" "attribute" "member" "member_frame"
"static" "static_frame" "not" "and" "or" "struct" "class")
"Lobster keywords.")
(defvar lobster-keywords-regexp (regexp-opt lobster-keywords 'words))
(defvar lobster-font-lock-keywords
`((,"//.*$" . font-lock-comment-face) ;; Single-line comments
(,"/\*\(.\|
\)*?\*/" . font-lock-comment-face) ;; Multi-line comments
(,"\<\(0x[0-9A-Fa-f]+\|[0-9]+\(\.[0-9]*\)?\([eE][-+]?[0-9]+\)?f?\)\>" . font-lock-constant-face) ;; Numbers
(,"\"\(\\.\|[^\"]\)*\"" . font-lock-string-face) ;; Strings
(,"'\\?.'" . font-lock-string-face) ;; Character literals
(,lobster-keywords-regexp . font-lock-keyword-face) ;; Keywords
("[a-zA-Z_][a-zA-Z0-9_]*\s-*\(?:(\)" . (1 font-lock-function-name-face))) ;; Functions
"Syntax highlighting for Lobster.")
(define-derived-mode lobster-mode prog-mode "Lobster"
"Major mode for editing Lobster language."
(setq font-lock-defaults '((lobster-font-lock-keywords))))
;;;###autoload
(add-to-list 'auto-mode-alist '("\\.lobster\\'" . lobster-mode))
(provide 'lobster-mode)
#+end_src
* Nerd Icons * Nerd Icons
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package nerd-icons (use-package nerd-icons