diff --git a/.config/alacritty/spacemacs.yml b/.config/alacritty/spacemacs.yml index 0d8b7bd..a426377 100644 --- a/.config/alacritty/spacemacs.yml +++ b/.config/alacritty/spacemacs.yml @@ -1,16 +1,9 @@ -# Base16 Spacemacs 256 - alacritty color config -# Nasser Alshammari (https://github.com/nashamri/spacemacs-theme) colors: # Default colors primary: - background: '0x1f2022' + background: '0x0b0c0d' foreground: '0xa3a3a3' - # Colors the cursor will use if `custom_cursor_colors` is true - cursor: - text: '0x1f2022' - cursor: '0xa3a3a3' - # Normal colors normal: black: '0x1f2022' @@ -33,10 +26,3 @@ colors: cyan: '0x2d9574' white: '0xf8f8f8' - indexed_colors: - - { index: 16, color: '0xffa500' } - - { index: 17, color: '0xb03060' } - - { index: 18, color: '0x282828' } - - { index: 19, color: '0x444155' } - - { index: 20, color: '0xb8b8b8' } - - { index: 21, color: '0xe8e8e8' } diff --git a/.config/alacritty/spacemacs2.yml b/.config/alacritty/spacemacs2.yml new file mode 100644 index 0000000..0d8b7bd --- /dev/null +++ b/.config/alacritty/spacemacs2.yml @@ -0,0 +1,42 @@ +# Base16 Spacemacs 256 - alacritty color config +# Nasser Alshammari (https://github.com/nashamri/spacemacs-theme) +colors: + # Default colors + primary: + background: '0x1f2022' + foreground: '0xa3a3a3' + + # Colors the cursor will use if `custom_cursor_colors` is true + cursor: + text: '0x1f2022' + cursor: '0xa3a3a3' + + # Normal colors + normal: + black: '0x1f2022' + red: '0xf2241f' + green: '0x67b11d' + yellow: '0xb1951d' + blue: '0x4f97d7' + magenta: '0xa31db1' + cyan: '0x2d9574' + white: '0xa3a3a3' + + # Bright colors + bright: + black: '0x585858' + red: '0xf2241f' + green: '0x67b11d' + yellow: '0xb1951d' + blue: '0x4f97d7' + magenta: '0xa31db1' + cyan: '0x2d9574' + white: '0xf8f8f8' + + indexed_colors: + - { index: 16, color: '0xffa500' } + - { index: 17, color: '0xb03060' } + - { index: 18, color: '0x282828' } + - { index: 19, color: '0x444155' } + - { index: 20, color: '0xb8b8b8' } + - { index: 21, color: '0xe8e8e8' } diff --git a/.config/doom/config.el b/.config/doom/config.el index cee2f0d..d31f2f8 100644 --- a/.config/doom/config.el +++ b/.config/doom/config.el @@ -3,325 +3,22 @@ ;; Place your private configuration here! Remember, you do not need to run 'doom ;; sync' after modifying this file! -(require 'site-gentoo) -(require-theme 'spacemacs-theme) - ;; Some functionality uses this to identify you, e.g. GPG configuration, email ;; clients, file templates and snippets. It is optional. -;; (load-theme 'spamcemacs-dark t) -;; (use-package spacemacs-theme -;; :config -;; (load-theme 'spacemacs-dark t)) (setq user-full-name (getenv "CONFIG_FULL_NAME") user-mail-address (getenv "CONFIG_EMAIL_ADDRESS")) -(setq doom-font (font-spec :family "JetBrains Mono Nerd Font" :size 14 :weight 'semibold) - doom-big-font (font-spec :family "JetBrains Mono Nerd Font" :size 28 :weight 'bold) - doom-serif-font (font-spec :family "JetBrains Mono Nerd Font" :size 14 :weight 'bold)) -;; (setq doom-font "JetBrains Mono Nerd Font") -;; Doom exposes five (optional) variables for controlling fonts in Doom: -;; -;; - `doom-font' -- the primary font to use -;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) -;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for -;; presentations or streaming. -;; - `doom-unicode-font' -- for unicode glyphs -;; - `doom-serif-font' -- for the `fixed-pitch-serif' face -;; -;; See 'C-h v doom-font' for documentation and more examples of what they -;; accept. For example: -;; -;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light) -;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) -;; -;; If you or Emacs can't find your font, use 'M-x describe-font' to look them -;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to -;; refresh your font settings. If Emacs still can't find your font, it likely -;; wasn't installed correctly. Font issues are rarely Doom issues! - -;; 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. This is the default: -(setq doom-theme 'spacemacs-dark) -;; (use-package spacemacs-theme-dark -;; :ensure t -;; :config -;; (load-theme 'spacemacs-dark-theme t)) -;; This determines the style of line numbers in effect. If set to `nil', line -;; numbers are disabled. For relative line numbers, set this to `relative'. -(setq display-line-numbers-type t) - -;; If you use `org' and don't want your org files in the default location below, -;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/org/") -(setq projectile-project-search-path '("~/Projects/")) - -;; Whenever you reconfigure a package, make sure to wrap your config in an -;; `after!' block, otherwise Doom's defaults may override your settings. E.g. -;; -;; (after! PACKAGE -;; (setq x y)) -;; -;; The exceptions to this rule: -;; -;; - Setting file/directory variables (like `org-directory') -;; - Setting variables which explicitly tell you to set them before their -;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). -;; - Setting doom variables (which start with 'doom-' or '+'). -;; -;; Here are some additional functions/macros that will 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', relative to -;; this file. Emacs searches the `load-path' 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 c k'). -;; This will open documentation for it, including demos of how they are used. -;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, -;; etc). -;; -;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how -;; they are implemented. -(require 'ansi-color) -(require 'dap-cpptools) -(require 'helm-make) -;; Indenting, formatting, etc -;; Universal (all langs) -(map! :leader - :desc "Comment/Uncomment" - "/" #'comment-line) -(map! :leader - :desc "Search project for text" - "s /" #'+default/search-project) -(with-eval-after-load 'evil - (map! - (:prefix "g" - :desc "New line after comment block" :n "o" #'+default/newline-below))) -(with-eval-after-load 'evil - (map! - (:prefix "g" - :desc "New line after comment block" :n "O" #'+default/newline-above))) -;; C/C++ -(c-add-style "penguin" - '("stroustrup" - (c-offsets-alist - (innamespace . -) - (inline-open . 0) - (inher-cont . c-lineup-multi-inher) - (arglist-cont-nonempty . +) - (template-args-cont . +)))) - -(defun penguin-c-hook() - (setq +format-with-lsp nil) - (map! - :leader - :prefix "p" - :desc "Compile project" :n "c" #'helm-make-projectile) - (map! - :leader - :prefix "c" - :desc "Compile project" :n "c" #'helm-make-projectile) - (map! - :leader - :prefix "c" - :desc "List project errors" :n "x" #'lsp-treemacs-errors-list) - (c-set-style "penguin") - (c-set-offset 'case-label '+) - (c-set-offset 'arglist-intro '+) - (setq lsp-headerline-breadcrumb-enable 't)) -(add-hook 'c-mode-hook 'penguin-c-hook) -(add-hook 'c++-mode-hook 'penguin-c-hook) -(add-hook 'after-change-major-mode-hook - (lambda () - (modify-syntax-entry ?_ "w"))) - -;; Markdown -(add-hook 'text-mode-hook - #'(lambda () - (setq indent-tabs-mode nil) - (setq tab-width 4))) -;; Rust -(after! rustic - (setq lsp-rust-server 'rust-analyzer)) -(setq lsp-rust-analyzer-cargo-watch-command "clippy") -(setq lsp-eldoc-render-all t) -(setq lsp-idle-delay 0.6) -(setq lsp-rust-analyzer-server-display-inlay-hints t) -(setq lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial") -(setq lsp-rust-analyzer-display-chaining-hints t) -(setq lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil) -(setq lsp-rust-analyzer-display-closure-return-type-hints t) -(setq lsp-rust-analyzer-display-parameter-hints nil) -(setq lsp-rust-analyzer-display-reborrow-hints nil) - -(setq dap-auto-configure-mode t) -(map! :map dap-mode-map - :leader - :prefix ("d" . "dap") - ;; basics - :desc "dap next" "n" #'dap-next - :desc "dap step in" "i" #'dap-step-in - :desc "dap step out" "o" #'dap-step-out - :desc "dap continue" "c" #'dap-continue - :desc "dap hydra" "h" #'dap-hydra - :desc "dap debug restart" "r" #'dap-debug-restart - :desc "dap debug" "s" #'dap-debug - - ;; debug - :prefix ("dd" . "Debug") - :desc "dap debug recent" "r" #'dap-debug-recent - :desc "dap debug last" "l" #'dap-debug-last - - ;; eval - :prefix ("de" . "Eval") - :desc "eval" "e" #'dap-eval - :desc "eval region" "r" #'dap-eval-region - :desc "eval thing at point" "s" #'dap-eval-thing-at-point - :desc "add expression" "a" #'dap-ui-expressions-add - :desc "remove expression" "d" #'dap-ui-expressions-remove - - :prefix ("db" . "Breakpoint") - :desc "dap breakpoint toggle" "b" #'dap-breakpoint-toggle - :desc "dap breakpoint condition" "c" #'dap-breakpoint-condition - :desc "dap breakpoint hit count" "h" #'dap-breakpoint-hit-condition - :desc "dap breakpoint log message" "l" #'dap-breakpoint-log-message) - -(after! org - (setq org-todo-keywords - '((sequence "TODO(t)" "PROJ(p)" "BLOCKED(b)" "WIP(w)" "|" "KILL(k)" "DONE(d)")))) - -(setq x-super-keysym 'meta) -(defhydra doom-window-resize-hydra (:hint nil) - " - _k_ increase height __ increase height -_h_ decrease width _l_ increase width __ decrease width __ increase width - _j_ decrease height __ decrease height - S-arrow key to shift by 5 -" - ("h" evil-window-decrease-width) - ("j" evil-window-increase-height) - ("k" evil-window-decrease-height) - ("l" evil-window-increase-width) - ("" evil-window-decrease-width) - ("" evil-window-increase-height) - ("" evil-window-decrease-height) - ("" evil-window-increase-width) - ("" (evil-window-decrease-width 20)) - ("" (evil-window-increase-height 20)) - ("" (evil-window-decrease-height 20)) - ("" (evil-window-increase-width 20)) - - ("q" nil)) -(map! - (:leader - :prefix "w" - :desc "Hydra resize" :n "SPC" #'doom-window-resize-hydra/body)) -;; (map! :leader -;; "f p" nil -;; "f P" nil) -(map! - :leader - :prefix "f" - :desc "Open doom config" "p" #'doom/open-private-config) -(setq evil-split-window-below t) - - -(defun penguin-helm-posframe-size-function () - "The default functon used by `helm-posframe-size-function'." - (list - :width (/ (frame-width) 2) - :height (or helm-posframe-height helm-display-buffer-height) - :min-height (or helm-posframe-min-height - (let ((height (+ helm-display-buffer-height 1))) - (min height (or helm-posframe-height height)))) - :min-width (or helm-posframe-min-width - (let ((width (round (* (frame-width) 0.62)))) - (min width (or helm-posframe-width width)))))) - -(setq helm-posframe-size-function #'penguin-helm-posframe-size-function) -(defun penguin-reload-dir-locals-for-current-buffer () - "reload dir locals for the current buffer" - (interactive) - (let ((enable-local-variables :all)) - (hack-dir-local-variables-non-file-buffer))) -(defun penguin-reload-dir-locals-for-all-buffer-in-this-directory () - "For every buffer with the same `default-directory` as the -current buffer's, reload dir-locals." - (interactive) - (let ((dir default-directory)) - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (when (equal default-directory dir) - (penguin-reload-dir-locals-for-current-buffer)))))) -;; fix compilation buffer error which wouldn't let me jump to errors -(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) -(setq-default evil-kill-on-visual-paste nil) -(setq lsp-treemacs-sync-mode 1) -(defun apply-lang-settings-to-open-buffers () - "Apply C++ mode settings to open buffers." - (interactive) - (dolist (buffer (buffer-list)) - (with-current-buffer buffer - (when (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode)) - (penguin-c-hook))))) -(add-hook! 'doom-after-reload-hook #'apply-lang-settings-to-open-buffers) - -(setq org-noter-notes-search-path '("~/Documents/notes/")) -;; (setq lsp-clangd-binary-path '("/usr/bin/clangd")) -(defun wvxvw/export-rel-url (path desc format) - (cl-case format - (html (format "%s" path (or desc path))) - (latex (format "\\href{%s}{%s}" path (or desc path))) - (otherwise path))) - -(eval-after-load "org" - '(org-link-set-parameters "rel" :follow #'browse-url :export #'wvxvw/export-rel-url)) - - -(setq projectile-enable-caching nil) -(setq find-file-hook nil) - -;; kill company completion -(with-eval-after-load 'company - (define-key company-active-map (kbd "C-k") 'company-abort)) - -(after! org - (setq org-agenda-files - '("~/Documents/notes/agendas"))) - -(after! company - (set-company-backend! - 'emacs-lisp-mode - '(:separate - company-capf company-files)) - (set-company-backend! - 'sh-mode - '(:separate - company-capf company-shell company-files)) -) - -(after! org - (set-company-backend! - 'org-mode - 'company-capf 'company-files)) - - -(map! - (:leader - :prefix "o" - :desc "Calendar" :n "c" #'cfw:open-org-calendar)) -(add-hook 'calendar-load-hook - (lambda () - (calendar-set-date-style 'american))) -(setq calendar-holidays - (append holiday-general-holidays holiday-local-holidays - holiday-other-holidays - holiday-solar-holidays)) +(unless 'display-graphic-p + (setq confirm-kill-emacs nil)) -(setq calendar-christian-all-holidays-flag 't) +(load! "penguin/appearance.el") +(load! "penguin/lang.el") +(load! "penguin/keybinds.el") +(load! "penguin/org.el") +(load! "penguin/project.el") +(load! "penguin/debug.el") +(load! "penguin/calendar.el") +(load! "penguin/completions.el") +(load! "penguin/misc.el") +(load! "penguin/local.el") diff --git a/.config/doom/init.el b/.config/doom/init.el index 43aef85..224577d 100644 --- a/.config/doom/init.el +++ b/.config/doom/init.el @@ -22,7 +22,7 @@ :completion company ; the ultimate code completion backend - (helm +childframe +fuzzy +icons) ; the *other* search engine for love and life + (helm +fuzzy +icons) ; the *other* search engine for love and life ;;ido ; the other *other* search engine... ;; ivy ; a search engine for love and life ;;vertico ; the search engine of the future @@ -31,7 +31,7 @@ ;;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 + ;; doom-quit ; DOOM quit-message prompts when you quit Emacs (emoji +unicode) ; 🙂 hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW hydra @@ -43,8 +43,8 @@ ;;neotree ; a project drawer, like NERDTree for vim ophints ; highlight the region an operation acts on (popup +all +defaults) ; tame sudden yet inevitable temporary windows - ;;tabs ; a tab bar for Emacs - treemacs ; a project drawer, like neotree but cooler + tabs ; a tab bar for Emacs + (treemacs +lsp) ; a project drawer, like neotree but cooler ;;unicode ; extended unicode support for various languages (vc-gutter +pretty) ; vcs diff in the fringe vi-tilde-fringe ; fringe tildes to mark beyond EOB @@ -76,7 +76,7 @@ :term ;;eshell ; the elisp shell that works everywhere ;;shell ; simple shell REPL for Emacs - ;;term ; basic terminal emulator for Emacs + ;term ; basic terminal emulator for Emacs (vterm +toggle) ; the best terminal emulation in Emacs :checkers @@ -99,18 +99,18 @@ magit ; a git porcelain for Emacs make ; run make tasks from Emacs ;;pass ; password manager for nerds - ;;pdf ; pdf enhancements + pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders ;;rgb ; creating color strings - ;;taskrunner ; taskrunner for all your projects + taskrunner ; taskrunner for all your projects ;;terraform ; infrastructure as code - ;;tmux ; an API for interacting with tmux + tmux ; an API for interacting with tmux tree-sitter ; syntax and parsing, sitting in a tree... upload ; map local to remote projects via ssh/ftp :os (:if IS-MAC macos) ; improve compatibility with macOS - ;;tty ; improve the terminal Emacs experience + tty ; improve the terminal Emacs experience :lang ;;agda ; types of types of types of types... @@ -121,21 +121,21 @@ ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - ;;data ; config/data formats + data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;dhall ;;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 + ess ; emacs speaks statistics ;;factor ;;faust ; dsp, but you get to keep your soul ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) ;;fsharp ; ML stands for Microsoft's Language ;;fstar ; (dependent) types and (monadic) effects and Z3 ;;gdscript ; the language you waited for - ;;(go +lsp) ; the hipster dialect + ;; (go +lsp) ; the hipster dialect ;;(graphql +lsp) ; Give queries a REST ;;(haskell +lsp) ; a language that's lazier than I am ;;hy ; readability of scheme w/ speed of python @@ -143,9 +143,9 @@ ;;json ; At least it ain't XML ;;(java +lsp) ; the poster child for carpal tunnel syndrome ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) - julia ; a better, faster MATLAB + julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) - ;;latex ; writing papers in Emacs has never been so fun + latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove ;;ledger ; be audit you can be lua ; one-based indices? one-based indices @@ -153,11 +153,11 @@ ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - (org +dragndrop +pandoc) ; organize your plain life in plain text + (org +dragndrop +pandoc +roam2 +gnuplot +pretty +journal) ; organize your plain life in plain text ;;php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - python ; beautiful is better than ugly + (python +lsp +tree-sitter +pyright) ; beautiful is better than ugly qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 @@ -186,7 +186,7 @@ ;;emms ;;everywhere ; *leave* Emacs!? You must be joking irc ; how neckbeards socialize - ;;(rss +org) ; emacs as an RSS reader + (rss +org) ; emacs as an RSS reader ;;twitter ; twitter client https://twitter.com/vnought :config diff --git a/.config/doom/packages.el b/.config/doom/packages.el index 50a26da..1974773 100644 --- a/.config/doom/packages.el +++ b/.config/doom/packages.el @@ -7,50 +7,54 @@ ;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: -;(package! some-package) + ;(package! some-package) ;; To install a package directly from a remote git repo, you must specify a ;; `:recipe'. You'll find documentation on what `:recipe' accepts here: ;; https://github.com/radian-software/straight.el#the-recipe-format -;(package! another-package -; :recipe (:host github :repo "username/repo")) + ;(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"))) + ;(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, you can do so here ;; with the `:disable' property: -;(package! builtin-package :disable t) + ;(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")) + ;(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 radian-software/straight.el#279) -;(package! builtin-package :recipe (:branch "develop")) + ;(package! builtin-package :recipe (:branch "develop")) ;; Use `:pin' to specify a particular commit to install. -;(package! builtin-package :pin "1a2b3c4d5e") + ;(package! builtin-package :pin "1a2b3c4d5e") ;; Doom's packages are pinned to a specific commit and updated from release to ;; release. The `unpin!' macro allows you to unpin single packages... -;(unpin! pinned-package) + ;(unpin! pinned-package) ;; ...or multiple packages -;(unpin! pinned-package another-pinned-package) + ;(unpin! pinned-package another-pinned-package) ;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) -;(unpin! t) -(package! spacemacs-theme :built-in 'prefer) +;; (unpin! t) (package! helm-icons) (package! helm-company) (package! helm-make) (package! impatient-mode) -;; (package! spacemacs-theme) +(package! vterm) +(package! multi-vterm) +(package! treemacs-projectile) +(package! evil-terminal-cursor-changer) +(package! dpaste) +(load (expand-file-name "~/.local/share/doom/packages.el")) diff --git a/.config/doom/penguin/appearance.el b/.config/doom/penguin/appearance.el new file mode 100644 index 0000000..587a0b3 --- /dev/null +++ b/.config/doom/penguin/appearance.el @@ -0,0 +1,84 @@ +;;; $DOOMDIR/penguin/appearance.el -*- lexical-binding: t; -*- + + +;; (load-theme 'spamcemacs-dark t) +;; (use-package spacemacs-theme +;; :config +;; (load-theme 'spacemacs-dark t)) + +(setq doom-font (font-spec :family "JetBrains Mono Nerd Font" :size 14 :weight 'semibold) + doom-big-font (font-spec :family "JetBrains Mono Nerd Font" :size 28 :weight 'bold) + doom-serif-font (font-spec :family "JetBrains Mono Nerd Font" :size 14 :weight 'bold)) +;; (setq doom-font "JetBrains Mono Nerd Font") +;; Doom exposes five (optional) variables for controlling fonts in Doom: +;; +;; - `doom-font' -- the primary font to use +;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) +;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; - `doom-unicode-font' -- for unicode glyphs +;; - `doom-serif-font' -- for the `fixed-pitch-serif' face +;; +;; See 'C-h v doom-font' for documentation and more examples of what they +;; accept. For example: +;; +;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light) +;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) +;; +;; If you or Emacs can't find your font, use 'M-x describe-font' to look them +;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to +;; refresh your font settings. If Emacs still can't find your font, it likely +;; wasn't installed correctly. Font issues are rarely Doom issues! + +;; 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. This is the default: +(setq doom-theme 'spacemacs-dark) +;; (use-package spacemacs-theme-dark +;; :ensure t +;; :config +;; (load-theme 'spacemacs-dark-theme t)) +;; This determines the style of line numbers in effect. If set to `nil', line +;; numbers are disabled. For relative line numbers, set this to `relative'. +(setq display-line-numbers-type t) +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +;; Whenever you reconfigure a package, make sure to wrap your config in an +;; `after!' block, otherwise Doom's defaults may override your settings. E.g. +;; +;; (after! PACKAGE +;; (setq x y)) +;; +;; The exceptions to this rule: +;; +;; - Setting file/directory variables (like `org-directory') +;; - Setting variables which explicitly tell you to set them before their +;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). +;; - Setting doom variables (which start with 'doom-' or '+'). +;; +;; Here are some additional functions/macros that will 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', relative to +;; this file. Emacs searches the `load-path' 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 c k'). +;; This will open documentation for it, including demos of how they are used. +;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, +;; etc). +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. + +;; $EMACS_SPLASH_IMAGE should be defined as an absolute path as an environment variable. I define this in my ~/.localrc +(setq fancy-splash-image (getenv "CONFIG_EMACS_SPLASH")) +(setq centaur-tabs-style "wave") +(setq centaur-tabs-set-bar 'under) + +(use-package! evil-terminal-cursor-changer + :hook (tty-setup . evil-terminal-cursor-changer-activate)) diff --git a/.config/doom/penguin/calendar.el b/.config/doom/penguin/calendar.el new file mode 100644 index 0000000..a47b88a --- /dev/null +++ b/.config/doom/penguin/calendar.el @@ -0,0 +1,12 @@ +;;; $DOOMDIR/penguin/calendar.el -*- lexical-binding: t; -*- + +(add-hook 'calendar-load-hook + (lambda () + (calendar-set-date-style 'american))) + +(setq calendar-holidays + (append holiday-general-holidays holiday-local-holidays + holiday-other-holidays + holiday-solar-holidays)) + +(setq calendar-christian-all-holidays-flag 't) diff --git a/.config/doom/penguin/completions.el b/.config/doom/penguin/completions.el new file mode 100644 index 0000000..5d0b464 --- /dev/null +++ b/.config/doom/penguin/completions.el @@ -0,0 +1,35 @@ +;;; $DOOMDIR/penguin/completions.el -*- lexical-binding: t; -*- + + +(require 'helm-make) +(require 'ansi-color) + +(setq helm-make-list-target-method 'qp) + +;; Stopped using this and posframe because it breaks tty emacs +;; (defun penguin-helm-posframe-size-function () +;; "The default functon used by `helm-posframe-size-function'." +;; (list +;; :width (/ (frame-width) 2) +;; :height (or helm-posframe-height helm-display-buffer-height) +;; :min-height (or helm-posframe-min-height +;; (let ((height (+ helm-display-buffer-height 1))) +;; (min height (or helm-posframe-height height)))) +;; :min-width (or helm-posframe-min-width +;; (let ((width (round (* (frame-width) 0.62)))) +;; (min width (or helm-posframe-width width)))))) + +;; (setq helm-posframe-size-function #'penguin-helm-posframe-size-function) + +(after! company + (set-company-backend! + 'emacs-lisp-mode + '(:separate + company-capf company-files)) + (set-company-backend! + 'sh-mode + '(:separate + company-capf company-shell company-files))) + +;; fix compilation buffer error which wouldn't let me jump to errors +(add-hook 'compilation-filter-hook 'ansi-color-compilation-filter) diff --git a/.config/doom/penguin/debug.el b/.config/doom/penguin/debug.el new file mode 100644 index 0000000..380007c --- /dev/null +++ b/.config/doom/penguin/debug.el @@ -0,0 +1,4 @@ +;;; $DOOMDIR/penguin/debug.el -*- lexical-binding: t; -*- + +(require 'dap-cpptools) +(setq dap-auto-configure-mode t) diff --git a/.config/doom/penguin/keybinds.el b/.config/doom/penguin/keybinds.el new file mode 100644 index 0000000..9190ad4 --- /dev/null +++ b/.config/doom/penguin/keybinds.el @@ -0,0 +1,99 @@ +;;; $DOOMDIR/penguin/keybinds.el -*- lexical-binding: t; -*- + +(map! :leader + :desc "Comment/Uncomment" + "/" #'comment-line) +(map! :leader + :desc "Search project for text" + "s /" #'+default/search-project) +(with-eval-after-load 'evil + (map! + (:prefix "g" + :desc "New line after comment block" :n "o" #'+default/newline-below))) +(with-eval-after-load 'evil + (map! + (:prefix "g" + :desc "New line after comment block" :n "O" #'+default/newline-above))) +(defhydra doom-window-resize-hydra (:hint nil) + " + _k_ increase height __ increase height +_h_ decrease width _l_ increase width __ decrease width __ increase width + _j_ decrease height __ decrease height + S-arrow key to shift by 5 +" + ("h" evil-window-decrease-width) + ("j" evil-window-increase-height) + ("k" evil-window-decrease-height) + ("l" evil-window-increase-width) + ("" evil-window-decrease-width) + ("" evil-window-increase-height) + ("" evil-window-decrease-height) + ("" evil-window-increase-width) + ("" (evil-window-decrease-width 20)) + ("" (evil-window-increase-height 20)) + ("" (evil-window-decrease-height 20)) + ("" (evil-window-increase-width 20)) + + ("q" nil)) +(map! + (:leader + :prefix "w" + :desc "Hydra resize" :n "SPC" #'doom-window-resize-hydra/body)) +;; (map! :leader +;; "f p" nil +;; "f P" nil) +(map! + :leader + :prefix "f" + :desc "Open doom config" "p" #'doom/open-private-config) +(map! + :leader + :prefix "w" + :desc "Jump to window" "a" #'ace-window) + +(map! + (:leader + :prefix "o" + :desc "Calendar" :n "c" #'cfw:open-org-calendar)) + +(map! :map dap-mode-map + :leader + :prefix ("d" . "dap") + ;; basics + :desc "dap next" "n" #'dap-next + :desc "dap step in" "i" #'dap-step-in + :desc "dap step out" "o" #'dap-step-out + :desc "dap continue" "c" #'dap-continue + :desc "dap hydra" "h" #'dap-hydra + :desc "dap debug restart" "r" #'dap-debug-restart + :desc "dap debug" "s" #'dap-debug + + ;; debug + :prefix ("dd" . "Debug") + :desc "dap debug recent" "r" #'dap-debug-recent + :desc "dap debug last" "l" #'dap-debug-last + + ;; eval + :prefix ("de" . "Eval") + :desc "eval" "e" #'dap-eval + :desc "eval region" "r" #'dap-eval-region + :desc "eval thing at point" "s" #'dap-eval-thing-at-point + :desc "add expression" "a" #'dap-ui-expressions-add + :desc "remove expression" "d" #'dap-ui-expressions-remove + + :prefix ("db" . "Breakpoint") + :desc "dap breakpoint toggle" "b" #'dap-breakpoint-toggle + :desc "dap breakpoint condition" "c" #'dap-breakpoint-condition + :desc "dap breakpoint hit count" "h" #'dap-breakpoint-hit-condition + :desc "dap breakpoint log message" "l" #'dap-breakpoint-log-message) + +(after! centaur-tabs + (map! + (:leader + :desc "Jump to tab" :n "j" #'centaur-tabs-ace-jump)) + (centaur-tabs-group-by-projectile-project) + (centaur-tabs-group-buffer-groups)) + +;; kill company completion +(with-eval-after-load 'company + (define-key company-active-map (kbd "C-k") 'company-abort)) diff --git a/.config/doom/penguin/lang.el b/.config/doom/penguin/lang.el new file mode 100644 index 0000000..74594aa --- /dev/null +++ b/.config/doom/penguin/lang.el @@ -0,0 +1,100 @@ +;;; $DOOMDIR/penguin/lang.el -*- lexical-binding: t; -*- + +(require 'impatient-mode) +;; Indenting, formatting, etc +;; Universal (all langs) +;; C/C++ +(c-add-style "penguin" + '("stroustrup" + (c-offsets-alist + (innamespace . -) + (inline-open . 0) + (inher-cont . c-lineup-multi-inher) + (arglist-cont-nonempty . +) + (template-args-cont . +)))) + +(defun penguin-make-hook() + (setq +format-with-lsp nil) + (map! + :leader + :prefix "p" + :desc "Compile project" :n "c" #'helm-make-projectile) + (map! + :leader + :prefix "c" + :desc "Compile project" :n "c" #'helm-make-projectile) + (map! + :leader + :prefix "c" + :desc "List project errors" :n "x" #'lsp-treemacs-errors-list)) + +(add-hook 'makefile-mode-hook 'penguin-make-hook) +(defun penguin-c-hook() + (setq +format-with-lsp nil) + (map! + :leader + :prefix "p" + :desc "Compile project" :n "c" #'helm-make-projectile) + (map! + :leader + :prefix "c" + :desc "Compile project" :n "c" #'helm-make-projectile) + (map! + :leader + :prefix "c" + :desc "List project errors" :n "x" #'lsp-treemacs-errors-list) + (c-set-style "penguin") + (c-set-offset 'case-label '+) + (c-set-offset 'arglist-intro '+) + (setq lsp-headerline-breadcrumb-enable 't)) +(add-hook 'c-mode-hook 'penguin-c-hook) +(add-hook 'c++-mode-hook 'penguin-c-hook) +(add-hook 'after-change-major-mode-hook + (lambda () + (modify-syntax-entry ?_ "w"))) +(defun apply-lang-settings-to-open-buffers () + "Apply C++ mode settings to open buffers." + (interactive) + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (or (eq major-mode 'c-mode) (eq major-mode 'c++-mode)) + (penguin-c-hook))))) +(add-hook! 'doom-after-reload-hook #'apply-lang-settings-to-open-buffers) + +;; Markdown +(add-hook 'text-mode-hook + #'(lambda () + (setq indent-tabs-mode nil) + (setq tab-width 4))) + +(defun markdown-html (buffer) + (princ (with-current-buffer buffer + (format "Impatient Markdown %s " (buffer-substring-no-properties (point-min) (point-max)))) + (current-buffer))) +(imp-set-user-filter 'markdown-html) +;; Rust +(after! rustic + (setq lsp-rust-server 'rust-analyzer)) +(setq lsp-rust-analyzer-cargo-watch-command "clippy") +(setq lsp-eldoc-render-all t) +(setq lsp-idle-delay 0.6) +(setq lsp-rust-analyzer-server-display-inlay-hints t) +(setq lsp-rust-analyzer-display-lifetime-elision-hints-enable "skip_trivial") +(setq lsp-rust-analyzer-display-chaining-hints t) +(setq lsp-rust-analyzer-display-lifetime-elision-hints-use-parameter-names nil) +(setq lsp-rust-analyzer-display-closure-return-type-hints t) +(setq lsp-rust-analyzer-display-parameter-hints nil) +(setq lsp-rust-analyzer-display-reborrow-hints nil) + + +(add-hook 'python-mode-hook + (lambda () + (setq +format-with-lsp nil) + (setq indent-tabs-mode t) + (setq tab-width 4) + (setq py-indent-tabs-mode t) + (setq python-indent 4) + (setq python-indent-offset 4) + (add-to-list 'write-file-functions 'delete-trailing-whitespace)) + (tabify (point-min) (point-max))) + diff --git a/.config/doom/penguin/local.el b/.config/doom/penguin/local.el new file mode 100644 index 0000000..c70e924 --- /dev/null +++ b/.config/doom/penguin/local.el @@ -0,0 +1,15 @@ +;;; $DOOMDIR/penguin/local.el -*- lexical-binding: t; -*- + +(setq-local local-doom-user-dir (expand-file-name "~/.local/share/doom/")) +(if + (file-directory-p local-doom-user-dir) + (progn + (cl-loop for file in + (directory-files local-doom-user-dir nil directory-files-no-dot-files-regexp) do + (progn + (unless (string= file "packages.el") + (print (concat "Loading " file)) + (load (concat local-doom-user-dir file)) + )))) + (progn + (print local-doom-user-dir " not found."))) diff --git a/.config/doom/penguin/misc.el b/.config/doom/penguin/misc.el new file mode 100644 index 0000000..51ccde0 --- /dev/null +++ b/.config/doom/penguin/misc.el @@ -0,0 +1,19 @@ +;;; $DOOMDIR/penguin/misc.el -*- lexical-binding: t; -*- + +(setq-default evil-kill-on-visual-paste nil) + +(setq find-file-hook nil) +(defun penguin-reload-dir-locals-for-current-buffer () + "reload dir locals for the current buffer" + (interactive) + (let ((enable-local-variables :all)) + (hack-dir-local-variables-non-file-buffer))) +(defun penguin-reload-dir-locals-for-all-buffer-in-this-directory () + "For every buffer with the same `default-directory` as the +current buffer's, reload dir-locals." + (interactive) + (let ((dir default-directory)) + (dolist (buffer (buffer-list)) + (with-current-buffer buffer + (when (equal default-directory dir) + (penguin-reload-dir-locals-for-current-buffer)))))) diff --git a/.config/doom/penguin/org.el b/.config/doom/penguin/org.el new file mode 100644 index 0000000..e8211ee --- /dev/null +++ b/.config/doom/penguin/org.el @@ -0,0 +1,59 @@ +;;; $DOOMDIR/user/org.el -*- lexical-binding: t; -*- + +(add-hook! 'org-mode-hook 'org-num-mode) +(setq org-directory "~/org/") +(setq org-noter-notes-search-path '("~/Documents/notes/")) +(after! org + (setq org-agenda-files + '("~/Documents/agendas")) + (org-link-set-parameters "rel" :follow #'browse-url :export #'wvxvw/export-rel-url) + (set-company-backend! + 'org-mode + 'company-capf 'company-files) + (setq org-todo-keywords + '((sequence + "TODO(t)" + "BLOCKED(b)" + "WIP(w)" + "REVIEW(r)" + "|" + "CLOSED(c)" + "RESOLVED(R)" + "DONE(d)")))) + + + +;; (setcdr (assq 'system org-file-apps-defaults-gnu) "xdg-open %s") +(setcdr (assq 'system org-file-apps-gnu) "xdg-open %s") + +(advice-add 'org-open-file :around + (lambda (orig-fun &rest args) + ;; Work around a weird problem with xdg-open. + (let ((process-connection-type nil)) + (apply orig-fun args)))) + +(defun org-table-import-xlsx-to-csv-org () + (interactive) + (let* ((source-file (file-name-sans-extension (buffer-file-name + (current-buffer)))) + (xlsx-file (concat source-file ".xlsx")) + (csv-file (concat source-file ".csv"))) + (org-odt-convert xlsx-file "csv") + (org-table-import csv-file nil))) + + +(defun org-table-import-xlsx-file-to-csv-org (file) + (interactive "f") + (let* ((source-file (file-name-sans-extension (buffer-file-name + (current-buffer)))) + (xlsx-file (concat source-file ".xlsx")) + (csv-file (concat source-file ".csv"))) + (org-odt-convert file "csv") + (org-table-import csv-file nil))) + +;; I originally added this to fix relative links when converting org to html links but I'm pretty sure it doesn't even work +(defun wvxvw/export-rel-url (path desc format) + (cl-case format + (html (format "%s" path (or desc path))) + (latex (format "\\href{%s}{%s}" path (or desc path))) + (otherwise path))) diff --git a/.config/doom/penguin/project.el b/.config/doom/penguin/project.el new file mode 100644 index 0000000..8082fbb --- /dev/null +++ b/.config/doom/penguin/project.el @@ -0,0 +1,23 @@ +;;; $DOOMDIR/penguin/project.el -*- lexical-binding: t; -*- + +(require 'projectile) +(setq lsp-treemacs-sync-mode 1) +(setq projectile-project-search-path '("~/Projects/")) +(setq treemacs-hide-dot-git-directory nil) +(setq treemacs-project-follow-into-home nil) +;; (setq projectile-project-root-functions '(projectile-root-local +;; projectile-root-top-down +;; projectile-root-bottom-up +;; projectile-root-top-down-recurring)) +(setf treemacs-follow-mode nil) +(setq treemacs-project-follow-mode t) +(defun penguin-projectile-switch-project-action () + (closure + t + nil + (+workspace-new) + (+workspaces-set-project-action-fn) + (+workspaces-switch-to-project-h))) +(setq projectile-switch-project-action 'penguin-projectile-switch-project-action) +(after! projectile + (add-to-list 'projectile-globally-ignored-directories "^.cache$")) diff --git a/.config/doom/rg_ignore b/.config/doom/rg_ignore new file mode 100644 index 0000000..00a4613 --- /dev/null +++ b/.config/doom/rg_ignore @@ -0,0 +1,2 @@ +~/ +~/Projects/ diff --git a/.config/doom/snippets/date b/.config/doom/snippets/date new file mode 100644 index 0000000..e777a11 --- /dev/null +++ b/.config/doom/snippets/date @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: date +# key: > ~/.local/var/log/localrc.log +else + mkdir -p ~/.local/var/log + echo "$HOME/.localrc not found. Have you created it yet?" | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' >> ~/.local/var/log/localrc.log +fi diff --git a/user/.bashrc b/user/.bashrc index 5b463b5..b55edbb 100644 --- a/user/.bashrc +++ b/user/.bashrc @@ -16,9 +16,9 @@ fi # Put your fun stuff here. -. "$HOME/.cargo/env" -. "$HOME/.local/env" -. "$HOME/.config/emacs/env" +if [[ -f ~/.bash_sources ]]; then + . $HOME/.bash_sources +fi if [[ -f ~/.bash_aliases ]] ; then . $HOME/.bash_aliases fi diff --git a/user/.zshrc b/user/.zshrc index bc336fc..5a2ab8f 100644 --- a/user/.zshrc +++ b/user/.zshrc @@ -26,55 +26,17 @@ zstyle ':completion:*' insert-tab false setopt noautomenu setopt nomenucomplete -. "$HOME/.cargo/env" -. "$HOME/.local/env" -. "$HOME/.config/emacs/env" +. "$HOME/.bash_aliases" +. "$HOME/.bash_sources" -if [ -d ~/.pscripts ];then - export PATH="$HOME/.pscripts:$PATH" -fi - -alias ls="lsd -AFlh" LS_COLORS='di=1;35:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90:*.png=35:*.gif=36:*.jpg=35:*.c=92:*.jar=33:*.py=93:*.h=90:*.txt=94:*.doc=104:*.docx=104:*.odt=104:*.csv=102:*.xlsx=102:*.xlsm=102:*.rb=31:*.cpp=92:*.sh=92:*.html=96:*.zip=4;33:*.tar.gz=4;33:*.mp4=105:*.mp3=106:tw=1;37:ow=1;37' export LS_COLORS setopt globdots # eval "$(dircolors)" zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} - - -alias vim="lvim" -export EDITOR="/home/penguin/.local/bin/lvim" -export VISUAL="/home/penguin/.local/bin/lvim" - -function pssh() -{ - case "$1" in - epgit) - source $HOME/.pscripts/pssh_epgit - ;; - ep) - source $HOME/.pscripts/pssh_ep - ;; - github) - source $HOME/.pscripts/pssh_github - ;; - pi) - source $HOME/.pscripts/pssh_pi - ;; - vps) - source $HOME/.pscripts/pssh_vps - ;; - *) - echo "Usage: $0 {epgit | ep | github | pi | vps}" - esac -} - -alias pfixskew="find . -exec touch {} \;" -alias bmake="bear -- make" -alias rdos2unix="find . -type f -print0 | xargs -0 dos2unix --" -alias minicom="minicom -con" -. ~/.bash_aliases +export EDITOR="launch_emacs.sh" +export VISUAL="launch_emacs.sh" zle_highlight=(default:bold,fg=white) @@ -91,3 +53,24 @@ select-word-style bash [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh # plug "zsh-users/zsh-syntax-highlighting" +HISTFILE=~/.histfile +HISTSIZE=4096 +SAVEHIST=4096 +setopt appendhistory + + +if [[ -f ~/.bash_sources ]]; then + . $HOME/.bash_sources +fi +if [[ -f ~/.bash_aliases ]] ; then + . $HOME/.bash_aliases +fi + +if [[ -f ~/.localrc ]] ; then + . $HOME/.localrc +elif [[ -d "$HOME/.local/var/log" ]]; then + echo "$HOME/.localrc not found. Have you created it yet?" | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' >> ~/.local/var/log/localrc.log +else + mkdir -p ~/.local/var/log + echo "$HOME/.localrc not found. Have you created it yet?" | gawk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }' >> ~/.local/var/log/localrc.log +fi