diff --git a/.doom.d/config.el b/.doom.d/config.el new file mode 100644 index 0000000..2af4ecc --- /dev/null +++ b/.doom.d/config.el @@ -0,0 +1,553 @@ +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Place your private configuration here! Remember, you do not need to run 'doom +;; refresh' after modifying this file! + + +;; These are used for a number of things, particularly for GPG configuration, +;; some email clients, file templates and snippets. +(setq doom-localleader-key "'") + +;; (advice-add #'doom-load-session :ignore) + +;; Doom exposes five (optional) variables for controlling fonts in Doom. Here +;; are the three important ones: +;; +;; + `doom-font' +;; + `doom-variable-pitch-font' +;; + `doom-big-font' -- used for `doom-big-font-mode' +;; +;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd +;; font string. You generally only need these two: +;; test +(setq doom-font + (font-spec :family "CaskaydiaCove Nerd Font" :size 12) + doom-big-font + (font-spec :family "JetBrainsMono Nerd Font" :size 22) + doom-variable-pitch-font + (font-spec :family "Overpass" :size 12)) + +(advice-add 'doom/load-session :override #'ignore) + +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. These are the defaults. +(setq doom-theme 'doom-wilmersdorf) + +;; If you intend to use org, it is recommended you change this! +(setq org-directory "~/org/") + +;; If you want to change the style of line numbers, change this to `relative' or +;; `nil' to disable it: +(setq display-line-numbers-type nil) +(setq-default truncate-lines t) + +;; Here are some additional functions/macros that could help you configure Doom: +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', where Emacs +;; looks when you load packages with `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c g k'). +;; This will open documentation for it, including demos of how they are used. +;; +;; You can also try 'gd' (or 'C-c g d') to jump to their definition and see how +;; they are implemented. +;; +;; +;; +;; +;; + +;; don't ask for risky variables in dir-locals +(progn (advice-add 'risky-local-variable-p :override #'ignore) + (setq enable-local-variables t enable-local-eval t)) + +(after! evil-collection (setq evil-collection-mode-list (delete 'lispy evil-collection-mode-list))) + + + + + +;; deactived for now (dont need) +;; (add-hook! window-setup #'doom/quickload-session) +;; (add-hook! kill-emacs #'doom/quicksave-session) + +(after! magit + (map! :leader :n "ag" #'magit-status) + (magit-auto-revert-mode +1) + (global-auto-revert-mode +1) + (setq magit-git-global-arguments + '("--no-pager" "-c" "core.preloadindex=true" "-c" "log.showSignature=false" "-c" "color.ui=false" "-c" "color.diff=false")) + (magit-wip-mode +1) + (map! :map magit-mode-map :n "RET" #'magit-diff-visit-worktree-file) + (defun qleguennec/commit-to-wip () + (interactive) + (magit-with-toplevel + (dolist (file (magit-unstaged-files)) + (magit-stage-file file)) + (magit-run-git "commit" (concat "--message=[wip " (format-time-string "%Y-%m-%d %H:%M") "]"))))) + +(map! :leader :n "h." #'helpful-at-point) + +(map! :leader :n "o e" #'projectile-run-shell) + +(map! :n "gp" #'profiler-start + :n "gP" #'profiler-stop) + +(setq evil-vsplit-window-right t evil-split-window-below t evil-escape-key-sequence nil) + +(defun insert-random-uuid () + "Insert a UUID. +This commands calls “uuidgen” on MacOS, Linux, and calls PowelShell on Microsoft Windows. +URL `http://ergoemacs.org/emacs/elisp_generate_uuid.html' +Version 2020-06-04" + (interactive) + (let ((uuid (string-trim-right (shell-command-to-string "uuidgen")))) + (kill-new (concat ":" uuid)) + (insert uuid))) + +(setq warning-suppress-types '((yasnippet backquote-change))) + +(defun recenter-and-blink (&rest _ignore) (doom-recenter-a) (+nav-flash-blink-cursor)) +(advice-add #'+lookup/definition :after #'recenter-and-blink) + +(defun join-lines-after-delete (&rest _ignore) (interactive) (delete-blank-lines)) + +(after! lispy + (advice-add #'lispy-up :after #'doom-recenter-a) + (advice-add #'lispy-down :after #'doom-recenter-a) + (advice-add #'lispy-move-down :after #'doom-recenter-a) + (advice-add #'lispy-move-up :after #'doom-recenter-a) + (setq lispy-eval-display-style 'overlay) + (map! :map lispy-mode-map :i "[" #'lispy-brackets :i "{" #'lispy-braces)) + +(after! lispyville + :config + (add-hook 'lispyville-delete #'join-lines-after-delete) + (add-hook 'lispyville-delete-whole-line #'join-lines-after-delete) + (add-hook 'lispyville-delete-line #'join-lines-after-delete)) + +(after! projectile + (setq projectile-project-name-function + (lambda (project-root) + (let ((project-root (projectile-project-root)) + (wp-split (split-string project-root "wp/"))) + (if (= 2 (length wp-split)) + (replace-regexp-in-string "/$" "" (cadr wp-split)) + (projectile-default-project-name project-root))))) + (setq projectile-use-git-grep t) + (setq projectile-enable-caching nil) + (setq projectile-indexing-method 'alien) + (setq projectile-project-root-functions + #'(projectile-root-top-down projectile-root-top-down-recurring + projectile-root-bottom-up + projectile-root-local))) + +(advice-add 'evil-window-up + :after + (lambda (arg) + (when (string-equal " *NeoTree*" (buffer-name (current-buffer))) + (evil-window-right 1)))) + +(after! flycheck :config (advice-add #'flycheck-next-error :after #'recenter-and-blink)) + +(after! evil + (require 'evil-textobj-anyblock) + (evil-define-text-object my-evil-textobj-anyblock-inner-quote + (count &optional beg end type) + "Select the closest outer quote." + (let ((evil-textobj-anyblock-blocks + '(("'" . "'") ("\"" . "\"") ("`" . "`") ("“" . "”")))) + (evil-textobj-anyblock--make-textobj beg end type count nil))) + (evil-define-text-object my-evil-textobj-anyblock-a-quote + (count &optional beg end type) + "Select the closest outer quote." + (let ((evil-textobj-anyblock-blocks + '(("'" . "'") ("\"" . "\"") ("`" . "`") ("“" . "”")))) + (evil-textobj-anyblock--make-textobj beg end type count t))) + (define-key evil-inner-text-objects-map "q" 'my-evil-textobj-anyblock-inner-quote) + (define-key evil-outer-text-objects-map "q" 'my-evil-textobj-anyblock-a-quote) + (advice-add 'evil-scroll-line-to-center :after #'recenter-and-blink) + (advice-add 'evil-backward-paragraph :after #'recenter-and-blink) + (advice-add 'evil-forward-paragraph :after #'recenter-and-blink) + (advice-add 'evil-ex-search-next :after #'recenter-and-blink) + (advice-add 'evil-ex-search-previous :after #'recenter-and-blink) + (advice-add 'evil-goto-line :after #'recenter-and-blink) + (advice-add 'evil-goto-line :after #'recenter-and-blink) + (advice-add 'evil-forward-section-begin :after #'recenter-and-blink) + (advice-add 'evil-forward-section-end :after #'recenter-and-blink) + (advice-add 'evil-backward-section-begin :after #'recenter-and-blink) + (advice-add 'evil-backward-section-end :after #'recenter-and-blink) + (map! :n + "'" + #'evil-use-register + :n + "{" + #'evil-backward-section-begin + :n + "}" + #'evil-forward-section-begin + :nvi + "C-/" + #'evil-search-forward + :nvi + "C-j" + (cmd! () (save-excursion (evil-beginning-of-line))))) + +(after! evil-snipe :config (setq evil-snipe-scope 'whole-buffer)) + +(after! lsp-mode + (remove-hook 'lsp-mode-hook #'lsp-ui-mode) + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\resources\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\target\\'") + (add-to-list 'lsp-file-watch-ignored-directories "[/\\\\]\\node-modules\\'") + (map! :n + "C-/" #'lsp-find-references)) + +(after! cider + ;; (add-hook 'company-completion-started-hook 'ans/set-company-maps) + ;; (add-hook 'company-completion-finished-hook 'ans/unset-company-maps) + ;; (add-hook 'company-completion-cancelled-hook 'ans/unset-company-maps) + (remove-hook 'cider-mode-hook #'rainbow-delimiters-mode) + (remove-hook 'clojure-mode-hook #'rainbow-delimiters-mode) + + ;; (add-hook 'clojure-mode-hook #'lsp) + ;; (add-hook 'clojurescript-mode-hook #'lsp) + + (setq clojure-toplevel-inside-comment-form t) + (setq cider-show-error-buffer nil) + (map! :map lsp-mode-map + :nv "gd" #'lsp-find-definition + :nv "C-/" #'lsp-find-references) + + (defun qleguennec/avoid-compiled (filename) + (if (s-matches? ".*/resources/public/cljs-out/dev.*" filename) + (s-replace "/resources/public/cljs-out/dev" + "/src/cljs" + filename) + filename)) + + ;; (defadvice! lsp-xrefs-no-compiled (oldfunc locations) + ;; :around #'lsp--locations-to-xref-items + ;; (let* ((uri (gethash "uri" locations))) + ;; (remhash "uri" locations) + ;; (puthash "uri" (qleguennec/avoid-compiled uri) + ;; locations) + ;; (funcall oldfunc locations))) + ;; (advice-remove 'lsp--locations-to-xref-items #'lsp-xrefs-no-compiled) + + (defun clojure-before-save-hook (&rest _args) + (when (and (fboundp #'alix-controller/zprint-file) + (or + (equal major-mode 'clojure-mode) + (equal major-mode 'clojurescript-mode))) + ;; (alix-controller/zprint-file) + )) + + (add-hook 'before-save-hook + #'clojure-before-save-hook) + + (setq cljr-auto-clean-ns nil cljr-auto-sort-ns nil) + ;; (add-hook 'cider-repl-mode-hook #'cider-company-enable-fuzzy-completion) + ;; (add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion) + (set-popup-rules! '(("^\\*cider-inspect" :vslot 2 :ttl nil :quit nil) + ("^\\*cider-result*" :slot 1 :vslot 1 :quit nil :select t))) + ;; (remove-hook 'before-save-hook #'cider/indent-before-save) + (defun indent-after-paste + (&rest _ignore) + (call-interactively #'+evil/reselect-paste) + (call-interactively #'evil-indent-line) + (call-interactively #'evil-indent) + (call-interactively #'evil-first-non-blank) + (when cider-mode (call-interactively #'clojure-align))) + (advice-add 'evil-paste-after :after #'indent-after-paste) + (advice-add 'evil-paste-before :after #'indent-after-paste) + (setq cider-font-lock-reader-conditionals + nil + cider-font-lock-dynamically + '(macro core) + cider-inspector-auto-select-buffer + nil + cider-save-file-on-load + t + cider-prompt-for-symbol + nil) + (add-hook 'cider-repl-mode-hook #'cider-company-enable-fuzzy-completion) + (add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion) + (defun ans/unset-company-maps + (&rest unused) + "Set default mappings (outside of company). + Arguments (UNUSED) are ignored." + (general-def :states + 'insert + :keymaps + 'override + "" + nil + "" + nil + "C-j" + nil + "C-k" + nil + "RET" + nil + "*" + nil + [return] + nil)) + + (defun ans/set-company-maps + (&rest unused) + "Set maps for when you're inside company completion. + Arguments (UNUSED) are ignored." + (general-def :states + 'insert + :keymaps + 'override + "" + 'company-select-next + "" + 'company-select-previous + "C-j" + 'company-select-next + "C-k" + 'company-select-previous + "RET" + 'company-complete + "*" + 'counsel-company + [return] + 'company-complete)) + (setq nrepl-log-messages t) + (map! :map + cider-repl-mode-map + :ni + "" + #'cider-repl-forward-input + :ni + "" + #'cider-repl-backward-input) + (map! :map cider-inspector-mode-map :ni "" #'cider-inspector-pop) + (map! :map cider-mode-map :localleader "e D" #'cider-debug-defun-at-point) + (remove-hook 'cider-connected-hook #'+clojure--cider-dump-nrepl-server-log-h)) + +(defun qleguennec/set-frame-transparency (&optional frame) + (interactive) + (let ((frame (or frame (selected-frame)))) + (set-frame-parameter frame 'alpha-background 80))) + +(dolist (frame (visible-frame-list)) + (qleguennec/set-frame-transparency frame)) + +(add-to-list 'after-make-frame-functions + #'qleguennec/set-frame-transparency) + +;; (map! :n "C-l" #'+workspace/switch-right :n "C-h" #'+workspace/switch-left) + +(map! :map emacs-lisp-mode-map :localleader "e D" #'edebug-defun) +(map! :leader + :nv "w v" (lambda! () + (call-process "i3-msg" nil 0 nil "split" "h") + (make-frame)) + :nv "w s" (lambda! () + (call-process "i3-msg" nil 0 nil "split" "v") + (make-frame))) + +(after! company + :config + (setq company-echo-last-msg 't) + (map! + :map company-active-map + "`" + #'counsel-company)) + +;; (use-package wgrep :config (setq wgrep-change-readonly-file t)) + +(use-package marginalia + :config + (marginalia-mode +1) + (setq marginalia-annotators '(marginalia-annotators-heavy)) + :bind + (:map minibuffer-local-map ("M-a" . marginalia-cycle))) + +(use-package embark + :bind (("C-S-a" . embark-act) ;; pick some comfortable binding + ("C-h B" . embark-bindings) ;; alternative for `describe-bindings' + ("C-e" . embark-export)) + :init + ;; Optionally replace the key help with a completing-read interface + (setq prefix-help-command #'embark-prefix-help-command) + :config + ;; Hide the mode line of the Embark live/completions buffers + (add-to-list 'display-buffer-alist + '("\\`\\*Embark Collect \\(Live\\|Completions\\)\\*" + nil + (window-parameters (mode-line-format . none))))) + +(use-package embark-consult + :after (embark consult) + :demand t ; only necessary if you have the hook below + ;; if you want to have consult previews as you move around an + ;; auto-updating embark collect buffer + :hook (embark-collect-mode . embark-consult-preview-minor-mode)) + +(use-package consult + :demand t + :init + ;; Optionally configure the register formatting. This improves the register + ;; preview for `consult-register', `consult-register-load', + ;; `consult-register-store' and the Emacs built-ins. + (setq register-preview-delay 0 register-preview-function #'consult-register-format) + ;; Optionally tweak the register preview window. + ;; This adds thin lines, sorting and hides the mode line of the window. + (advice-add #'register-preview :override #'consult-register-window) + :config + ;; Use Consult to select xref locations with preview + (setq xref-show-xrefs-function #'xref--show-xref-buffer xref-show-definitions-function #'xref-show-definitions-buffer) + (autoload 'projectile-project-root "projectile") + (setq consult-project-root-function #'projectile-project-root) + (setq consult-git-grep-command + (concat + "git --no-pager grep --null --color=always --extended-regexp --line-number -I -e ARG OPTS" + " -- :!orientdb-community-importers-2.2.37")) + (map! :vn + "?" + #'consult-git-grep + :n + "/" + #'consult-line + :n + "SPC '" + #'selectrum-repeat + :leader + "i m" + #'consult-global-mark + :leader + "i i" + #'consult-imenu-multi)) + + + +(use-package orderless + :init (icomplete-mode) ; optional but recommended! + :custom (completion-styles '(orderless))) + + + + + +(after! centaur-tabs + (centaur-tabs-group-by-projectile-project) + (map! + :map centaur-tabs-mode-map + "C-l" #'centaur-tabs-forward + "C-h" #'centaur-tabs-backward)) + +(defun qleguennec/put-file-name-on-clipboard () + "Put the current file name on the clipboard." + (interactive) + (let ((filename (if (equal major-mode 'dired-mode) default-directory (buffer-file-name)))) + (when filename + (with-temp-buffer (insert filename) (clipboard-kill-region (point-min) (point-max))) + (message filename)))) + + + +(advice-add #'evil-next-line :after #'doom-recenter-a) +(advice-add #'evil-previous-line :after #'doom-recenter-a) + +(setq frame-title-format + '((:eval (if (equal major-mode 'dired-mode) + default-directory + (buffer-file-name))) + " – Doom Emacs")) + +(defun qleguennec/cycle-themes () + (interactive) + (let* ((sorted-themes (->> (custom-available-themes) + (-filter (lambda (theme) + (and (not (-contains? + '(doom-tomorrow-day + doom-flatwhite + doom-homage-white) + theme)) + (let ((theme (symbol-name theme))) + (and (s-starts-with? "doom" theme) + (not (s-ends-with? "light" theme))))))) + (-sort #'string< ))) + (themes-from-current (-drop-while (lambda (theme) (not (eq doom-theme theme))) sorted-themes)) + (next-theme (cadr (append themes-from-current sorted-themes)))) + (message (symbol-name next-theme)) + (setq doom-theme next-theme) + (load-theme next-theme t) + (doom/reload-theme))) + +(defun qleguennec/toggle-transparency (&optional frame) + (interactive) + (let* ((frame (or frame (selected-frame))) + (alpha (frame-parameter frame 'alpha))) + (set-frame-parameter + frame 'alpha + (if (eql (cond ((numberp alpha) alpha) + ((numberp (cdr alpha)) (cdr alpha)) + ;; Also handle undocumented ( ) form. + ((numberp (cadr alpha)) (cadr alpha))) + 100) + '(85 . 50) '(100 . 100))))) + +(map! + :leader + :nvi "h h" #'qleguennec/cycle-themes) + +(defun qleguennec/prettier-parens:fontify-search (limit) + (let ((result nil) + (finish nil) + (bound (+ (point) limit))) + (while (not finish) + (if (re-search-forward "\\s)" bound t) + (when (and (= 0 (string-match-p "\\s)*$" (buffer-substring-no-properties (point) (line-end-position)))) + (not (eq (char-before (1- (point))) 92))) + (setq result (match-data) + finish t)) + (setq finish t))) + result)) + +(defface qleguennec/prettier-parens:dim-paren-face + '((((class color) (background dark)) + (:foreground "grey30")) + (((class color) (background light)) + (:foreground "grey60"))) + "Prettier parens" + :group 'prettier-parens) + + +(define-minor-mode prettier-parens-mode + "Prettier parens mode." + :init-value nil + (if prettier-parens-mode + (progn (rainbow-delimiters-mode-disable) + (font-lock-add-keywords + nil '((qleguennec/prettier-parens:fontify-search . 'qleguennec/prettier-parens:dim-paren-face))) + (if (fboundp 'font-lock-flush) + (font-lock-flush) + (when font-lock-mode + (with-no-warnings + (font-lock-fontify-buffer))))) + (progn + (font-lock-remove-keywords nil + '((qleguennec/prettier-parens:fontify-search . 'qleguennec/prettier-parens:dim-paren-face))) + (if (fboundp 'font-lock-flush) + (font-lock-flush) + (when font-lock-mode + (with-no-warnings + (font-lock-fontify-buffer))))))) + +(add-hook! '(clojure-mode-hook clojurescript-mode-hook emacs-lisp-mode-hook) + (defun enable-lisp-modes (&rest args) + (prettier-parens-mode))) diff --git a/.doom.d/custom.el b/.doom.d/custom.el new file mode 100644 index 0000000..dbeb7a9 --- /dev/null +++ b/.doom.d/custom.el @@ -0,0 +1,12 @@ +(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 '(cargo lsp-mode selectrum rust-mode flimenu amx))) +(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/.doom.d/init.el b/.doom.d/init.el new file mode 100644 index 0000000..fb8ff4d --- /dev/null +++ b/.doom.d/init.el @@ -0,0 +1,206 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load in. +;; Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find information about all of Doom's modules +;; and what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c g k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c g d') on a module to browse its +;; directory (for easy access to its source code). +;; + +(doom! :input + ;;chinese + ;;japanese + + :completion + company ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;; (ivy + ;; +prescient + ;; +fuzzy + ;; +icons) + ; a search engine for love and life + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + doom-quit ; DOOM quit-message prompts when you quit Emacs + ;;fill-column ; a `fill-column' indicator + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;; indent-guides ; highlighted indent columns + modeline + ; snazzy, Atom-inspired modeline, plus API + nav-flash ; blink the current line after jumping + ;; neotree ; a project drawer, like NERDTree for vim + ophints + ; highlight the region an operation acts on + (popup ; tame sudden yet inevitable temporary windows + +all ; catch all popups that start with an asterix + +defaults) ; default popup rules + (ligatures +extra +fira) + ;; tabs ; an tab bar for Emacs + ;; treemacs + ; a project drawer, like neotree but cooler + ;;unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + ;; vi-tilde-fringe ; fringe tildes to mark beyond EOB + window-select ; visually switch windows + ;; workspaces ; tab emulation, persistence & separate workspaces + ;; zen + ; distraction-free coding or writing + + :editor + (evil +everywhere) ; come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + ;; fold ; (nigh) universal code folding + ;; (format +onsave) + ; automated prettiness + ;;god ; run Emacs commands without modifier keys + lispy ; vim for lisp, for people who don't like vim + multiple-cursors + ; editing in many places at once + ;; objed ; text object editing for the innocent + ;; ^ + ;; parinfer ; turn lisp into python, sort of + ;; ;; rotate-text + ;; ; cycle region at point between text candidates + snippets + ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + (dired + +icons) ; making dired pretty [functional] + ;; electric ; smarter, keyword-based electric-indent + ;; ibuffer ; interactive buffer management + vc ; version-control and Emacs, sitting in a tree + + :term + ;; eshell ; a consistent, cross-platform shell (WIP) + ;;shell ; a terminal REPL for Emacs + ;; term ; terminals in Emacs + ;; vterm + ; another terminals in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + ;;spell ; tasing you for misspelling mispelling + ;;grammar ; tasing grammar mistake every you make + + :tools + ;;ansibly + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + ;;docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;flyspell ; tasing you for misspelling mispelling + ;;gist ; interacting with github gists + (lookup ; helps you navigate your code and documentation + +docsets) ; ...or in Dash docsets locally + lsp + ;;macos ; MacOS-specific commands + magit ; a git porcelain for Emacs + ;;make ; run make tasks from Emacs + ;;pass ; password manager for nerds + ;;pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + ;;rgb ; creating color strings + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + ;;upload ; map local to remote projects via ssh/ftp + + :lang + ;;agda ; types of types of types of types... + ;;assembly ; assembly for fun or debugging + ;; cc ; C/C++/Obj-C madness + (clojure +lsp) + ;; clojure + ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;; (csharp +lsp +unity) + ; unity, .NET, and mono shenanigans + data ; config/data formats + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;faust ; dsp, but you get to keep your soul + ;;fsharp ; ML stands for Microsoft's Language + ;;go ; the hipster dialect + ;; (haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; + ;;(java +meghanada) ; the poster child for carpal tunnel syndrome + ;; (javascript + ;; +typescript=mode + ;; +tide) + ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + ;; latex ; writing papers in Emacs has never been so fun + ;;lean + ;;factor + ;;ledger ; an accounting system in Emacs + ;;lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + ;;nix ; I hereby declare "nix geht mehr!" + ;; ocaml ; an objective camel + ;; (org ; organize your plain life in plain text + ;; +journal) + ;; +dragndrop ; drag & drop files/images into org buffers + ;; ;;+hugo ; use Emacs for hugo blogging + ;; ;;+jupyter ; ipython/jupyter support for babel + ;; ;;+pandoc ; export-with-pandoc support + ;; ;;+pomodoro ; be fruitful with the tomato technique + ;; +present + ; using org-mode for presentations + ;;perl ; write code no one else can comprehend + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + ;;python ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;ruby ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;scheme ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + ;; web ; the tubes + + :email + ;;mu4e + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + ;;write ; emacs for writers (fiction, notes, papers, etc.) + + :config + ;;literate + (default +bindings)) diff --git a/.doom.d/packages.el b/.doom.d/packages.el new file mode 100644 index 0000000..73c4923 --- /dev/null +++ b/.doom.d/packages.el @@ -0,0 +1,79 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; This is where you install packages, by declaring them with the `package!' +;; macro, then running 'doom refresh' on the command line. You'll need to +;; restart Emacs for your changes to take effect! Or at least, run M-x +;; `doom/reload'. +;; +;; WARNING: Don't disable core packages listed in ~/.emacs.d/core/packages.el. +;; Doom requires these, and disabling them may have terrible side effects. +;; +;; Here are a couple examples: + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: + ;(package! some-package) + +;; To install a package directly from a particular repo, you'll need to specify +;; a `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/raxod502/straight.el#the-recipe-format + ;(package! another-package + ; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': + ;(package! this-package + ; :recipe (:host github :repo "username/repo" + ; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, for whatever reason, +;; you can do so here with the `:disable' property: + ;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: + ;(package! builtin-package :recipe (:nonrecursive t)) + ;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see raxod502/straight.el#279) + ;(package! builtin-package :recipe (:branch "develop")) + +;; editor features +;; (package! super-save) +(package! hungry-delete) +(package! centered-cursor-mode) +(package! aggressive-indent) + +(unpin! doom-themes) + +(unpin! cider) +(unpin! clojure-mode) +;; (unpin! clj-refactor) +(unpin! doom-themes) +(unpin! flycheck-clj-kondo) +(unpin! company) +(unpin! company-dict) + +(package! selectrum) +(package! consult) +(package! mini-frame) +(package! orderless) +(package! flimenu) + +(package! prescient) +(package! selectrum-prescient) +(package! amx) + +(package! highlight-indent-guides) + +(package! super-save) + +(package! marginalia) +(package! embark) +(package! embark-consult) + +(package! xref :pin "a82f459b37b31546bf274388baf8aca79e9c30d9") diff --git a/.doom.d/snippets/cider-mode/dump b/.doom.d/snippets/cider-mode/dump new file mode 100644 index 0000000..1231893 --- /dev/null +++ b/.doom.d/snippets/cider-mode/dump @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: dump +# uuid: dump +# key: dump +# condition: t +# -- + +(pm/dump :`(insert-random-uuid)`) \ No newline at end of file diff --git a/.doom.d/snippets/clojure-mode/dump b/.doom.d/snippets/clojure-mode/dump new file mode 100644 index 0000000..457165b --- /dev/null +++ b/.doom.d/snippets/clojure-mode/dump @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: dump +# uuid: dump +# key: dump +# condition: t +# -- + +(postmortem.core/dump :`(insert-random-uuid)`$0)`(evil-normal-state)` \ No newline at end of file diff --git a/.doom.d/snippets/clojure-mode/spy b/.doom.d/snippets/clojure-mode/spy new file mode 100644 index 0000000..02ce6bb --- /dev/null +++ b/.doom.d/snippets/clojure-mode/spy @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: spy +# uuid: spy +# key: spy +# condition: t +# -- + +(postmortem.core/spy>> :`(insert-random-uuid)`$0)`(evil-normal-state)` \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/@sub b/.doom.d/snippets/clojurescript-mode/@sub new file mode 100644 index 0000000..756bb30 --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/@sub @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: @sub +# key: @sub +# -- + +@(subscribe [$0]) \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/dispatch b/.doom.d/snippets/clojurescript-mode/dispatch new file mode 100644 index 0000000..a8a7c02 --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/dispatch @@ -0,0 +1,5 @@ +# key: dis +# name: dispatch +# -- + +(re-frame/dispatch [$0]) \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/dump b/.doom.d/snippets/clojurescript-mode/dump new file mode 100644 index 0000000..433cd13 --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/dump @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: dump +# uuid: dump +# key: dump +# condition: t +# -- + +(postmortem.core/dump $0:`(insert-random-uuid)``(alix-client/add-posmortem-core)`) \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/log b/.doom.d/snippets/clojurescript-mode/log new file mode 100644 index 0000000..19e98b3 --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/log @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: log +# key: log +# -- + +(.log js/console $0) \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/map b/.doom.d/snippets/clojurescript-mode/map new file mode 100644 index 0000000..722e0ce --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/map @@ -0,0 +1,10 @@ +# -*- mode: snippet -*- +# name: map +# key: map +# -- + +{${1:$$(when (and yas-modified-p yas-moving-away-p) + (->> yas-text + (s-split " ") + (-map (lambda (key) (format ":%s %s" key key))) + (s-join " ")))}} \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/reg-ev b/.doom.d/snippets/clojurescript-mode/reg-ev new file mode 100644 index 0000000..cd91fd4 --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/reg-ev @@ -0,0 +1,8 @@ +# key: reg-ev +# name: reg-ev +# -- +(re-frame/reg-event-db + :${1:ev-name} + base-middleware + (fn ${1:$(replace-regexp-in-string "^.*/" "" yas-text)} [db [_]] + )) \ No newline at end of file diff --git a/.doom.d/snippets/clojurescript-mode/reg-sub b/.doom.d/snippets/clojurescript-mode/reg-sub new file mode 100644 index 0000000..77da92e --- /dev/null +++ b/.doom.d/snippets/clojurescript-mode/reg-sub @@ -0,0 +1,7 @@ +# key: reg-sub +# name: reg-sub +# -- +(re-frame/reg-sub + ${1:sub-name} + (fn ${1:$(s-replace-regexp "^.*/" "" yas-text)}-input [[_ ]]) + (fn ${1:$(s-replace-regexp "^.*/" "" yas-text)} [[]])) \ No newline at end of file diff --git a/.emacs.d b/.emacs.d new file mode 160000 index 0000000..42e5763 --- /dev/null +++ b/.emacs.d @@ -0,0 +1 @@ +Subproject commit 42e5763782fdc1aabb9f2624d468248d6978abe2 diff --git a/.zshrc b/.zshrc new file mode 100644 index 0000000..052d259 --- /dev/null +++ b/.zshrc @@ -0,0 +1,103 @@ +# If you come from bash you might have to change your $PATH. +# export PATH=$HOME/bin:/usr/local/bin:$PATH + +# Path to your oh-my-zsh installation. +export ZSH="$HOME/.oh-my-zsh" + +# Set name of the theme to load --- if set to "random", it will +# load a random theme each time oh-my-zsh is loaded, in which case, +# to know which specific one was loaded, run: echo $RANDOM_THEME +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes +ZSH_THEME="robbyrussell" + +# Set list of themes to pick from when loading at random +# Setting this variable when ZSH_THEME=random will cause zsh to load +# a theme from this variable instead of looking in $ZSH/themes/ +# If set to an empty array, this variable will have no effect. +# ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" ) + +# Uncomment the following line to use case-sensitive completion. +# CASE_SENSITIVE="true" + +# Uncomment the following line to use hyphen-insensitive completion. +# Case-sensitive completion must be off. _ and - will be interchangeable. +# HYPHEN_INSENSITIVE="true" + +# Uncomment one of the following lines to change the auto-update behavior +# zstyle ':omz:update' mode disabled # disable automatic updates +# zstyle ':omz:update' mode auto # update automatically without asking +# zstyle ':omz:update' mode reminder # just remind me to update when it's time + +# Uncomment the following line to change how often to auto-update (in days). +# zstyle ':omz:update' frequency 13 + +# Uncomment the following line if pasting URLs and other text is messed up. +# DISABLE_MAGIC_FUNCTIONS="true" + +# Uncomment the following line to disable colors in ls. +# DISABLE_LS_COLORS="true" + +# Uncomment the following line to disable auto-setting terminal title. +# DISABLE_AUTO_TITLE="true" + +# Uncomment the following line to enable command auto-correction. +# ENABLE_CORRECTION="true" + +# Uncomment the following line to display red dots whilst waiting for completion. +# You can also set it to another string to have that shown instead of the default red dots. +# e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f" +# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765) +# COMPLETION_WAITING_DOTS="true" + +# Uncomment the following line if you want to disable marking untracked files +# under VCS as dirty. This makes repository status check for large repositories +# much, much faster. +# DISABLE_UNTRACKED_FILES_DIRTY="true" + +# Uncomment the following line if you want to change the command execution time +# stamp shown in the history command output. +# You can set one of the optional three formats: +# "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd" +# or set a custom format using the strftime function format specifications, +# see 'man strftime' for details. +# HIST_STAMPS="mm/dd/yyyy" + +# Would you like to use another custom folder than $ZSH/custom? +# ZSH_CUSTOM=/path/to/new-custom-folder + +# Which plugins would you like to load? +# Standard plugins can be found in $ZSH/plugins/ +# Custom plugins may be added to $ZSH_CUSTOM/plugins/ +# Example format: plugins=(rails git textmate ruby lighthouse) +# Add wisely, as too many plugins slow down shell startup. +plugins=(git zsh-autosuggestions) + +source $ZSH/oh-my-zsh.sh + +# User configuration + +# export MANPATH="/usr/local/man:$MANPATH" + +# You may need to manually set your language environment +# export LANG=en_US.UTF-8 + +# Preferred editor for local and remote sessions +# if [[ -n $SSH_CONNECTION ]]; then +# export EDITOR='vim' +# else +# export EDITOR='mvim' +# fi + +# Compilation flags +# export ARCHFLAGS="-arch x86_64" + +# Set personal aliases, overriding those provided by oh-my-zsh libs, +# plugins, and themes. Aliases can be placed here, though oh-my-zsh +# users are encouraged to define aliases within the ZSH_CUSTOM folder. +# For a full list of active aliases, run `alias`. +# +# Example aliases +# alias zshconfig="mate ~/.zshrc" +# alias ohmyzsh="mate ~/.oh-my-zsh" +alias discord='discord --no-sandbox' +alias em='emacs' diff --git a/bin/compix b/bin/compix new file mode 100755 index 0000000..e3396c2 Binary files /dev/null and b/bin/compix differ diff --git a/cfg/polybar/config b/cfg/polybar/config index 98c3932..3d71dc4 100644 --- a/cfg/polybar/config +++ b/cfg/polybar/config @@ -38,8 +38,8 @@ bottom = false line-size = 1 wm-restack = bspwm -modules-left = herbs -modules-center = +modules-left = mpd +modules-center = modules-right = alsa mem battery wlan round-left time round-right settings font-0 = CaskaydiaCove Nerd Font:style=Bold:pixelsize=11;3 @@ -50,7 +50,7 @@ font-3 = Dejavu Serif:fontformat=truetype:size=10:antialias=true;3 [module/mpd] type = internal/mpd interval = 2 -format-online = +format-online = icon-play-foreground = ${colors.color1} icon-play = 󰐊 icon-pause-foreground = ${colors.color1} @@ -67,6 +67,7 @@ icon-pause-underline = ${colors.color3} icon-prev-underline = ${colors.color3} + [module/alsa] type = internal/alsa format-volume = @@ -322,3 +323,7 @@ label-padding = 1 label-empty = "" ;label-empty-foreground = ${color.blue-light} label-empty-padding = 2 + +[module/settings] +screenchange-reload = true +pseudo-transparency = true diff --git a/cfg/polybar/config.ini b/cfg/polybar/config.ini deleted file mode 100644 index d70639f..0000000 --- a/cfg/polybar/config.ini +++ /dev/null @@ -1,346 +0,0 @@ - -[colors] -background = ${xrdb:background} -foreground = ${xrdb:foreground} -color0 = ${xrdb:color0} -color1 = ${xrdb:color1} -color2 = ${xrdb:color2} -color3 = ${xrdb:color3} -color4 = ${xrdb:color4} -color5 = ${xrdb:color5} -color6 = ${xrdb:color6} -color7 = ${xrdb:color7} -color8 = ${xrdb:color8} -color9 = ${xrdb:color9} -color10 = ${xrdb:color10} -color11 = ${xrdb:color11} -color12 = ${xrdb:color12} -color13 = ${xrdb:color13} -color14 = ${xrdb:color14} -color15 = ${xrdb:color15} -dark-light = #272A2B -active-light = #313435 - -[bar/example] -#tray-position = right -;monitor = LVDS1 -width = 98% -height = 35 -padding-left = 1 -padding-right = 1 -radius = 15 -offset-x = 1% -offset-y = 1% -background = ${colors.background} -foreground = ${colors.foreground} -bottom = false - -line-size = 1 -wm-restack = bspwm - -modules-left = bspwm -modules-center = -modules-right = alsa mem battery wlan round-left time round-right settings - -font-0 = CaskaydiaCove Nerd Font:style=Bold:pixelsize=11;3 -font-1 = CaskaydiaCove Nerd Font:size=15;3 -font-2 = Material Design Icons:style=Bold:size=13;3 -font-3 = Dejavu Serif:fontformat=truetype:size=10:antialias=true;3 - -[module/mpd] -type = internal/mpd -interval = 2 -format-online = -icon-play-foreground = ${colors.color1} -icon-play = 󰐊 -icon-pause-foreground = ${colors.color1} -icon-pause = 󰏥 -icon-stop-foreground = ${colors.color1} -icon-stop = 󰓛 -icon-prev-foreground = ${colors.color4} -icon-prev = 󰒮 -icon-next-foreground = ${colors.color4} -icon-next = 󰒭 -icon-play-underline = ${colors.color3} -icon-next-underline = ${colors.color3} -icon-pause-underline = ${colors.color3} -icon-prev-underline = ${colors.color3} - - -[module/alsa] -type = internal/alsa -format-volume = -label-volume =  -label-volume-foreground = ${colors.color4} - -format-muted-foreground = ${colors.foreground} -label-muted = 󰚙 - -format-muted-padding = 1 -format-muted-background = #131a1c - -bar-volume-width = 10 -bar-volume-foreground-0 = #58acc4 -bar-volume-foreground-1 = #58acc4 -bar-volume-foreground-2 = #58acc4 -bar-volume-foreground-3 = #58acc4 -bar-volume-foreground-4 = #58acc4 -bar-volume-foreground-5 = #58acc4 -bar-volume-foreground-6 = #58acc4 -bar-volume-gradient = true -bar-volume-indicator = -bar-volume-indicator-foreground = #58acc4 -bar-volume-indicator-font = 1 -bar-volume-fill = ━ -bar-volume-fill-foreground = #61afef -bar-volume-fill-font = 1 -bar-volume-empty = ━ -bar-volume-empty-font = 1 -bar-volume-empty-foreground = ${colors.foreground} -format-volume-padding = 1 - -[module/temperature] -type = internal/temperature -thermal-zone = 0 -warn-temperature = 65 -label-foreground = ${colors.color7} -format =