aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/elisp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-31 16:02:21 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-31 16:02:21 +0100
commit17348abe78e05702acaff25d6abefa96ff87b43d (patch)
tree041a980f534cbe7a10e352612f3e540417cc4280 /Emacs/.config/emacs/elisp
parent046e0b9f0123a3c4bd8aa32431b72de486c60671 (diff)
parentfdef946d6555b01b33fe496cdcd6fb293ae11eab (diff)
downloaddotfiles-17348abe78e05702acaff25d6abefa96ff87b43d.tar.gz
dotfiles-17348abe78e05702acaff25d6abefa96ff87b43d.tar.bz2
dotfiles-17348abe78e05702acaff25d6abefa96ff87b43d.zip
Merge remote-tracking branch 'origin/master'
For desktop
Diffstat (limited to 'Emacs/.config/emacs/elisp')
-rw-r--r--Emacs/.config/emacs/elisp/ada-mode.el7
-rw-r--r--Emacs/.config/emacs/elisp/haskell-multiedit.el16
-rw-r--r--Emacs/.config/emacs/elisp/hide-mode-line.el15
-rw-r--r--Emacs/.config/emacs/elisp/license.el35
-rw-r--r--Emacs/.config/emacs/elisp/literate.el161
-rw-r--r--Emacs/.config/emacs/elisp/move.el80
-rw-r--r--Emacs/.config/emacs/elisp/org-bookmark.el77
-rw-r--r--Emacs/.config/emacs/elisp/personal-light-theme.el54
-rw-r--r--Emacs/.config/emacs/elisp/personal-primary-theme.el98
-rw-r--r--Emacs/.config/emacs/elisp/search.el67
10 files changed, 456 insertions, 154 deletions
diff --git a/Emacs/.config/emacs/elisp/ada-mode.el b/Emacs/.config/emacs/elisp/ada-mode.el
index a789fc2..1d83da9 100644
--- a/Emacs/.config/emacs/elisp/ada-mode.el
+++ b/Emacs/.config/emacs/elisp/ada-mode.el
@@ -5,10 +5,9 @@
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; Keywords: faces, languages
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License Version
+;; 2 as published by the Free Software Foundation.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
diff --git a/Emacs/.config/emacs/elisp/haskell-multiedit.el b/Emacs/.config/emacs/elisp/haskell-multiedit.el
index 1dc857f..81a5338 100644
--- a/Emacs/.config/emacs/elisp/haskell-multiedit.el
+++ b/Emacs/.config/emacs/elisp/haskell-multiedit.el
@@ -1,14 +1,15 @@
-;;; haskell-multiedit.el --- Minor mode to edit and evaluate multi-line scripts of Haskell without making a file -*- lexical-binding: t; -*-
+;;; haskell-multiedit.el --- Minor mode to edit and evaluate
+;;; multi-line scripts of Haskell without making a file
+;;; -*- lexical-binding: t; -*-
;; Copyright (C) 2021 Aryadev Chavali
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; Keywords:
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License version
+;; 2 as published by the Free Software Foundation.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -35,9 +36,8 @@
"Minor mode for haskell buffers generated by haskell-interactive-mode.
Provides bindings to retrieve content back into the REPL with
full multi-edit commands"
- nil
- ""
- haskell-multiedit-mode-map)
+ :lighter nil
+ :keymap haskell-multiedit-mode-map)
(with-eval-after-load "haskell"
(defun haskell-multiedit ()
diff --git a/Emacs/.config/emacs/elisp/hide-mode-line.el b/Emacs/.config/emacs/elisp/hide-mode-line.el
index a16667d..488bf3f 100644
--- a/Emacs/.config/emacs/elisp/hide-mode-line.el
+++ b/Emacs/.config/emacs/elisp/hide-mode-line.el
@@ -5,10 +5,9 @@
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; Keywords:
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License version
+;; 2 as published by the Free Software Foundation.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -31,11 +30,9 @@
"Hides the mode line."
:lighter nil
(if mode-line-format
- (progn
- (setq-local hide-mode-line--prev-mode-line mode-line-format)
- (setq-local mode-line-format nil))
- (setq-local mode-line-format hide-mode-line--prev-mode-line)))
-
+ (setq-local hide-mode-line--prev-mode-line mode-line-format
+ mode-line-format nil)
+ (setq-local mode-line-format hide-mode-line--prev-mode-line)))
(provide 'hide-mode-line)
;;; hide-mode-line.el ends here
diff --git a/Emacs/.config/emacs/elisp/license.el b/Emacs/.config/emacs/elisp/license.el
index 8ea64fd..a4922ab 100644
--- a/Emacs/.config/emacs/elisp/license.el
+++ b/Emacs/.config/emacs/elisp/license.el
@@ -5,10 +5,9 @@
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; Keywords:
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License version
+;; 2 as published by the Free Software Foundation.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +18,7 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
-
;;
-
;;; Code:
(defvar +license/license-choice nil)
@@ -419,20 +416,22 @@ For more information, please refer to <https://unlicense.org>")))
(car (alist-get choice +license/licenses-alist "" nil #'string=))))
(defun +license/copyright-notice ()
- (let ((license-name (or (if (listp +license/license-choice)
- (car +license/license-choice)
- +license/license-choice)
- "Unlicense")))
- (format "Copyright (C) %s %s
-
-You may distribute and modify this code under the terms of the %s
+ (let ((license-name (if (listp +license/license-choice)
+ (car +license/license-choice)
+ +license/license-choice)))
+ (concat
+ (format "Copyright (C) %s %s\n\n" (format-time-string "%Y") user-full-name)
+ (if license-name
+ (format "You may distribute and modify this code under the terms of the %s
license. You should have received a copy of the %s license with
this file. If not, please write to: %s."
- (format-time-string "%Y")
- user-full-name
- license-name
- license-name
- user-mail-address)))
+ license-name
+ license-name
+ user-mail-address)
+ (format
+ "All rights reserved. You may not distribute or modify this code
+without explicit legal permission from the author \"%s\""
+ user-full-name)))))
(defun +license/insert-complete-license ()
(interactive)
diff --git a/Emacs/.config/emacs/elisp/literate.el b/Emacs/.config/emacs/elisp/literate.el
index 114c3bb..43c39d8 100644
--- a/Emacs/.config/emacs/elisp/literate.el
+++ b/Emacs/.config/emacs/elisp/literate.el
@@ -5,10 +5,9 @@
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
;; Keywords:
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License version
+;; 2 as published by the Free Software Foundation.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,6 +23,16 @@
;;; Code:
+;; Predicates
+(defun +literate/org-to-el (name)
+ (string-replace ".org" ".el" name))
+
+(defun +literate/org-to-elc (name)
+ (string-replace ".org" ".elc" name))
+
+(defun +literate/el-to-elc (name)
+ (string-replace ".el" ".elc" name))
+
(defun +literate/filter (predicate list)
(if (null list)
nil
@@ -39,70 +48,120 @@
(defun +literate/el-p (filename)
(string= "el" (file-name-extension filename)))
-(defconst +literate/org-files
- (+literate/filter
- #'+literate/org-p
- (mapcar #'(lambda (file) (concat user-emacs-directory file))
- (cddr (directory-files user-emacs-directory)))))
+(defun +literate/--reduce-bool (bools init)
+ (if (= (length bools) 0)
+ init
+ (+literate/--reduce-bool (cdr bools) (and (car bools) init))))
-(defconst +literate/output-files
- (mapcar #'(lambda (x) (replace-regexp-in-string ".org" ".el" x)) +literate/org-files))
+;; Files
+(defconst +literate/org-files
+ (mapcar #'(lambda (x) (expand-file-name (concat user-emacs-directory x)))
+ (list "config.org")))
-(defconst +literate/elisp-files
+(defconst +literate/el-init-files
`(,(concat user-emacs-directory "early-init.el")
- ,(concat user-emacs-directory "init.el")
- ,@+literate/output-files
- ,@(mapcar
- #'(lambda (name) (concat user-emacs-directory "elisp/" name))
- ;; Only take .el files
- (+literate/filter
- #'+literate/el-p
- (cddr (directory-files (concat user-emacs-directory "elisp/")))))))
+ ,(concat user-emacs-directory "init.el")))
-;; Setup predicates and loading
+(defconst +literate/el-lib-files
+ (mapcar
+ #'(lambda (name) (concat user-emacs-directory "elisp/" name))
+ ;; Only take .el files
+ (+literate/filter
+ #'+literate/el-p
+ (cddr (directory-files (concat user-emacs-directory "elisp/"))))))
-(defun +literate/--reduce-bool (bools init)
- (if (= (length bools) 0)
- init
- (+literate/--reduce-bool (cdr bools) (and (car bools) init))))
+(defconst +literate/el-org-files
+ (mapcar #'+literate/org-to-el +literate/org-files))
-(defun +literate/output-files-exist ()
- "Checks if output files exist, for compilation purposes."
- (if (< 1 (length +literate/output-files))
- (+literate/--reduce-bool (mapcar #'file-exists-p +literate/output-files) t)
- (file-exists-p (car +literate/output-files))))
+(defconst +literate/el-files
+ (cl-concatenate
+ 'list
+ +literate/el-init-files
+ +literate/el-lib-files
+ +literate/el-org-files))
-(defun +literate/load-config ()
- "Load the first file in +literate/output-files."
- (interactive)
- (load-file (concat user-emacs-directory "config.el")))
+(defconst +literate/elc-init-files
+ (mapcar #'+literate/el-to-elc +literate/el-init-files))
+
+(defconst +literate/elc-lib-files
+ (mapcar #'+literate/el-to-elc +literate/el-lib-files))
+
+(defconst +literate/elc-org-files
+ (mapcar #'+literate/org-to-elc +literate/org-files))
+(defvar +literate/bytecompile? t
+ "Bytecompile all files?")
+
+;; Basic compilation and loading files
(autoload #'org-babel-tangle-file "ob-tangle")
(defun +literate/tangle-if-old (org-file)
- (let ((output-file (replace-regexp-in-string ".org" ".el" org-file)))
- (message "Tangle(%s)->%s" org-file output-file)
- (if (or (not (file-exists-p output-file)) (file-newer-than-file-p org-file output-file))
- (org-babel-tangle-file org-file))))
+ (let ((output-file (+literate/org-to-el org-file)))
+ (when (file-newer-than-file-p org-file output-file)
+ (message "[Literate]:\tTangle(%s)->%s" org-file output-file)
+ (org-babel-tangle-file org-file))))
(defun +literate/byte-compile-if-old (el-file)
- (let ((output-file (replace-regexp-in-string ".el" ".elc" el-file)))
- (if (file-newer-than-file-p el-file output-file)
- (byte-compile-file el-file))))
+ (let ((output-file (+literate/el-to-elc el-file)))
+ (when (file-newer-than-file-p el-file output-file)
+ (message "[Literate]:\tByteCompile(%s)->%s" el-file output-file)
+ (byte-compile-file el-file))))
+
+(defun +literate/load-org-file (org-file)
+ (+literate/tangle-if-old org-file)
+ (load-file (+literate/org-to-el org-file)))
+
+(defun +literate/load-config ()
+ "Load the config.el."
+ (interactive)
+ (mapcar #'+literate/tangle-if-old +literate/org-files)
+ (load-file (concat user-emacs-directory "config.el")))
+
+;; Compiling all files
+(defun +literate/compile-init-files ()
+ (when +literate/bytecompile?
+ (message "[Literate/init]: Byte compiling init files...")
+ (mapc #'+literate/byte-compile-if-old +literate/el-init-files))
+ (message "[Literate/init]: Init files compiled!"))
+
+(defun +literate/compile-lib-files ()
+ (when +literate/bytecompile?
+ (message "[Literate/lib]: Byte compiling lib files...")
+ (mapc #'+literate/byte-compile-if-old +literate/el-lib-files))
+ (message "[Literate/lib]: Lib files compiled!"))
+
+(defun +literate/compile-org-files ()
+ (message "[Literate/org]: Tangling org files...")
+ (mapc #'+literate/tangle-if-old +literate/org-files)
+ (message "[Literate/org]: Tangled org files!")
+ (when +literate/bytecompile?
+ (message "[Literate/org]: Byte compiling org files...")
+ (mapc #'+literate/byte-compile-if-old +literate/el-org-files)
+ (message "[Literate/org]: Byte compiled org files!")))
(defun +literate/compile-config ()
"Compile all files in +literate/org-files via org-babel-tangle."
(interactive)
- (message "Compiling files...")
- (mapc #'+literate/tangle-if-old +literate/org-files)
- (message "Files compiled")
-
- (message "Byte-compiling literate files...")
- (mapc #'+literate/byte-compile-if-old +literate/output-files)
- (message "Literate files byte-compiled")
- (message "Byte compiling init.el, early-init.el, *.org~>*.el elisp/*")
- (mapc #'+literate/byte-compile-if-old +literate/elisp-files)
- (message "Finished byte-compiling"))
+ (message "[Literate]: Starting compilation...")
+ (+literate/compile-init-files)
+ (+literate/compile-lib-files)
+ (+literate/compile-org-files)
+ (message "[Literate]: Finished compilation!"))
+
+;; Cleaning config
+(defun +literate/clean-config ()
+ "Removes all .el files generated by literate org files and .elc
+files by byte compilation"
+ (interactive)
+ (message "[Literate]: Cleaning configuration...")
+ (mapcar #'delete-file
+ (cl-concatenate
+ 'list
+ +literate/el-org-files
+ +literate/elc-init-files
+ +literate/elc-lib-files
+ +literate/elc-org-files))
+ (message "[Literate]: Cleaned configuration!"))
(provide 'literate)
;;; literate.el ends here
diff --git a/Emacs/.config/emacs/elisp/move.el b/Emacs/.config/emacs/elisp/move.el
new file mode 100644
index 0000000..ed154fb
--- /dev/null
+++ b/Emacs/.config/emacs/elisp/move.el
@@ -0,0 +1,80 @@
+;;; move-line.el --- Move current line up or down -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Aryadev Chavali
+
+;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
+;; Keywords:
+
+;; This is free and unencumbered software released into the public domain.
+
+;; Anyone is free to copy, modify, publish, use, compile, sell, or
+;; distribute this software, either in source code form or as a compiled
+;; binary, for any purpose, commercial or non-commercial, and by any
+;; means.
+
+;; In jurisdictions that recognize copyright laws, the author or authors
+;; of this software dedicate any and all copyright interest in the
+;; software to the public domain. We make this dedication for the benefit
+;; of the public at large and to the detriment of our heirs and
+;; successors. We intend this dedication to be an overt act of
+;; relinquishment in perpetuity of all present and future rights to this
+;; software under copyright law.
+
+;; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+;; EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+;; MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+;; IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+;; OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+;; ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+;; OTHER DEALINGS IN THE SOFTWARE.
+
+;; For more information, please refer to <https://unlicense.org>
+
+;;; Commentary:
+
+;; Move the current line up or down. Shamelessly copied from
+;; https://emacsredux.com/blog/2013/04/02/move-current-line-up-or-down/ so
+
+;;; Code:
+
+(defmacro +move/create-move (name description &rest body)
+ `(defun ,name (&optional arg)
+ ,description
+ (interactive "P")
+ (let ((arg (if (or (null arg) (< arg 1)) 1 arg)))
+ (while (not (= arg 0))
+ ,@body
+ (setq arg (- arg 1))))))
+
+(+move/create-move
+ +move/line-up
+ "Move the current line up"
+ (transpose-lines 1)
+ (forward-line -2)
+ (indent-according-to-mode))
+
+(+move/create-move
+ +move/line-down
+ "Move the current line down"
+ (forward-line 1)
+ (transpose-lines 1)
+ (forward-line -1)
+ (indent-according-to-mode))
+
+(+move/create-move
+ +move/word-forward
+ "Move the current word forward"
+ (forward-word 1)
+ (transpose-words 1)
+ (forward-word -1)
+ (indent-according-to-mode))
+
+(+move/create-move
+ +move/word-backward
+ "Move the current word backward"
+ (transpose-words 1)
+ (forward-word -2)
+ (indent-according-to-mode))
+
+(provide 'move)
+;;; move.el ends here
diff --git a/Emacs/.config/emacs/elisp/org-bookmark.el b/Emacs/.config/emacs/elisp/org-bookmark.el
new file mode 100644
index 0000000..6bbad5d
--- /dev/null
+++ b/Emacs/.config/emacs/elisp/org-bookmark.el
@@ -0,0 +1,77 @@
+;;; org-bookmark.el --- Bookmark manager using org-mode -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Aryadev Chavali
+
+;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License Version
+;; 2 as published by the Free Software Foundation.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;
+
+;;; Code:
+
+(require 'org)
+
+(defvar +bookmark/file (expand-file-name "~/Text/bookmarks.org"))
+(defvar +bookmark/mpv-args "--ytdl-raw-options=force-ipv4= --ytdl-format=22")
+
+(defun +bookmark/bookmarks ()
+ (with-current-buffer (find-file-noselect +bookmark/file)
+ (org-scan-tags
+ #'(lambda nil
+ (let ((heading-components (org-heading-components)))
+ (cons
+ (concat (nth 4 heading-components) (nth 5 heading-components))
+ (substring-no-properties (org-agenda-get-some-entry-text
+ (point-marker)
+ most-positive-fixnum)))))
+ (cdr (org-make-tags-matcher ":bookmark:"))
+ nil)))
+
+(defun +bookmark/open-bookmark ()
+ (interactive)
+ (let* ((bookmarks (+bookmark/bookmarks))
+ (choice (completing-read "Choose bookmark: "
+ (mapcar #'car bookmarks)
+ nil t))
+ (pair (assoc choice bookmarks #'string=)))
+ (if (null pair)
+ (error (format "`%s' is not a valid bookmark" choice))
+ (message "[bookmark]: Opening `%s`" (car pair))
+ (cond
+ ((or
+ (string-match-p "^https://\\(www.\\)?youtu\\(.\\)?be" (cdr pair))
+ (string-match-p "\\.mp4$" (cdr pair)))
+ ;; Open MPV
+ (message "[bookmark]: Starting MPV process")
+ (with-current-buffer (get-buffer-create "*mpv*")
+ (ansi-color-for-comint-mode-on)
+ (comint-mode))
+ (set-process-filter (start-process-shell-command
+ "bookmark-mpv" "*mpv*"
+ (concat
+ "mpv "
+ +bookmark/mpv-args
+ " \""
+ (cdr pair)
+ "\""))
+ #'comint-output-filter))
+ (t
+ (message "[bookmark]: Starting eww")
+ (eww (cdr pair)))))))
+
+(provide 'org-bookmark)
+;;; bookmark.el ends here
diff --git a/Emacs/.config/emacs/elisp/personal-light-theme.el b/Emacs/.config/emacs/elisp/personal-light-theme.el
index 5486b5c..3747f05 100644
--- a/Emacs/.config/emacs/elisp/personal-light-theme.el
+++ b/Emacs/.config/emacs/elisp/personal-light-theme.el
@@ -3,18 +3,17 @@
(custom-theme-set-faces
'personal-light
- '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 143 :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "black" :background "white" :stipple nil :inherit nil))))
- '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white"))))
- '(fixed-pitch ((t (:family "Monospace"))))
- '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
+ '(button ((t (:inherit (link)))))
+ '(company-preview
+ ((t (:foreground "black" :background "deepskyblue"))))
+ '(company-preview-common ((t (:inherit company-preview))))
+ '(company-tooltip ((t (:background "white" :foreground "black"))))
+ '(company-tooltip-annotation ((t (:foreground "grey70" :slant italic))))
+ '(company-tooltip-selection ((t (:background "grey80" :slant italic))))
+ '(cursor ((t (:background "grey50"))))
+ '(dired-ignored ((t (:background "grey80" :slant italic :underline t))))
'(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue"))))
- '(highlight ((((class color) (min-colors 88) (background light)) (:background "darkseagreen2")) (((class color) (min-colors 88) (background dark)) (:background "darkolivegreen")) (((class color) (min-colors 16) (background light)) (:background "darkseagreen2")) (((class color) (min-colors 16) (background dark)) (:background "darkolivegreen")) (((class color) (min-colors 8)) (:foreground "black" :background "green")) (t (:inverse-video t))))
- '(region ((t (:extend t :background "green yellow" :distant-foreground "gtk_selection_fg_color"))))
- '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
- '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t))))
- '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t))))
+ '(fixed-pitch ((t (:family "Monospace"))))
'(font-lock-builtin-face ((((class grayscale) (background light)) (:weight bold :foreground "LightGray")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "dark slate blue")) (((class color) (min-colors 88) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 16) (background light)) (:foreground "Orchid")) (((class color) (min-colors 16) (background dark)) (:foreground "LightSteelBlue")) (((class color) (min-colors 8)) (:weight bold :foreground "blue")) (t (:weight bold))))
'(font-lock-comment-delimiter-face ((t (:inherit (font-lock-comment-face)))))
'(font-lock-comment-face ((t (:foreground "dim gray"))))
@@ -31,26 +30,37 @@
'(font-lock-type-face ((((class grayscale) (background light)) (:weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 88) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 16) (background light)) (:foreground "ForestGreen")) (((class color) (min-colors 16) (background dark)) (:foreground "PaleGreen")) (((class color) (min-colors 8)) (:foreground "green")) (t (:underline (:color foreground-color :style line) :weight bold))))
'(font-lock-variable-name-face ((((class grayscale) (background light)) (:slant italic :weight bold :foreground "Gray90")) (((class grayscale) (background dark)) (:slant italic :weight bold :foreground "DimGray")) (((class color) (min-colors 88) (background light)) (:foreground "sienna")) (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod")) (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod")) (((class color) (min-colors 8)) (:weight light :foreground "yellow")) (t (:slant italic :weight bold))))
'(font-lock-warning-face ((t (:inherit (error)))))
- '(button ((t (:inherit (link)))))
- '(link ((t (:underline (:color foreground-color :style line) :foreground "RoyalBlue3"))))
- '(link-visited ((t (:foreground "magenta4" :inherit (link)))))
'(fringe ((((class color) (background light)) (:background "grey95")) (((class color) (background dark)) (:background "grey10")) (t (:background "gray"))))
'(header-line ((t (:box nil :foreground "grey20" :background "grey90" :inherit (mode-line)))))
- '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
- '(mode-line ((t (:box (:line-width (1 . -1) :color nil :style released-button) :foreground "black" :background "grey75"))))
- '(mode-line-buffer-id ((t (:weight bold))))
- '(mode-line-emphasis ((t (:weight bold))))
- '(mode-line-highlight ((t (:box (:line-width (2 . 2) :color "grey40" :style released-button)))))
- '(mode-line-inactive ((t (:weight light :box (:line-width (1 . -1) :color "grey75" :style nil) :foreground "grey20" :background "grey90" :inherit (mode-line)))))
+ '(highlight ((t (:background "grey90"))))
+ '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
'(isearch ((((class color) (min-colors 88) (background light)) (:foreground "lightskyblue1" :background "magenta3")) (((class color) (min-colors 88) (background dark)) (:foreground "brown4" :background "palevioletred2")) (((class color) (min-colors 16)) (:foreground "cyan1" :background "magenta4")) (((class color) (min-colors 8)) (:foreground "cyan1" :background "magenta4")) (t (:inverse-video t))))
'(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
'(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline (:color foreground-color :style line)))))
+ '(link ((t (:underline (:color foreground-color :style line) :foreground "RoyalBlue3"))))
+ '(link-visited ((t (:foreground "magenta4" :inherit (link)))))
'(match ((((class color) (min-colors 88) (background light)) (:background "khaki1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray"))))
+ '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue"))))
+ '(mode-line ((t (:box nil :background "LightSkyBlue" :foreground "black"))))
+ '(mode-line-buffer-id ((t (:weight bold))))
+ '(mode-line-emphasis ((t (:weight bold))))
+ '(mode-line-highlight ((t (:box (:line-width (2 . 2) :color "grey40" :style released-button)))))
+ '(mode-line-inactive ((t (:foreground "grey20" :background "grey90" :inherit (mode-line)))))
'(next-error ((t (:inherit (region)))))
- '(query-replace ((t (:inherit (isearch)))))
'(org-block ((t (:background "white" :inherit shadow))))
- '(whitespace-space ((t (:background "white" :foreground "lightgray"))))
+ '(query-replace ((t (:inherit (isearch)))))
+ '(region ((t (:extend t :background "green yellow" :distant-foreground "gtk_selection_fg_color"))))
+ '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t))))
+ '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
+ '(tab-bar ((t (:background "white"))))
+ '(tab-bar-tab ((t (:foreground "gray30" :background "white"))))
+ '(tab-bar-tab-inactive ((t (:foreground "gray13" :background "gray80"))))
+ '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
+ '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")) (t (:inverse-video t))))
+ '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
'(whitespace-line ((t (:background "white" :foreground "violet"))))
+ '(whitespace-space ((t (:background "white" :foreground "lightgray"))))
+ '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :height 143 :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "black" :background "white" :stipple nil :inherit nil))))
)
(provide-theme 'personal-light)
diff --git a/Emacs/.config/emacs/elisp/personal-primary-theme.el b/Emacs/.config/emacs/elisp/personal-primary-theme.el
index 747b483..07ef4fa 100644
--- a/Emacs/.config/emacs/elisp/personal-primary-theme.el
+++ b/Emacs/.config/emacs/elisp/personal-primary-theme.el
@@ -3,26 +3,30 @@
(custom-theme-set-faces
'personal-primary
- '(line-number ((t (:foreground "gray45" :background "gray1" :inherit (default)))))
- '(line-number-current-line ((t (:foreground "white" :background "gray1" :inherit (default)))))
+ '(button ((t (:inherit (link)))))
+ '(tab-bar ((t (:background "grey13"))))
+ '(tab-bar-tab ((t (:background "grey20" :foreground "white" :box (:color )))))
+ '(tab-bar-tab-inactive ((t (:background "grey13" :foreground "DimGrey"))))
'(child-frame-border ((t (:background "white"))))
- '(cursor ((((background light)) (:background "black")) (((background dark)) (:background "white"))))
+ '(company-preview
+ ((t (:foreground "wheat" :background "blue4"))))
+ '(company-preview-common ((t (:inherit company-preview :foreground "grey"))))
+ '(company-tooltip ((t (:background "black" :foreground "white"))))
+ '(company-tooltip-annotation ((t (:foreground "grey" :slant italic))))
+ '(company-tooltip-selection ((t (:background "grey31" :slant italic))))
+ '(cursor ((t (:background "white"))))
+ '(dired-ignored ((t (:background "grey10" :slant italic :underline t))))
+ '(escape-glyph ((t (:foreground "cyan"))))
+ '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold))))
+ '(eshell-prompt ((t (:foreground "turquoise3" :weight bold))))
'(fixed-pitch ((t (:family "Monospace"))))
- '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
- '(escape-glyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(homoglyph ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "brown"))))
- '(minibuffer-prompt ((((background dark)) (:foreground "cyan")) (((type pc)) (:foreground "magenta")) (t (:foreground "medium blue"))))
- '(highlight ((t (:background "gray14"))))
- '(region ((t (:extend t :background "gray25"))))
- '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50")) (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70")) (((class color) (min-colors 8) (background light)) (:foreground "green")) (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
- '(secondary-selection ((((class color) (min-colors 88) (background light)) (:extend t :background "yellow1")) (((class color) (min-colors 88) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 16) (background light)) (:extend t :background "yellow")) (((class color) (min-colors 16) (background dark)) (:extend t :background "SkyBlue4")) (((class color) (min-colors 8)) (:extend t :foreground "black" :background "cyan")) (t (:inverse-video t))))
- '(trailing-whitespace ((((class color) (background light)) (:background "red1")) (((class color) (background dark)) (:background "red1")))) ;;(t (:inverse-video t))))
'(font-lock-builtin-face ((t (:foreground "powder blue"))))
- '(font-lock-comment-delimiter-face ((t (:slant italic :foreground "gray24"))))
+ '(font-lock-comment-delimiter-face ((t (:slant italic :foreground "grey24"))))
'(font-lock-comment-face ((t (:slant italic :foreground "#868686"))))
'(font-lock-constant-face ((t (:foreground "indian red" :weight semi-bold :height 0.99 :family "Source Code Pro"))))
'(font-lock-doc-face ((t (:inherit (font-lock-string-face)))))
- '(font-lock-function-name-face ((t (:weight semi-bold))))
+ '(font-lock-function-name-face ((t (:weight semi-bold :foreground "#b6b6b6"))))
+ '(font-lock-function-call-face ((t (:weight semi-bold :foreground "#b6b6b6"))))
'(font-lock-keyword-face ((t (:foreground "spring green" :weight bold :height 0.95 :family "Fira Code"))))
'(font-lock-negation-char-face ((t nil)))
'(font-lock-preprocessor-face ((t (:family "Source Code Pro" :foreground "#868686"))))
@@ -32,44 +36,54 @@
'(font-lock-type-face ((t (:weight light :foreground "deepskyblue" :family "DejaVu Sans Mono"))))
'(font-lock-variable-name-face ((nil (:family "Source Code Pro" :foreground "white"))))
'(font-lock-warning-face ((t (:inherit (error)))))
- '(button ((t (:inherit (link)))))
- '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1"))))
- '(link-visited ((t (:foreground "violet" :inherit (link)))))
'(fringe ((t (:background "grey4"))))
+ '(haskell-interactive-face-prompt ((t (:foreground "green"))))
'(header-line ((t (:box nil :foreground "grey90" :background "grey20" :inherit (mode-line)))))
- '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
+ '(highlight ((t (:extend t :background "#222233"))))
+ '(homoglyph ((t (:foreground "cyan"))))
+ '(isearch ((t (:foreground "brown4" :background "white"))))
+ '(isearch-fail ((t (:background "red4"))))
+ '(ivy-current-match ((t (:weight bold :underline t :slant italic))))
+ '(lazy-highlight ((t (:background "paleturquoise4"))))
+ '(line-number ((t (:foreground "grey45" :background "grey1" :inherit (default)))))
+ '(line-number-current-line ((t (:foreground "white" :background "grey1" :inherit (default)))))
+ '(link ((t (:underline (:color foreground-color :style line) :foreground "cyan1"))))
+ '(link-visited ((t (:foreground "violet" :inherit (link)))))
+ '(match ((t (:background "RoyalBlue3"))))
+ '(minibuffer-prompt ((t (:foreground "cyan"))))
'(mode-line ((t (:box nil :foreground "LightSkyBlue" :background "black"))))
'(mode-line-buffer-id ((t (:weight bold))))
'(mode-line-emphasis ((t (:weight bold))))
- '(mode-line-highlight ((((class color) (min-colors 88)) (:box (:line-width 2 :color "grey40" :style released-button))) (t (:inherit (highlight)))))
- '(mode-line-inactive ((t (:weight light :foreground "CadetBlue" :background "grey7" :inherit (mode-line)))))
- '(isearch ((t (:foreground "brown4" :background "white"))))
- '(isearch-fail ((((class color) (min-colors 88) (background light)) (:background "RosyBrown1")) (((class color) (min-colors 88) (background dark)) (:background "red4")) (((class color) (min-colors 16)) (:background "red")) (((class color) (min-colors 8)) (:background "red")) (((class color grayscale)) (:foreground "grey")) (t (:inverse-video t))))
- '(lazy-highlight ((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) (((class color) (min-colors 16)) (:background "turquoise3")) (((class color) (min-colors 8)) (:background "turquoise3")) (t (:underline (:color foreground-color :style line)))))
- '(match ((((class color) (min-colors 88) (background light)) (:background "yellow1")) (((class color) (min-colors 88) (background dark)) (:background "RoyalBlue3")) (((class color) (min-colors 8) (background light)) (:foreground "black" :background "yellow")) (((class color) (min-colors 8) (background dark)) (:foreground "white" :background "blue")) (((type tty) (class mono)) (:inverse-video t)) (t (:background "gray"))))
+ '(mode-line-inactive ((t (:weight light :foreground "CadetBlue" :background "grey7"
+ :inherit (mode-line)))))
'(next-error ((t (:inherit (region)))))
- '(query-replace ((t (:inherit (isearch)))))
- '(company-tooltip ((t (:background "black" :foreground "white"))))
- '(company-tooltip-selection ((t (:background "gray31" :slant italic))))
- '(company-tooltip-annotation ((t (:foreground "grey" :slant italic))))
- '(company-preview ((((background light)) (:inherit (company-tooltip-selection company-tooltip))) (((background dark)) (:foreground "wheat" :background "blue4"))))
- '(company-preview-common ((t (:inherit company-preview :foreground "grey"))))
- '(org-block ((t (:background "gray3" :inherit shadow))))
- '(org-quote ((t (:slant italic))))
- '(eshell-prompt ((t (:foreground "turquoise3" :weight bold))))
- '(eshell-ls-directory ((t (:foreground "DeepSkyBlue3" :weight bold))))
- '(whitespace-tab ((t (:background "gray5" :foreground "gray20"))))
- '(whitespace-space ((t (:background "gray2" :foreground "darkgray"))))
- '(whitespace-line ((t (:background "black" :foreground "violet"))))
- '(haskell-interactive-face-prompt ((t (:foreground "green"))))
- '(org-verbatim ((t (:foreground "red3"))))
- '(org-code ((t (:foreground "green3"))))
- '(ivy-current-match ((t (:weight bold :underline t :slant italic))))
'(orderless-match-face-0 ((t (:weight bold :foreground "lime green"))))
'(orderless-match-face-1 ((t (:weight bold :foreground "light green"))))
'(orderless-match-face-2 ((t (:weight bold :foreground "forest green"))))
'(orderless-match-face-3 ((t (:weight bold :foreground "dark green"))))
+ '(org-block ((t (:background "grey3" :inherit shadow))))
+ '(org-code ((t (:foreground "green3"))))
+ '(org-quote ((t (:slant italic))))
+ '(org-verbatim ((t (:foreground "red3"))))
'(pdf-isearch-batch ((t (:foreground "black" :background "white"))))
- '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal :weight normal :slant normal :underline nil :overline nil :extend nil :strike-through nil :box nil :inverse-video nil :foreground "#b6b6b6" :background "gray5" :stipple nil :inherit nil)))))
+ '(query-replace ((t (:inherit (isearch)))))
+ '(region ((t (:extend t :background "grey25"))))
+ '(shadow ((((class color grayscale) (min-colors 88) (background light)) (:foreground "grey50"))
+ (((class color grayscale) (min-colors 88) (background dark)) (:foreground "grey70"))
+ (((class color) (min-colors 8) (background light)) (:foreground "green"))
+ (((class color) (min-colors 8) (background dark)) (:foreground "yellow"))))
+ '(secondary-selection
+ ((t (:extend t :background "SkyBlue4"))))
+ '(tooltip ((t (:foreground "black" :background "lightyellow" :inherit (variable-pitch)))))
+ '(trailing-whitespace ((((class color) (background light)) (:background "red1"))
+ (((class color) (background dark)) (:background "red1"))))
+ '(variable-pitch ((((type w32)) (:foundry "outline" :family "Arial")) (t (:family "Sans Serif"))))
+ '(whitespace-line ((t (:background "black" :foreground "violet"))))
+ '(whitespace-space ((t (:background "grey6" :foreground "black"))))
+ '(whitespace-tab ((t (:background "grey5" :foreground "grey20"))))
+ '(default ((t (:family "Source Code Pro" :foundry "ADBO" :width normal
+ :weight normal :slant normal :underline nil :overline nil
+ :extend nil :strike-through nil :box nil :inverse-video nil
+ :foreground "#b6b6b6" :background "black" :stipple nil :inherit nil)))))
(provide-theme 'personal-primary)
diff --git a/Emacs/.config/emacs/elisp/search.el b/Emacs/.config/emacs/elisp/search.el
new file mode 100644
index 0000000..8988572
--- /dev/null
+++ b/Emacs/.config/emacs/elisp/search.el
@@ -0,0 +1,67 @@
+;;; search.el --- Search a list of git directories at once! -*- lexical-binding: t; -*-
+
+;; Copyright (C) 2024 Aryadev Chavali
+
+;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
+;; Keywords:
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License Version
+;; 2 as published by the Free Software Foundation.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program. If not, see <https://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;; Given a list of git source directories, provide a completing-read
+;; interface which will narrow and give you a file.
+
+;;; Code:
+
+(defvar +search/directories
+ '("~/Dotfiles/" "~/Text/" "~/.local/src/dwm/" "~/.local/src/dwmblocks/" "~/.local/src/st/")
+ "List of directories to get candidates from.")
+
+(defun +search/get-candidates (directory)
+ "Get files from DIRECTORY using counsel-git-cands.
+Returns a list of files with the directory preprended to them."
+ (let* ((default-directory directory)
+ (names (split-string
+ (shell-command-to-string "git ls-files -z --full-name --")
+ "\0")))
+ (mapcar #'(lambda (name)
+ (concat directory name))
+ names)))
+
+(defun +search/get-all-candidates ()
+ (cl-reduce
+ #'(lambda (x y) (append x y))
+ (mapcar #'(lambda (directory)
+ (+search/get-candidates (expand-file-name directory)))
+ +search/directories)))
+
+(defun +search/find-file ()
+ (interactive)
+ (find-file
+ (completing-read "Find file: "
+ (+search/get-all-candidates)
+ nil
+ t)))
+
+(defun +search/search-all ()
+ (interactive)
+ (let ((term (read-string "Search for: ")))
+ (grep (format "grep --color=auto -nH --null -e \"%s\" -- %s"
+ term
+ (cl-reduce #'(lambda (x y) (concat x " " y))
+ (mapcar #'(lambda (x) (concat "\"" x "\""))
+ (cl-remove-if #'directory-name-p (+search/get-all-candidates))))))))
+
+(provide 'search)
+;;; search.el ends here