diff --git a/.hgignore b/.hgignore index d15e8b5..cf4f783 100644 --- a/.hgignore +++ b/.hgignore @@ -8,3 +8,9 @@ projectile-bookmarks.eld straight transient *~ +.cache +.dap-breakpoints +.lsp-session-v1 +eclipse.jdt.ls/test-runner/junit-platform-console-standalone.jar +org-roam.db +workspace diff --git a/init.el b/init.el index 0abb45f..fdc0bbd 100644 --- a/init.el +++ b/init.el @@ -47,6 +47,9 @@ read-minibuffer-restore-windows t frame-background-mode 'dark) +;; show matching parenthesis +;(show-paren-mode 1) + ;; turn off UI various gizmos (set-face-attribute 'mode-line nil :box nil) (when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1)) @@ -54,8 +57,13 @@ (when (fboundp 'menu-bar-mode) (menu-bar-mode -1)) (blink-cursor-mode 0) +;; disable annoying ring-bell when backspace key is pressed in certain situations +(setq ring-bell-function 'ignore) + ;; use utf-8 (prefer-coding-system 'utf-8) +(set-language-environment "UTF-8") +(set-default-coding-systems 'utf-8) ;; UI settings when not in a terminal (when (display-graphic-p) @@ -88,18 +96,33 @@ ;; ;; use doom themes ;; (use-package doom-themes -;; :straight (doom-themes :type git -;; :host github -;; :repo "doomemacs/themes") -;; :config (load-theme 'doom-badger t) -;; (setq doom-badger-brighter-comments t -;; doom-themes-treemacs-theme "doom-colors") +;; ;; :straight (doom-themes :type git +;; ;; :host github +;; ;; :repo "doomemacs/themes") +;; :config ;(load-theme 'doom-badger t) +;; ;; (setq doom-badger-brighter-comments t +;; ;; doom-themes-treemacs-theme "doom-colors") +;; (load-theme 'neon-badger t) +;; (setq neon-badger-brighter-comments t +;; neon-themes-treemacs-theme "doom-colors") ;; ; (set-face-foreground-color 'font-lock-constant-face #635770) -;; (set-face-foreground 'font-lock-constant-face "#834980") +;; ; (set-face-foreground 'font-lock-constant-face "#834980") +;; ; (set-face-foreground 'font-lock-constant-face "#c37990") ;; (doom-themes-neotree-config) ;; (doom-themes-treemacs-config) ;; (doom-themes-org-config)) +;; (use-package heaven-and-hell +;; :ensure t +;; :init (setq heaven-and-hell-theme-type 'dark) +;; (setq heaven-and-hell-themes +;; '((light . doom-badger) +;; (dark . neon-badger))) +;; :hook (after-init . heaven-and-hell-init-hook) +;; ) + ;; :bind (("C-c " . heaven-and-hell-load-default-theme) + ;; ("" . heaven-and-hell-toggle-theme))) + ;; try using a fancier mode line (use-package doom-modeline :ensure t @@ -113,7 +136,6 @@ (display-battery-mode 1)) ;; line numbers -;(global-display-line-numbers-mode t) (add-hook 'prog-mode-hook 'display-line-numbers-mode) (setq display-line-numbers "%4d ") @@ -140,22 +162,22 @@ (require 'find-dired) (setq find-ls-option '("-print0 | xargs -0 ls -ld" . "-ld")) -;; hippie expand stuff: M-/ to expand things -(bind-key "M-/" 'hippie-expand) -(defun sanityinc/dabbrev-friend-buffer (other-buffer) - (< (buffer-size other-buffer) (* 1 1024 1024))) -(setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer) -(setq hippie-expand-try-functions-list - '(try-expand-all-abbrevs - try-complete-file-name-partially - try-complete-file-name - try-expand-dabbrev - try-expand-dabbrev-from-kill - try-expand-dabbrev-all-buffers - try-expand-list - try-expand-line - try-complete-lisp-symbol-partially - try-complete-lisp-symbol)) +;; ;; hippie expand stuff: M-/ to expand things +;; (bind-key "M-/" 'hippie-expand) +;; (defun sanityinc/dabbrev-friend-buffer (other-buffer) +;; (< (buffer-size other-buffer) (* 1 1024 1024))) +;; (setq dabbrev-friend-buffer-function 'sanityinc/dabbrev-friend-buffer) +;; (setq hippie-expand-try-functions-list +;; '(try-expand-all-abbrevs +;; try-complete-file-name-partially +;; try-complete-file-name +;; try-expand-dabbrev +;; try-expand-dabbrev-from-kill +;; try-expand-dabbrev-all-buffers +;; try-expand-list +;; try-expand-line +;; try-complete-lisp-symbol-partially +;; try-complete-lisp-symbol)) ;; comment regions using C-c # (uncomment with C-u C-c #) (global-set-key "\C-c#" 'comment-region) @@ -201,33 +223,94 @@ (use-package tuareg) (use-package forth-mode) +(use-package rust-mode) + +(use-package which-key + :ensure t + :init (which-key-mode)) + +(defun my/ansi-colorize-buffer () + (let ((buffer-read-only nil)) + (ansi-color-apply-on-region (point-min) (point-max)))) + +(use-package ansi-color + :ensure t + :config (add-hook 'compilation-filter-hook 'my/ansi-colorize-buffer)) + ;; scala-mode (use-package scala-mode :mode "\\.s\\(cala\\|bt\\)$" :interpreter ("scala" . scala-mode) - :config - (setq scala-indent:indent-value-expression nil - scala-indent:align-parameters nil - scala-indent:align-forms nil - scala-indent:use-javadoc-style t)) + :config (setq scala-indent:indent-value-expression nil + scala-indent:align-parameters nil + scala-indent:align-forms nil + scala-indent:use-javadoc-style t)) -;;; Enable nice rendering of diagnostics like compile errors. -;(use-package flycheck -; :init (global-flycheck-mode)) +(use-package company + :hook (scala-mode . company-mode) + :bind (("M-/" . company-complete)) + :config (add-hook 'after-init-hook 'global-company-mode)) -;; (use-package lsp-mode -;; :ensure t) -;; ; :init (setq lsp-prefer-flymake nil)) -;; -;; (use-package lsp-ui -;; :ensure t -;; :hook (lsp-mode . lsp-ui-mode)) -;; -;; (use-package lsp-scala -;; :after scala-mode -;; :demand t -;; ; :hook (scala-mode . lsp) -;; :init (setq lsp-scala-server-command "~/bin/metals-emacs")) +(if (equal(system-name) "cult") + (progn + + ;; Posframe is a pop-up tool that must be manually installed for dap-mode + (use-package posframe) + + ;; Use the Debug Adapter Protocol for running tests and debugging + (use-package dap-mode + :hook (lsp-mode . dap-mode) + (lsp-mode . dap-ui-mode)) + + (use-package flycheck + :init (global-flycheck-mode)) + + (use-package lsp-mode + :ensure t + :config (setq lsp-headerline-breadcrumb-enable nil + lsp-keymap-prefix "C-c l" + lsp-enable-symbol-highlighting nil + ;lsp-lens-enable nil + ;lsp-signature-render-documentation nil + lsp-eldoc-enable-hover nil + ;lsp-signature-auto-activate nil + ;lsp-enable-file-watchers nil + read-process-output-max (* 1024 1024) ; 1M + lsp-modeline-diagnostics-enable nil + lsp-prefer-capf t + lsp-completion-provider :capf + lsp-completion-enable t + lsp-prefer-flymake nil) + ;(setf (lsp--client-multi-root (gethash 'iph lsp-clients)) nil) + (define-key lsp-mode-map (kbd "C-c l") lsp-command-map) + :hook (lsp-mode . lsp-lens-mode) + (lsp-mode . lsp-enable-which-key-integration) + (scala-mode . lsp) + (rust-mode . lsp) + (java-mode . lsp)) + + (use-package lsp-metals + :ensure t + :config (setq lsp-metals-server-args '("-J-Dmetals.allow-multiline-string-formatting=off") + lsp-metals-show-inferred-type nil + lsp-metals-super-method-lenses-enabled nil + lsp-metals-show-implicit-arguments nil + lsp-meatals-show-implicit-conversions-and-classes nil)) + + (use-package lsp-ui + :ensure t + :hook (lsp-mode . lsp-ui-mode) + :config (setq lsp-ui-doc-enable nil + lsp-ui-sideline-enable t + ;lsp-ui-sideline-show-code-actions nil + lsp-ui-sideline-diagnostic-max-line-length 60 + lsp-ui-sideline-diagnostic-max-lines 6)) + + (use-package lsp-java + :ensure t + :config (add-hook 'java-mode-hook 'lsp)) + +)) ;; projectile (use-package projectile @@ -284,8 +367,8 @@ ;; org roam (use-package org-roam - :custom (org-roam-directory "~/org/") - :config (org-roam-db-autosync-mode)) + :config (setq org-roam-directory "~/org/") + (org-roam-db-autosync-mode)) ;; git-gutter (use-package git-gutter @@ -303,6 +386,9 @@ ;; json (use-package json-mode) +;; custom load path for ad-hoc lisp +(add-to-list 'load-path (file-truename (concat user-emacs-directory "lisp"))) + ;; glauce (require 'glauce-mode) @@ -314,6 +400,15 @@ :bind ("C-c d" . uxntal-explain-word) :config (setq uxntal-mode-strict-comments nil)) +;; lua +(use-package lua-mode) + +;; pico-8 +(use-package pico8-mode + :straight (pico8-mode :type git + :host github + :repo "Kaali/pico8-mode")) + ;; C-c C-c for M-x compile (global-set-key "\C-c\C-c" 'compile) @@ -363,6 +458,11 @@ :config (setq elpher-default-url-type "gemini://")) +;; ;; pdf/latex +;; (use-package doc-view +;; :custom doc-view-resolution 1600 +;; doc-view-scale-internally nil) + ;; local copy in .emacs.d/lisp (require 'etags-select) @@ -382,7 +482,7 @@ (defun toggle-indent-tabs () "Toggle tabs on/off" (interactive) - (setq indent-tabs-mode (if (indent-tabs-mode) nil t))) + (setq indent-tabs-mode (not indent-tabs-mode))) ;; handy function to regenerate tags (defun regenerate-tags () @@ -413,3 +513,17 @@ (set-face-foreground 'diff-changed "purple")) (eval-after-load "diff-mode" '(update-diff-colors)) + +;; (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. +;; '(ansi-color-names-vector +;; ["#171717" "#E2434C" "#86B187" "#E0D063" "#8AC6F2" "#E18Cbb" "cyan" "#F6F3E8"] +;; (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/lisp/glauce-mode.el b/lisp/glauce-mode.el index 8607db4..4e653a0 100644 --- a/lisp/glauce-mode.el +++ b/lisp/glauce-mode.el @@ -65,3 +65,4 @@ (run-hooks 'glauce-mode-hook)) (provide 'glauce-mode) +;;; glauce-mode.el ends here diff --git a/neon-badger-theme.el b/neon-badger-theme.el new file mode 100644 index 0000000..c0b0966 --- /dev/null +++ b/neon-badger-theme.el @@ -0,0 +1,227 @@ +;;; neon-badger-theme.el --- inspired by original badger theme -*- lexical-binding: t; no-byte-compile: t; -*- +(require 'doom-themes) + +;; +(defgroup neon-badger-theme nil + "Options for the `neon-badger' theme." + :group 'doom-themes) + +(defcustom neon-badger-brighter-modeline nil + "If non-nil, more vivid colors will be used to style the mode-line." + :group 'neon-badger-theme + :type 'boolean) + +(defcustom neon-badger-brighter-comments nil + "If non-nil, comments will be highlighted in more vivid colors." + :group 'neon-badger-theme + :type 'boolean) + +(defcustom neon-badger-comment-bg neon-badger-brighter-comments + "If non-nil, comments will have a subtle, darker background. Enhancing their +legibility." + :group 'neon-badger-theme + :type 'boolean) + +(defcustom neon-badger-padded-modeline doom-themes-padded-modeline + "If non-nil, adds a 4px padding to the mode-line. Can be an integer to +determine the exact padding." + :group 'neon-badger-theme + :type '(choice integer boolean)) + +;; +(def-doom-theme neon-badger + "A dark theme inspired by original badger theme" + + ;; name default 256 16 + ((bg '("#171717" nil nil )) ;; badger-bg + (bg-alt '("#2f2f2f" nil nil )) ;; badger-bg+1 + (base0 '("#1D1D1D" "black" "black" )) ;; badger-hl + (base1 '("#1c1f24" "#1e1e1e" "brightblack" )) ;; + (base2 '("#202328" "#2e2e2e" "brightblack" )) ;; + (base3 '("#23272e" "#262626" "brightblack" )) ;; + (base4 '("#433F4f" "#3f3f3f" "brightblack" )) ;; + (base5 '("#635770" "#525252" "brightblack" )) ;; + (base6 '("#656868" "#6b6b6b" "brightblack" )) ;; badger-charcoal + (base7 '("#9ca0a4" "#979797" "brightblack" )) ;; + (base8 '("#DFDFDF" "#dfdfdf" "white" )) ;; + (fg '("#F6F3E8" "#bfbfbf" "brightwhite" )) ;; badger-fg + (fg-alt '("#FBF9F3" "#2d2d2d" "white" )) ;; badger-fg+1 + + (grey base4) + (red '("#E2434C" "#ff6655" "red" )) ;; badger-red + (orange '("#EA9847" "#dd8844" "brightred" )) ;; badger-orange + (green '("#86B187" "#99bb66" "green" )) ;; badger-green + (teal '("#65A399" "#44b9b1" "brightgreen" )) ;; badger-teal + (yellow '("#E0D063" "#ECBE7B" "yellow" )) ;; badger-yellow + (blue '("#8AC6F2" "#51afef" "brightblue" )) ;; badger-blue + (dark-blue '("#2257A0" "#2257A0" "blue" )) ;; + (magenta '("#E18Cbb" "#c678dd" "brightmagenta")) ;; badger-pink + (violet '("#BF93C3" "#a9a1e1" "magenta" )) ;; badger-violet + (cyan '("cyan" "#46D9FF" "brightcyan" )) ;; badger-succ + (dark-cyan '("#5699AF" "#5699AF" "cyan" )) ;; + + ;; Custom + (olive '("#9AA68E")) ;; badger-olice + (lime '("#84C452")) ;; badger-lime + (link '("#8ACDAA")) ;; badger-link + (dull-red '("#A55662")) ;; badger-dull-red + (brown '("#AC8952")) ;; badger-brown + (sand '("#C7B299")) ;; badger-sand + (salmon '("#F28B86")) ;; badger-salmon + (dark-violet '("#635770")) ;; badger-dark-violet + ;; (darker-violet '("#433F4F")) ;; badger-darker-violet + ;(dull-pink '("#C37990")) ;; + (dull-pink '("#C37985")) ;; + + ;; face categories -- required for all themes + (highlight blue) + (vertical-bar (doom-darken base4 0.1)) + (selection dark-blue) + (builtin salmon) + (comments (if neon-badger-brighter-comments base7 base6)) + (doc-comments (doom-lighten (if neon-badger-brighter-comments base7 base6) 0.25)) + ;(constants dark-violet) + (constants dull-pink) + (functions orange) + (keywords blue) + (methods cyan) + (operators sand) + (type sand) + (strings green) + (variables violet) + (numbers fg) + (region `(,(doom-lighten (car bg-alt) 0.1) ,@(doom-lighten (cdr base0) 0.1))) + (error red) + (warning yellow) + (success green) + (vc-modified orange) + (vc-added green) + (vc-deleted red) + + ;; custom categories + (hidden `(,(car bg) "black" "black")) + (-modeline-bright neon-badger-brighter-modeline) + (-modeline-pad + (when neon-badger-padded-modeline + (if (integerp neon-badger-padded-modeline) neon-badger-padded-modeline 4))) + + (modeline-fg fg) + (modeline-fg-alt base5) + + (modeline-bg + (if -modeline-bright + (doom-darken blue 0.475) + `(,(doom-darken (car bg-alt) 0.15) ,@(cdr base0)))) + (modeline-bg-l + (if -modeline-bright + (doom-darken blue 0.45) + `(,(doom-darken (car bg-alt) 0.1) ,@(cdr base0)))) + (modeline-bg-inactive `(,(doom-darken (car bg-alt) 0.1) ,@(cdr bg-alt))) + (modeline-bg-inactive-l `(,(car bg-alt) ,@(cdr base1)))) + + + ;;;; Base theme face overrides + (((font-lock-comment-face &override) + ((line-number &override) :foreground base6) + ((line-number-current-line &override) :foreground fg) + :background (if neon-badger-comment-bg (doom-lighten bg 0.05))) + (mode-line + :background modeline-bg :foreground modeline-fg + :box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg))) + (mode-line-inactive + :background modeline-bg-inactive :foreground modeline-fg-alt + :box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive))) + (mode-line-emphasis + :foreground (if -modeline-bright base8 highlight)) + + ;;;; centaur tabs + (centaur-tabs-selected-modified :background bg :foreground yellow) + (centaur-tabs-unselected-modified :background bg-alt :foreground yellow) + ;;;; css-mode / scss-mode + (css-proprietary-property :foreground orange) + (css-property :foreground green) + (css-selector :foreground blue) + ;;;; doom-modeline + (doom-modeline-bar :background (if -modeline-bright modeline-bg highlight)) + (doom-modeline-buffer-file :inherit 'mode-line-buffer-id :weight 'bold) + (doom-modeline-buffer-path :inherit 'mode-line-emphasis :weight 'bold) + (doom-modeline-buffer-project-root :foreground green :weight 'bold) + ;;;; elscreen + (elscreen-tab-other-screen-face :background "#353a42" :foreground "#1e2022") + ;;;; ivy + (ivy-current-match :background dark-blue :distant-foreground base0 :weight 'normal) + ;;;; linum + (linum :foreground base6 :background base6) + ;;;; markdown-mode + (markdown-markup-face :foreground base5) + (markdown-header-face :inherit 'bold :foreground red) + ((markdown-code-face &override) :background (doom-lighten base3 0.05)) + ;;;; org + (org-agenda-date :foreground blue) + (org-agenda-date-today :foreground salmon :weight 'light :slant 'italic) + (org-agenda-structure :inherit font-lock-comment-face) + (org-archived :foreground fg :weight 'bold) + ((org-code &override) :foreground olive) + (org-column :background "black") + (org-column-title :background "black" :foreground lime :underline t) + (org-date :foreground link :underline t) + (org-deadline-announce :foreground dull-red) + (org-document-info-keyword :foreground olive) + (org-document-title :foreground salmon :height 1.50) + (org-done :foreground lime :strike-through t) + (org-footnote :foreground link :underline t) + (org-formula :foreground violet) + (org-headline-done :strike-through t :foreground base6) + (org-hide :foreground bg) + (org-hide :foreground hidden) + (org-level-1 :foreground blue) + (org-level-2 :foreground violet) + (org-level-3 :foreground orange) + (org-level-4 :foreground yellow) + (org-level-5 :foreground salmon) + (org-level-6 :foreground green) + (org-level-7 :foreground brown) + (org-level-8 :foreground teal) + (org-link :foreground link :underline t) + (org-mode-line-clock :foreground yellow) + (org-special-keyword :foreground olive :weight 'normal) + (org-table :foreground olive) + (org-tag :bold t :foreground orange :strike-through nil) + (org-todo :foreground red) + (org-verbatim :inherit 'org-code) + (org-warning :bold t :foreground magenta :weight 'bold) + ;;;; popup + (popup-tip-face :background sand :foreground "black") + (popup-scroll-bar-foreground-face :background dark-violet) + (popup-scroll-bar-background-face :background olive) + (popup-isearch-match :background yellow :foreground "black") + ;;;; solaire-mode + (solaire-mode-line-face + :inherit 'mode-line + :background modeline-bg-l + :box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-l))) + (solaire-mode-line-inactive-face + :inherit 'mode-line-inactive + :background modeline-bg-inactive-l + :box (if -modeline-pad `(:line-width ,-modeline-pad :color ,modeline-bg-inactive-l))) + ;;;; treemacs + (treemacs-directory-face :foreground base6) + (treemacs-git-modified-face :foreground yellow) + (treemacs-file-face :foreground base8) + (treemacs-root-face :foreground blue :weight 'bold) + (doom-themes-treemacs-file-face :foreground blue) + ;;;; web-mode + (web-mode-block-control-face :foreground orange) + (web-mode-block-delimiter-face :foreground sand) + (web-mode-html-attr-equal-face :foreground fg) + (web-mode-html-attr-name-face :foreground base8) + (web-mode-html-tag-bracket-face :foreground sand) + (web-mode-html-tag-face :foreground blue) + (web-mode-keyword-face :foreground blue) + (web-mode-variable-name-face :foreground (doom-lighten constants 0.3))) + + ;;;; Base theme variable overrides- + () + ) + +;;; neon-badger-theme.el ends here