home-manager: inital commit
This commit is contained in:
parent
faaaa3d324
commit
2e6d7edcc7
31 changed files with 1559 additions and 0 deletions
92
home/dev/doom.d/config-appearance.el
Normal file
92
home/dev/doom.d/config-appearance.el
Normal file
|
@ -0,0 +1,92 @@
|
|||
;;; ../../../../mnt/c/Users/SmithEvar/.doom.d/config-appearance.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; Basic IDE settings
|
||||
|
||||
(setq doom-theme 'spacemacs-dark) ; Theme
|
||||
(setq-default indent-tabs-mode nil) ; Prefer spaces
|
||||
(setq display-line-numbers-type t) ; Line number preference
|
||||
(setq highlight-indent-guides-method 'character)
|
||||
|
||||
(when (modulep! :ui indent-guides) ; Enable indent guides in most programming-esq buffers
|
||||
(add-hook 'prog-mode-hook 'highlight-indent-guides-mode))
|
||||
|
||||
;; Fonts
|
||||
|
||||
(setq doom-font (font-spec :family "CommitMono Nerd Font" :size 24 :weight 'regular)
|
||||
doom-variable-pitch-font (font-spec :family "CommitMono Nerd Font")
|
||||
doom-big-font (font-spec :family "CommitMono Nerd Font" :size 32))
|
||||
|
||||
;; (setq doom-font (font-spec :family "SauceCodePro Nerd Font Mono" :size 18 :weight 'regular)
|
||||
;; doom-variable-pitch-font (font-spec :family "SauceCodePro Nerd Font Mono")
|
||||
;; doom-big-font (font-spec :family "SauceCodePro Nerd Font Mono" :size 24))
|
||||
|
||||
(if IS-LINUX
|
||||
(setq browse-url-generic-program (getenv "BROWSER")
|
||||
browse-url-browser-function 'browse-url-generic))
|
||||
|
||||
;; Spaceline
|
||||
|
||||
(require 'spaceline-config)
|
||||
(spaceline-spacemacs-theme)
|
||||
(setq powerline-height 32)
|
||||
(setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)
|
||||
|
||||
(defun simplify-file-name (buffer-name)
|
||||
"Returns the file combined with the immediate parent directory"
|
||||
(concat (file-name-as-directory
|
||||
(file-name-nondirectory
|
||||
(directory-file-name
|
||||
(file-name-directory buffer-name))))
|
||||
(file-name-nondirectory buffer-name)))
|
||||
(after! spaceline
|
||||
(spaceline-define-segment simple-buffer-path
|
||||
"Simplified version of the buffer file name"
|
||||
(simplify-file-name (buffer-file-name)))
|
||||
(spaceline-compile
|
||||
; left side
|
||||
'(((projectile-root)
|
||||
:fallback evil-state
|
||||
:face highlight-face
|
||||
:priority 100)
|
||||
(anzu :priority 95)
|
||||
auto-compile
|
||||
((buffer-modified simple-buffer-path remote-host)
|
||||
:priority 98)
|
||||
(major-mode :priority 79)
|
||||
(process :when active)
|
||||
((flycheck-error flycheck-warning flycheck-info)
|
||||
:when active :priority 89)
|
||||
; (minor-modes :when active :priority 9)
|
||||
(mu4e-alert-segment :when active)
|
||||
(erc-track :when active)
|
||||
(version-control :when active :priority 78)
|
||||
(org-pomodoro :when active)
|
||||
(org-clock :when active)
|
||||
nyan-cat)
|
||||
; right side
|
||||
'(which-function
|
||||
(python-pyvenv :fallback python-pyenv)
|
||||
(purpose :priority 94)
|
||||
(battery :when active)
|
||||
(selection-info :priority 95)
|
||||
input-method
|
||||
((buffer-encoding-abbrev point-position line-column)
|
||||
:separator " | " :priority 96)
|
||||
(global :when active)
|
||||
(buffer-position :priority 99)
|
||||
(hud :priority 99))))
|
||||
|
||||
;; Org mode stuff
|
||||
|
||||
(defun my/org-mode-hook ()
|
||||
(set-face-attribute 'org-level-1 nil :height 1.2)
|
||||
(set-face-attribute 'org-level-2 nil :height 1.1)
|
||||
(set-face-attribute 'org-level-3 nil :height 1.0)
|
||||
(set-face-attribute 'org-level-4 nil :height 1.0)
|
||||
(set-face-attribute 'org-level-5 nil :height 1.0))
|
||||
(add-hook 'org-load-hook #'my/org-mode-hook)
|
||||
|
||||
;; avy
|
||||
|
||||
(evil-define-key 'normal 'global "?" #'evil-avy-goto-char-2)
|
||||
(setq avy-all-windows t) ; make avy search all windows by default
|
141
home/dev/doom.d/config-dev.el
Normal file
141
home/dev/doom.d/config-dev.el
Normal file
|
@ -0,0 +1,141 @@
|
|||
;;; ../../../../mnt/c/Users/SmithEvar/.doom.d/config-dev.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; ink mode
|
||||
;; (require 'ink-mode)
|
||||
;; (add-hook 'ink-mode-hook 'flymake-mode) ;; error reporting
|
||||
;; (defvar my/inklecate-exe (if IS-WINDOWS "C:\dev\engines\inklecate"))
|
||||
;; (setq ink-inklecate-path my/inklecate-exe)
|
||||
|
||||
;; terraform ls using
|
||||
;; https://github.com/hashicorp/terraform-ls
|
||||
|
||||
(setq terraform-path (executable-find "terraform"))
|
||||
(setq terraform-ls-path (executable-find "terraform-ls"))
|
||||
(setq HAS-TERRAFORM-LS (and terraform-path terraform-ls-path))
|
||||
|
||||
(when HAS-TERRAFORM-LS
|
||||
(after! lsp-mode
|
||||
(lsp-register-client
|
||||
(make-lsp-client :new-connection (lsp-stdio-connection (list terraform-ls-path "serve"))
|
||||
:major-modes '(terraform-mode)
|
||||
:server-id 'terraform-ls)))
|
||||
|
||||
(add-hook 'terraform-mode-hook #'terraform-format-on-save-mode)
|
||||
(add-hook 'terraform-mode-hook #'lsp))
|
||||
|
||||
;; copilot config
|
||||
(use-package! copilot
|
||||
:hook (prog-mode . copilot-mode)
|
||||
:bind (:map copilot-completion-map
|
||||
("<tab>" . 'copilot-accept-completion)
|
||||
("TAB" . 'copilot-accept-completion)
|
||||
("C-TAB" . 'copilot-accept-completion-by-word)
|
||||
("C-<tab>" . 'copilot-accept-completion-by-word)))
|
||||
|
||||
;; (use-package! kubernetes)
|
||||
|
||||
;; suppress godot lsp errors per
|
||||
;; https://github.com/godotengine/emacs-gdscript-mode
|
||||
(defun lsp--gdscript-ignore-errors (original-function &rest args)
|
||||
"Ignore the error message resulting from Godot not replying to the `JSONRPC' request."
|
||||
(if (string-equal major-mode "gdscript-mode")
|
||||
(let ((json-data (nth 0 args)))
|
||||
(if (and (string= (gethash "jsonrpc" json-data "") "2.0")
|
||||
(not (gethash "id" json-data nil))
|
||||
(not (gethash "method" json-data nil)))
|
||||
nil ; (message "Method not found")
|
||||
(apply original-function args)))
|
||||
(apply original-function args)))
|
||||
;; Runs the function `lsp--gdscript-ignore-errors` around `lsp--get-message-type` to suppress unknown notification errors.
|
||||
(advice-add #'lsp--get-message-type :around #'lsp--gdscript-ignore-errors)
|
||||
|
||||
;; Web mode for razor files
|
||||
(add-to-list 'auto-mode-alist '("\\.razor\\'" . web-mode))
|
||||
|
||||
;; Projectile project for terraform
|
||||
(after! projectile
|
||||
(projectile-register-project-type 'terraform '(".terraform")
|
||||
:compile "terraform init"
|
||||
:run "terraform apply"))
|
||||
|
||||
|
||||
; TODO: Eventually make a thing
|
||||
; to execute org babel src blocks with type
|
||||
; vterm in a new vterm popup
|
||||
|
||||
; In a nutshell, I want to be able to get streaming results from
|
||||
; org babel. There's a thing that someone made that I copied to my
|
||||
; private config here from
|
||||
;
|
||||
; https://github.com/whacked/ob-shstream
|
||||
;
|
||||
; .. and subsequently
|
||||
;
|
||||
; https://github.com/excalamus/ob-shstream
|
||||
;
|
||||
; since the former was very outdated and couldn't successfully run.
|
||||
|
||||
; I configured it with the block below
|
||||
;
|
||||
;; ob shstream
|
||||
;;
|
||||
;; (load! "modules/tools/ob-shstream")
|
||||
;; (org-babel-do-load-languages
|
||||
;; 'org-babel-load-languages
|
||||
;; '(...
|
||||
;; (shstream . t)
|
||||
;; ...))
|
||||
;
|
||||
; Which... sort of worked. I didn't like how it felt to use. I thought
|
||||
; it would just be fine to use vterm, so I did some googling, and found this
|
||||
;
|
||||
; https://www.reddit.com/r/emacs/comments/op4fcm/send_command_to_vterm_and_execute_it/
|
||||
;
|
||||
; Which, after some hacking together with the source of +vterm/toggle, I
|
||||
; came to something that's a happy medium.
|
||||
;
|
||||
; Might be an idea to get it working with org babel so that I could do something like
|
||||
;
|
||||
; #+BEGIN_SRC vterm
|
||||
; git status
|
||||
; #+END_SRC
|
||||
;
|
||||
; Maybe one weekend.
|
||||
; Here's that hacked together function below
|
||||
|
||||
(defun my/vterm-execute-region-or-current-line ()
|
||||
"Insert text of current line in vterm and execute."
|
||||
(interactive)
|
||||
(require 'vterm)
|
||||
(eval-when-compile (require 'subr-x))
|
||||
; grab the command
|
||||
(let ((command (if (region-active-p)
|
||||
(string-trim (buffer-substring (save-excursion
|
||||
(region-beginning))
|
||||
(save-excursion
|
||||
(region-end))))
|
||||
(string-trim (buffer-substring (save-excursion
|
||||
(beginning-of-line)
|
||||
(point))
|
||||
(save-excursion
|
||||
(end-of-line)
|
||||
(point)))))))
|
||||
; find vterm buffer, either switch to it or make a new one
|
||||
(let ((return-buffer (current-buffer))
|
||||
(vterm-popup-buffer-name (format "*doom:vterm-popup:%s*"
|
||||
(if (bound-and-true-p persp-mode)
|
||||
(safe-persp-name (get-current-persp))
|
||||
"main"))))
|
||||
(if-let (existing-buffer (cl-loop for buf in (doom-buffers-in-mode 'vterm-mode)
|
||||
if (equal (buffer-local-value '+vterm--id buf)
|
||||
vterm-popup-buffer-name)
|
||||
return buf))
|
||||
(pop-to-buffer existing-buffer)
|
||||
(+vterm/toggle nil))
|
||||
; send the command
|
||||
(vterm--goto-line -1)
|
||||
; (message command) ; uncomment if i want messages
|
||||
(vterm-send-string command)
|
||||
(vterm-send-return)
|
||||
; switch back to where we were
|
||||
(switch-to-buffer-other-window return-buffer))))
|
13
home/dev/doom.d/config-org.el
Normal file
13
home/dev/doom.d/config-org.el
Normal file
|
@ -0,0 +1,13 @@
|
|||
;;; ../../../../mnt/c/Users/SmithEvar/.doom.d/config-org.el -*- lexical-binding: t; -*-
|
||||
|
||||
(defvar my/syncthing-dir (if IS-TERMUX "~/storage/shared/Syncthing/"
|
||||
(if IS-WORK "~/.syncthing/")))
|
||||
|
||||
(defvar my/org-dir-work (concat my/syncthing-dir "evar-org-work/"))
|
||||
|
||||
(setq org-directory "~/org/")
|
||||
(setq org-agenda-file-regexp "\\`[^.].*\\.org\\'")
|
||||
(setq org-agenda-files
|
||||
`(,(concat my/org-dir-work "work.org")
|
||||
,(concat my/org-dir-work "daily-reviews.org")
|
||||
,(concat my/org-dir-work "standups.org")))
|
92
home/dev/doom.d/config-true-helix.el
Normal file
92
home/dev/doom.d/config-true-helix.el
Normal file
|
@ -0,0 +1,92 @@
|
|||
;;; ../../../../mnt/c/Users/SmithEvar/.doom.d/config-true-helix.el -*- lexical-binding: t; -*-
|
||||
|
||||
;; TH specific stuff
|
||||
|
||||
(defvar my/work-devops-base-url "https://dev.azure.com/Helix076/Helix")
|
||||
(defun make-helix-devops-pullrequest-link (pr-number)
|
||||
(browse-url (concat my/work-devops-base-url "/_git/Helix/pullrequest/" pr-number)))
|
||||
(defun make-mobile-devops-pullrequest-link (pr-number)
|
||||
(browse-url (concat my/work-devops-base-url "/_git/Mobile/pullrequest/" pr-number)))
|
||||
(defun make-apidomain-devops-pullrequest-link (pr-number)
|
||||
(browse-url (concat my/work-devops-base-url "/_git/Helix.API.Domain/pullrequest/" pr-number)))
|
||||
(defun make-infrastructure-devops-pullrequest-link (pr-number)
|
||||
(browse-url (concat my/work-devops-base-url "/_git/Infrastructure/pullrequest/" pr-number)))
|
||||
(defun make-devops-workitem-link (story-number)
|
||||
(browse-url (concat my/work-devops-base-url "/_workitems/edit/" story-number)))
|
||||
|
||||
(defvar my/yas-devops-repo-list-expr '("helix" "mobile" "apidomain" "infrastructure"))
|
||||
|
||||
;; Work related TH stuff
|
||||
|
||||
(defvar my/work-org-file (concat my/org-dir-work "work.org"))
|
||||
(defvar my/standups-priority-prompt-string "%^{prompt||[#A]|[#B]|[#C]}")
|
||||
(defvar my/standups-people-prompt-string "%^{prompt|General|Cody|Corey|Emily|Evar|Mike|Nick|Melissa|Heather|Tom|Drew|Liz|Alex|Jared|Denise|Brian|Chris|Sam}")
|
||||
(defvar my/devops-repo-prompt-string "%^{prompt|AutoHistory|CLinkDataImportTool|Helix|Helix.API.Domain|Mobile|Infrastructure|SampleDataTool}")
|
||||
(defvar my/standups-default-properties-string "")
|
||||
(after! org
|
||||
(setq +org-capture-projects-file my/work-org-file)
|
||||
(setq org-capture-templates
|
||||
`(("g" "GTD Captures")
|
||||
("gi" "inbox" entry
|
||||
(file+olp ,my/work-org-file "Inbox")
|
||||
,(concat "* TODO %?"))
|
||||
("gf" "followup" entry
|
||||
(file+olp ,my/work-org-file "Inbox")
|
||||
,(concat "* TODO " my/standups-people-prompt-string " - %?" my/standups-default-properties-string))
|
||||
;("f" "Followup" entry (file+olp ,my/work-org-file "Active" "Followups")
|
||||
; ,(concat "* TODO " my/standups-priority-prompt-string " " my/standups-people-prompt-string " - %? :actionable:" my/standups-default-properties-string))
|
||||
("p" "Centralized templates for projects")
|
||||
("pt" "Project todo" entry
|
||||
(function +org-capture-central-project-todo-file)
|
||||
"* TODO %?\n %i\n %a"
|
||||
:heading "Tasks"
|
||||
:parents ("Code Notes")
|
||||
:prepend nil)
|
||||
("pn" "Project notes" entry
|
||||
(function +org-capture-central-project-notes-file)
|
||||
"* %U %?\n %i\n %a"
|
||||
:heading "Misc"
|
||||
:parents ("Code Notes")
|
||||
:prepend t)
|
||||
("s" "Standups")
|
||||
("sa" "Announcement" entry (file+olp ,my/work-org-file "Active" "Announcements")
|
||||
,(concat "* " my/standups-people-prompt-string " - %? :announcement:"))))
|
||||
(org-add-link-type "devops-workitem" #'make-devops-workitem-link)
|
||||
(org-add-link-type "devops-helix-pr" #'make-helix-devops-pullrequest-link)
|
||||
(org-add-link-type "devops-mobile-pr" #'make-mobile-devops-pullrequest-link)
|
||||
(org-add-link-type "devops-apidomain-pr" #'make-apidomain-devops-pullrequest-link)
|
||||
(org-add-link-type "devops-infrastructure-pr" #'make-infrastructure-devops-pullrequest-link))
|
||||
|
||||
(defun th-today ()
|
||||
(interactive)
|
||||
(let ((file-name "daily-reviews.org")
|
||||
(header-format (format-time-string "%Y-%m-%d %A")))
|
||||
(find-file (concat my/org-dir-work file-name))
|
||||
(-if-let* [(header-pos (org-find-exact-headline-in-buffer header-format (current-buffer) t))]
|
||||
(goto-char header-pos)
|
||||
(goto-char (point-max))
|
||||
(newline 2)
|
||||
(let ((snippet (yas-lookup-snippet "GTD Daily Review" #'org-mode)))
|
||||
(yas-expand-snippet snippet)
|
||||
(org-clock-in)))
|
||||
(unless (not (eq winum--window-count 1))
|
||||
(split-window-vertically)
|
||||
(org-agenda nil "n")
|
||||
(setq org-agenda-todo-ignore-scheduled 'all)
|
||||
(org-agenda-goto-today)
|
||||
(org-agenda-day-view)
|
||||
(org-agenda-log-mode)
|
||||
(evil-window-rotate-downwards))))
|
||||
|
||||
|
||||
(defun th-standups ()
|
||||
(interactive)
|
||||
(let ((file-name "standups.org")
|
||||
(header-format (format-time-string "%Y-%m-%d %A")))
|
||||
(find-file (concat my/org-dir-work file-name))
|
||||
(-if-let* [(header-pos (org-find-exact-headline-in-buffer header-format (current-buffer) t))]
|
||||
(goto-char header-pos)
|
||||
(goto-char (point-max))
|
||||
(newline 2)
|
||||
(let ((snippet (yas-lookup-snippet "True Helix standup minutes" #'org-mode)))
|
||||
(yas-expand-snippet snippet)))))
|
31
home/dev/doom.d/config.el
Normal file
31
home/dev/doom.d/config.el
Normal file
|
@ -0,0 +1,31 @@
|
|||
;; 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', relative to
|
||||
;; this file. Emacs searches the `load-path' when you load packages with
|
||||
;; `require' or `use-package'.
|
||||
;; - `map!' for binding new keys
|
||||
|
||||
|
||||
;; Some functionality uses this to identify you, e.g. GPG configuration, email
|
||||
;; clients, file templates and snippets.
|
||||
(setq user-full-name "Evar Smith"
|
||||
user-mail-address "me@evar.dev")
|
||||
|
||||
(setq custom-file null-device)
|
||||
|
||||
(load! "config-appearance")
|
||||
(load! "config-org")
|
||||
(when IS-WORK (load! "config-true-helix"))
|
||||
(when IS-DEV (load! "config-dev"))
|
||||
|
||||
;; dont lazy load on windows
|
||||
;; because it sucks
|
||||
;(if IS-WINDOWS
|
||||
; (progn (use-package! org :demand)
|
||||
; (use-package! treemacs :demand)
|
||||
; (use-package! projectile :demand)
|
||||
; (use-package! workgroups :demand)
|
||||
; (use-package! treemacs-projectile :demand)))
|
19
home/dev/doom.d/custom.el
Normal file
19
home/dev/doom.d/custom.el
Normal file
|
@ -0,0 +1,19 @@
|
|||
(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.
|
||||
'(custom-safe-themes
|
||||
'("f0eb51d80f73b247eb03ab216f94e9f86177863fb7e48b44aacaddbfe3357cf1" "ab058aa22bdaf17b5d8a9e21632a62c8966728ae10ef8fd07e95637e9cdf7a7b" default))
|
||||
'(gdscript-godot-executable "/Applications/Godot.app/Contents/MacOS/Godot")
|
||||
'(org-agenda-files
|
||||
'("c:/Users/Evar/.syncthing/evar-org-work/daily-reviews.org" "c:/Users/Evar/.syncthing/evar-org-work/work.org" "c:/Users/Evar/.syncthing/evar-org-work/standups.org") t)
|
||||
'(org-babel-remote-temporary-directory "/tmp/")
|
||||
'(package-selected-packages '(company-quickhelp)))
|
||||
(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.
|
||||
)
|
98
home/dev/doom.d/init.el
Normal file
98
home/dev/doom.d/init.el
Normal file
|
@ -0,0 +1,98 @@
|
|||
;;; initmel -*- 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 a "Module Index" link where you'll find
|
||||
;; a comprehensive list 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 c 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 c d') on a module to browse its
|
||||
;; directory (for easy access to its source code).
|
||||
|
||||
(defvar work-systems '("HLXLAP001"))
|
||||
(defvar IS-TERMUX (getenv "TERMUX_VERSION"))
|
||||
(defvar IS-WORK (or (member (system-name) work-systems) IS-TERMUX))
|
||||
(defvar IS-DEV (not IS-TERMUX))
|
||||
|
||||
(doom! :completion
|
||||
(company +childframe) ; the ultimate code completion backend
|
||||
(vertico +icons) ; the search engine of the future
|
||||
|
||||
:ui
|
||||
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
|
||||
hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW
|
||||
indent-guides ; highlighted indent columns
|
||||
nav-flash ; blink cursor line after big motions
|
||||
ophints ; highlight the region an operation acts on
|
||||
(popup +defaults) ; tame sudden yet inevitable temporary windows
|
||||
vc-gutter ; vcs diff in the fringe
|
||||
vi-tilde-fringe ; fringe tildes to mark beyond EOB
|
||||
(window-select +numbers) ; visually switch windows
|
||||
(treemacs +lsp)
|
||||
workspaces ; tab emulation, persistence & separate workspaces
|
||||
|
||||
:editor
|
||||
(evil +everywhere) ; come to the dark side, we have cookies
|
||||
file-templates ; auto-snippets for empty files
|
||||
fold ; (nigh) universal code folding
|
||||
snippets ; my elves. They type so I don't have to
|
||||
|
||||
:emacs
|
||||
(dired +icons +ranger) ; making dired pretty [functional]
|
||||
electric ; smarter, keyword-based electric-indent
|
||||
(ibuffer +icons) ; interactive buffer management
|
||||
undo ; persistent, smarter undo for your inevitable mistakes
|
||||
vc ; version-control and Emacs, sitting in a tree
|
||||
|
||||
:term
|
||||
vterm ; the best terminal emulation in Emacs
|
||||
|
||||
:checkers
|
||||
syntax ; tasing you for every semicolon you forget
|
||||
;;(spell +flyspell) ; tasing you for misspelling mispelling
|
||||
;;grammar ; tasing grammar mistake every you make
|
||||
|
||||
:tools
|
||||
(:if IS-DEV ansible)
|
||||
(:if IS-DEV (debugger +lsp)) ; FIXME stepping through code, to help you add bugs
|
||||
(:if IS-DEV direnv)
|
||||
(:if IS-DEV docker)
|
||||
editorconfig ; let someone else argue about tabs vs spaces
|
||||
(eval +overlay) ; run code, run (also, repls)
|
||||
lookup ; navigate your code and its documentation
|
||||
(:if IS-DEV lsp)
|
||||
(:if IS-DEV magit) ; a git porcelain for Emacs
|
||||
(:if IS-DEV taskrunner) ; taskrunner for all your projects
|
||||
(:if IS-DEV terraform) ; infrastructure as code
|
||||
|
||||
:os
|
||||
(:if IS-MAC macos) ; improve compatibility with macOS
|
||||
tty ; improve the terminal Emacs experience
|
||||
|
||||
:lang
|
||||
(:if IS-DEV (csharp +lsp ; unity, .NET, and mono shenanigans
|
||||
+dotnet))
|
||||
nix
|
||||
data ; config/data formats
|
||||
emacs-lisp ; drown in parentheses
|
||||
(:if IS-DEV (gdscript +lsp)) ; the language you waited for
|
||||
(:if IS-DEV (javascript +lsp)) ; all(hope(abandon(ye(who(enter(here))))))
|
||||
markdown ; writing docs for people to ignore
|
||||
org ; organize your plain life in plain text
|
||||
(:if IS-DEV (rust +lsp)) ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||
sh ; she sells {ba,z,fi}sh shells on the C xor
|
||||
web ; the tubes
|
||||
(:if IS-DEV (yaml +lsp)) ; JSON, but readable
|
||||
|
||||
:app
|
||||
(rss +org) ; emacs as an RSS reader
|
||||
|
||||
:config
|
||||
(default +bindings +smartparens))
|
190
home/dev/doom.d/modules/tools/ob-shstream.el
Normal file
190
home/dev/doom.d/modules/tools/ob-shstream.el
Normal file
|
@ -0,0 +1,190 @@
|
|||
;;; ob-shstream.el --- org-babel functions for simple async shell eval -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2021 Excalamus (excalamus.com), whacked
|
||||
;; (https://github.com/whacked)
|
||||
|
||||
;; Author: Excalamus, whacked (https://github.com/whacked)
|
||||
;; Keywords: literate programming, reproducible research
|
||||
;; Version: 0.02
|
||||
|
||||
;;; License:
|
||||
|
||||
;; This program is free software; you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
;; the Free Software Foundation; either version 3, or (at your option)
|
||||
;; any later version.
|
||||
;;
|
||||
;; This program is distributed in the hope that it will be useful,
|
||||
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;; GNU General Public License for more details.
|
||||
;;
|
||||
;; You should have received a copy of the GNU General Public License
|
||||
;; along with GNU Emacs; see the file COPYING. If not, write to the
|
||||
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
;; Boston, MA 02110-1301, USA.
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; The default ob-sh evaluation for shell scripts in org-mode is
|
||||
;; blocking, so commands like the following freeze Emacs:
|
||||
;;
|
||||
;; #+BEGIN_SRC sh
|
||||
;; ping -c 5 127.0.0.1
|
||||
;; #+END_SRC
|
||||
;;
|
||||
;; Results only become visible when the process terminates.
|
||||
;;
|
||||
;; ob-shstream.el works by running the source given in a shell block
|
||||
;; in a separate process. It does this by creating a temporary file
|
||||
;; and executing it. Output is appended to a buffer and a hash
|
||||
;; representing the source code acts as the result until the process
|
||||
;; finishes. When completed, the hash is replaced with the output
|
||||
;; buffer contents.
|
||||
;;
|
||||
;; NOTE: header arguments (e.g. :session) are not supported and some
|
||||
;; may not work as expected (e.g. :table). This was only tested with
|
||||
;; :result output. This is because the org-babel functionality is
|
||||
;; largely undocumented and it's API inconsistent.
|
||||
|
||||
;;; Usage:
|
||||
|
||||
;; Load this file and update the org-babel settings:
|
||||
;;
|
||||
;; (org-babel-do-load-languages
|
||||
;; 'org-babel-load-languages
|
||||
;; '(...
|
||||
;; (shstream . t)
|
||||
;; ...))
|
||||
;;
|
||||
;; then use like a normal sh block, but replace "sh" with "shstream".
|
||||
;;
|
||||
;; Example:
|
||||
;;
|
||||
;; #+begin_src shstream :results output
|
||||
;; echo "hello, world!"
|
||||
;; sleep 2
|
||||
;; echo "goodbye, cruel world..."
|
||||
;; #+end_src
|
||||
;;
|
||||
;; Check the source code for user variables.
|
||||
|
||||
;;; Requirements:
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defvar ob-shstream-shell-command "bash"
|
||||
"Command used to execute code within a shstream block.
|
||||
|
||||
It is assumed that the command is on the shell path (i.e. that it
|
||||
can be called from the shell without providing the path to the
|
||||
executable).")
|
||||
|
||||
(defun ob-shstream-default-insertion-filter (proc string)
|
||||
"Insert process output in process buffer.
|
||||
|
||||
Taken from (elisp) Filter Functions."
|
||||
(when (buffer-live-p (process-buffer proc))
|
||||
(display-buffer (process-buffer proc))
|
||||
(with-current-buffer (process-buffer proc)
|
||||
(let ((inhibit-read-only t))
|
||||
(save-excursion
|
||||
;; Insert the text, advancing the process marker.
|
||||
(goto-char (process-mark proc))
|
||||
(insert string)
|
||||
(set-marker (process-mark proc) (point)))))))
|
||||
|
||||
(defvar ob-shstream-filter-function 'ob-shstream-default-insertion-filter
|
||||
"Filter function to apply to process output before it is
|
||||
inserted into the process output buffer.")
|
||||
|
||||
(defun org-babel-execute:shstream-pass-through (body params)
|
||||
"Execute a block of shstream-pass-through code with org-babel.
|
||||
|
||||
This function is called by `org-babel-execute-src-block' This
|
||||
particular definition is a dummy source language used strictly to
|
||||
format shstream output."
|
||||
body)
|
||||
|
||||
(defun org-babel-execute:shstream (body params)
|
||||
"Execute a block of shstream code with org-babel.
|
||||
|
||||
This function is called by `org-babel-execute-src-block'"
|
||||
(let* ((org-buffer (current-buffer))
|
||||
(hash (secure-hash 'sha256 body))
|
||||
(hash-name (concat "ob-shstream-" hash))
|
||||
(short-hash-name (concat "ob-shstream-" (substring hash 0 7)))
|
||||
(process-output-buffer-name (concat "*" short-hash-name "*"))
|
||||
(temp-shell-file (org-babel-temp-file hash-name ".sh"))
|
||||
;; (info (org-babel-get-src-block-info))
|
||||
(results-params (cdr (assq :results params)))
|
||||
(session-name (cdr (assq :session params))))
|
||||
|
||||
;; shell source must be in a temp file to be run asynchronously
|
||||
(with-temp-file temp-shell-file
|
||||
(insert body))
|
||||
|
||||
(with-current-buffer (get-buffer-create process-output-buffer-name)
|
||||
(display-buffer process-output-buffer-name)
|
||||
(read-only-mode nil))
|
||||
|
||||
(let* ((process (make-process
|
||||
:name hash-name
|
||||
:buffer process-output-buffer-name
|
||||
:command (list ob-shstream-shell-command temp-shell-file)
|
||||
;; no need to communicate between processes; kill
|
||||
;; with list-processes if needed
|
||||
:connection 'pipe
|
||||
:filter ob-shstream-filter-function
|
||||
:sentinel `(lambda (process event)
|
||||
(if (string= event "finished\n")
|
||||
(progn
|
||||
|
||||
;; run process output through shstream-pass-through in order to format
|
||||
;; (e.g. put colons in front of each line)
|
||||
(let ((formatted-result
|
||||
(with-temp-buffer
|
||||
;; DEBUG:
|
||||
;; (with-current-buffer (get-buffer-create "*shstream-pass-through*")
|
||||
;; (erase-buffer)
|
||||
(insert (format "#+begin_src shstream-pass-through :results %s :session %s\n%s#+end_src"
|
||||
,results-params
|
||||
,session-name
|
||||
(with-current-buffer ,process-output-buffer-name
|
||||
(buffer-string))))
|
||||
(org-babel-execute-src-block)
|
||||
;; get the org formatted result
|
||||
(let ((result-start (+ (org-babel-where-is-src-block-result) 10)))
|
||||
(buffer-substring-no-properties result-start (point-max))))))
|
||||
|
||||
;; replace hash with formatted results
|
||||
(save-excursion
|
||||
(save-restriction
|
||||
(with-current-buffer ,org-buffer
|
||||
(widen)
|
||||
(beginning-of-buffer)
|
||||
(re-search-forward ,hash nil t)
|
||||
;; assumes no one has put any text between the results
|
||||
;; and the source block which contains "shstream"
|
||||
(goto-char (re-search-backward "shstream" nil t))
|
||||
|
||||
(let* ((results-start (+ (org-babel-where-is-src-block-result) 10))
|
||||
(results-end (when results-start
|
||||
(save-excursion
|
||||
(goto-char results-start)
|
||||
(goto-char (org-babel-result-end))
|
||||
(point)))))
|
||||
(delete-region results-start results-end)
|
||||
(goto-char results-start)
|
||||
(insert formatted-result)
|
||||
;; this is probably annoying, but that's Emacs window/buffer
|
||||
;; management for ya
|
||||
(switch-to-prev-buffer (get-buffer-window ,process-output-buffer-name) t)
|
||||
(kill-buffer ,process-output-buffer-name)
|
||||
(delete-file ,temp-shell-file)))))))))))))
|
||||
|
||||
;; use hash as place holder until process completes
|
||||
hash))
|
||||
|
||||
(provide 'ob-shstream)
|
||||
;;; ob-shstream.el ends here
|
23
home/dev/doom.d/modules/tools/terraform-plus/init.el
Normal file
23
home/dev/doom.d/modules/tools/terraform-plus/init.el
Normal file
|
@ -0,0 +1,23 @@
|
|||
;;; tools/terraform-plus/init.el -*- lexical-binding: t; -*-
|
||||
|
||||
|
||||
;;; Mode
|
||||
|
||||
;; (define-derived-mode terraform-plus-section-mode special-mode "Terraform-Plus-Sections"
|
||||
;; "Parent major mode that terraform-plus-like sections inherit"
|
||||
;; (buffer-disable-undo)
|
||||
;; (setq truncate-lines t)
|
||||
;; (setq buffer-read-only t)
|
||||
;; (setq show-trailing-whitespace nil))
|
||||
|
||||
;; (defvar terraform-plus-section-mode-map
|
||||
;; (let ((map (make-keymap)))
|
||||
;; (suppress-keymap map t)
|
||||
;; (define-key map (kbd "TAB") 'terraform-plus-section-toggle)
|
||||
;; map))
|
||||
|
||||
;;; Visibility
|
||||
|
||||
;; (defun terraform-plus-section-toggle (section)
|
||||
;; "Toggle the visibility of the current section"
|
||||
;; ())
|
77
home/dev/doom.d/packages.el
Normal file
77
home/dev/doom.d/packages.el
Normal file
|
@ -0,0 +1,77 @@
|
|||
;; -*- no-byte-compile: t; -*-
|
||||
;;; $DOOMDIR/packages.el
|
||||
|
||||
;; To install a package with Doom you must declare them here and run 'doom sync'
|
||||
;; on the command line, then restart Emacs for the changes to take effect -- or
|
||||
;; use 'M-x doom/reload'.
|
||||
|
||||
|
||||
;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror:
|
||||
;(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/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, 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"))
|
||||
|
||||
;; Use `:pin' to specify a particular commit to install.
|
||||
;(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)
|
||||
;; ...or multiple packages
|
||||
;(unpin! pinned-package another-pinned-package)
|
||||
;; ...Or *all* packages (NOT RECOMMENDED; will likely break things)
|
||||
;(unpin! t)
|
||||
|
||||
;; web-mode for .razor files
|
||||
|
||||
;; (package! web-mode
|
||||
;; :recipe (:host github :repo "fxbois/web-mode"
|
||||
;; :files ("web-mode.el")))
|
||||
|
||||
;; nano theme
|
||||
(package! nano-theme :recipe (:host github :repo "rougier/nano-theme"))
|
||||
|
||||
;; org mode stuff
|
||||
(package! mixed-pitch)
|
||||
|
||||
(package! workgroups)
|
||||
|
||||
(package! spacemacs-theme)
|
||||
|
||||
(package! spaceline)
|
||||
|
||||
;; misc packages
|
||||
|
||||
(package! ink-mode)
|
||||
|
||||
(package! copilot
|
||||
:recipe (:host github :repo "zerolfx/copilot.el" :files ("*.el" "dist")))
|
||||
|
||||
(package! kubernetes)
|
9
home/dev/doom.d/snippets/org-mode/devops link
Normal file
9
home/dev/doom.d/snippets/org-mode/devops link
Normal file
|
@ -0,0 +1,9 @@
|
|||
# -*- mode: snippet -*-
|
||||
# contributor: Evar Smith
|
||||
# name: devops link
|
||||
# uuid: devops-link
|
||||
# key: <#
|
||||
# condition: t
|
||||
# group: helix
|
||||
# --
|
||||
[[devops-workitem:${1:0}][${1:$(concat "#" yas-text)}]${0:$$(insert "]")}
|
9
home/dev/doom.d/snippets/org-mode/devops pr
Normal file
9
home/dev/doom.d/snippets/org-mode/devops pr
Normal file
|
@ -0,0 +1,9 @@
|
|||
# -*- mode: snippet -*-
|
||||
# contributor: Evar Smith
|
||||
# name: devops pr
|
||||
# uuid: devops-pr
|
||||
# key: <!
|
||||
# condition: t
|
||||
# group: helix
|
||||
# --
|
||||
[[devops-${2:$$(yas-choose-value my--yas-devops-repo-list-expr)}-pr:${1:0}][${1:$(concat "!" yas-text)}]${0:$$(insert "]")}
|
13
home/dev/doom.d/snippets/org-mode/evar-gtd-daily-review
Normal file
13
home/dev/doom.d/snippets/org-mode/evar-gtd-daily-review
Normal file
|
@ -0,0 +1,13 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: GTD Daily Review
|
||||
# uuid: evar-gtd-daily-review
|
||||
# condition: t
|
||||
# group: helix
|
||||
# --
|
||||
|
||||
* `(format-time-string "%Y-%m-%d %A")`
|
||||
- [ ] Check infrastructure statistics - file notes
|
||||
- [ ] Check and clear email - record tasks
|
||||
- [ ] Check devops dashboard - record tasks (followups, etc.)
|
||||
- [ ] Schedule today's tasks (remember immersive / process)
|
||||
- [ ] Check appstack candidates
|
17
home/dev/doom.d/snippets/org-mode/evar-gtd-project
Normal file
17
home/dev/doom.d/snippets/org-mode/evar-gtd-project
Normal file
|
@ -0,0 +1,17 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name: GTD Project
|
||||
# uuid: gtd-project
|
||||
# key: <proj
|
||||
# condition: t
|
||||
# --
|
||||
|
||||
${2:`(make-string (org-current-level) ?*)`*} $1
|
||||
$2* Immersive
|
||||
:PROPERTIES:
|
||||
:CATEGORY: immersive
|
||||
:END:
|
||||
$2* Process
|
||||
:PROPERTIES:
|
||||
:CATEGORY: process
|
||||
:END:
|
||||
$2* Notes :archive:
|
58
home/dev/doom.d/snippets/org-mode/true-helix-standup-minutes
Normal file
58
home/dev/doom.d/snippets/org-mode/true-helix-standup-minutes
Normal file
|
@ -0,0 +1,58 @@
|
|||
# -*- mode: snippet -*-
|
||||
# contributor: Emily Susemihl
|
||||
# name: True Helix standup minutes
|
||||
# uuid: true-helix-standup-minutes
|
||||
# key: sup
|
||||
# condition: t
|
||||
# group: helix
|
||||
# --
|
||||
|
||||
* `(format-time-string "%Y-%m-%d %A")`
|
||||
** Developers
|
||||
*** Cody [`(format-time-string "%Y-%m-%d %a")`] :cody:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Corey [`(format-time-string "%Y-%m-%d %a")`] :corey:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Chris [`(format-time-string "%Y-%m-%d %a")`] :chris:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Nick [`(format-time-string "%Y-%m-%d %a")`] :nick:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Mike [`(format-time-string "%Y-%m-%d %a")`] :mike:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Jared [`(format-time-string "%Y-%m-%d %a")`] :jared:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Emily [`(format-time-string "%Y-%m-%d %a")`] :emily:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Sam [`(format-time-string "%Y-%m-%d %a")`] :sam:
|
||||
- Yesterday
|
||||
- Today
|
||||
|
||||
** Others
|
||||
*** Alex [`(format-time-string "%Y-%m-%d %a")`] :alex:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Tom [`(format-time-string "%Y-%m-%d %a")`] :tom:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Drew [`(format-time-string "%Y-%m-%d %a")`] :drew:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Liz [`(format-time-string "%Y-%m-%d %a")`] :liz:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Brian [`(format-time-string "%Y-%m-%d %a")`] :brian:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Heather [`(format-time-string "%Y-%m-%d %a")`] :heather:
|
||||
- Yesterday
|
||||
- Today
|
||||
*** Melissa [`(format-time-string "%Y-%m-%d %a")`] :melissa:
|
||||
- Yesterday
|
||||
- Today
|
5
home/dev/doom.d/snippets/prog-mode/code note
Normal file
5
home/dev/doom.d/snippets/prog-mode/code note
Normal file
|
@ -0,0 +1,5 @@
|
|||
# -*- mode: snippet -*-
|
||||
# name:
|
||||
# key: trigger-key
|
||||
# condition: t
|
||||
# --
|
Loading…
Add table
Add a link
Reference in a new issue