Archived
1
0
Fork 0
This repository has been archived on 2024-10-19. You can view files and clone it, but cannot push or open issues or pull requests.
emacs/common/workspaces.el

226 lines
7.2 KiB
EmacsLisp
Raw Permalink Normal View History

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; various workspaces used day to day
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; load most recent auto save
(defun kmn/workspace-load-auto ()
(interactive)
(persp-load-state-from-file "persp-auto-save")
(persistent-scratch-restore)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; save the current workspace to `latest` filename
(defun kmn/workspace-save-latest ()
(interactive)
(persp-save-state-to-file "latest")
(persistent-scratch-save-to-file
(expand-file-name ".persistent-scratch-latest" user-emacs-directory))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; load `latest` file name to current workspace
(defun kmn/workspace-load-latest ()
(interactive)
(persp-load-state-from-file "latest")
(persistent-scratch-restore-from-file
(expand-file-name ".persistent-scratch-latest" user-emacs-directory))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Reusable hugo dev workspace
(defun kmn/workspace-hugo-generic (src-sub-dir)
(interactive)
(kmn/possibly-create-frame)
(delete-other-windows)
(centaur-tabs-mode t)
(setq src-sub-dir (concat "~/src/" src-sub-dir))
(kmn/dired-directory-on-left src-sub-dir nil nil -1)
(kmn/eshell-on-left src-sub-dir nil nil 0)
(kmn/eww-on-right "http://localhost:1313")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Hugo blog workspace
(defun kmn/workspace-hugo-blog ()
(interactive)
(kmn/workspace-hugo-generic "blog.kemonine.info")
(find-file "~/org/blog/_blog.org")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Hugo accessible.tips workspace
(defun kmn/workspace-hugo-accessible-tips ()
(interactive)
(kmn/workspace-hugo-generic "accessible.tips")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Hugo culinary.kemonine.info workspace
(defun kmn/workspace-hugo-culinary ()
(interactive)
(kmn/workspace-hugo-generic "culinary")
(find-file "~/org/culinary/_culinary.org")
(find-file "~/org/culinary/_recipes.org")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-mode workspace
(defun kmn/workspace-org ()
(interactive)
(kmn/possibly-create-frame)
; start with fresh frame
(delete-other-windows)
(kmn/kill-other-buffers)
(ignore-errors (kill-buffer "*scratch*"))
; Open main files used as 'gateway' to everything else
(find-file "~/org/culinary/meal_plan.org")
2024-03-10 17:32:48 +00:00
(find-file "~/org/health/health_couples.org")
(find-file "~/org/health/health_mike.org")
(find-file "~/org/orgzly/_habits.org")
(find-file "~/org/orgzly/_todo.org")
(find-file "~/org/orgzly/_slipbox.org")
(find-file "~/org/_index.org")
; top window for habits/scheduled
(org-agenda nil "h")
(goto-char 0)
; main todo/slipbox
(split-window-below)
(next-multiframe-window)
(org-agenda nil "t")
(goto-char 0)
; show kmn health notes/data tracker
;(split-window-below)
;(next-multiframe-window)
;(find-file "~/org/health/health_mike.org")
;(goto-char 0)
; focus top most frame
(next-multiframe-window)
)
2023-04-11 16:08:54 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-mode workspace for termux devices (mobile / android)
(defun kmn/workspace-org-single-window ()
(interactive)
; start with fresh frame
(delete-other-windows)
(kmn/kill-other-buffers)
(ignore-errors (kill-buffer "*scratch*"))
; Open main files used as 'gateway' to everything else
(find-file "~/org/culinary/meal_plan.org")
2024-03-10 17:32:48 +00:00
(find-file "~/org/health/health_couples.org")
(find-file "~/org/health/health_mike.org")
(find-file "~/org/orgzly/_habits.org")
(find-file "~/org/orgzly/_todo.org")
(find-file "~/org/orgzly/_slipbox.org")
(find-file "~/org/_index.org")
; Personal startup screen - orgmode agenda with all TODO
(org-agenda nil "r")
; start at the top of the agenda
(goto-char 0)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-mode workspace for general kb work that doesnt use the agenda
(defun kmn/workspace-org-index ()
(interactive)
(kmn/possibly-create-frame)
; start with fresh frame
(delete-other-windows)
; setup scratch on right
(kmn/scratch-text-on-right)
(goto-char 0)
; Open main files used as 'gateway' to everything else
(find-file "~/org/_index.org")
(goto-char 0)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; org-mode workspace for culinary work that doesnt use the agenda
(defun kmn/workspace-org-culinary ()
(interactive)
(kmn/possibly-create-frame)
; start with fresh frame
(delete-other-windows)
; setup scratch on right
(kmn/scratch-text-on-left)
(goto-char 0)
; Open main files used as 'gateway' to everything else
(find-file "~/org/culinary/_culinary.org")
(goto-char 0)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; empty code workspace
(defun kmn/workspace-code-empty (&optional dir_path)
(interactive)
(kmn/possibly-create-frame)
(delete-other-windows)
(kmn/kill-other-buffers)
(ignore-errors (kill-buffer "*scratch*"))
(scratch 'text-mode)
; show dired at `~` in left side window
(kmn/dired-directory-on-left dir_path)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; emacs config development
(defun kmn/workspace-code-emacs-config()
(interactive)
(kmn/workspace-code-empty "~/.emacs.d.profiles")
(find-file "~/.emacs.d.profiles/org/init.el")
(find-file "~/.emacs.d.profiles/code/init.el")
(find-file "~/.emacs.d.profiles/common/_global.el")
(find-file "~/.emacs.d.profiles/common/generic_functions.el")
(find-file "~/.emacs.d.profiles/common/workspaces.el")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; hugo development
(defun kmn/workspace-code-generic()
(interactive)
(kmn/workspace-code-empty "~/src")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; no man's sky game workspace
(defun kmn/workspace-game-nms ()
(interactive)
(let ((frame (make-frame)))
(select-frame-set-input-focus frame)
(delete-other-windows)
(find-file "~/org/games/_games.org")
(find-file "~/org/games/games_nms.org")
(goto-char 0)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; warframe game workspace
(defun kmn/workspace-game-warframe ()
(interactive)
(let ((frame (make-frame)))
(select-frame-set-input-focus frame)
(delete-other-windows)
(find-file "~/org/games/_games.org")
(find-file "~/org/games/games_warframe.org")
(goto-char 0)
)
)
2023-05-02 14:05:15 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; destiny game workspace
(defun kmn/workspace-game-destiny ()
(interactive)
(let ((frame (make-frame)))
(select-frame-set-input-focus frame)
(delete-other-windows)
(find-file "~/org/games/_games.org")
(find-file "~/org/games/games_destiny.org")
(goto-char 0)
)
)
2024-03-07 17:58:46 +00:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; _global.el for scratch workspace definitions