Archived
1
0
Fork 0

add hugo generic workspace, workspaces for each of the hugo websites i maintain

This commit is contained in:
KemoNine 2023-04-22 16:08:56 -04:00
parent b92946dc61
commit ee6db75c37
2 changed files with 86 additions and 4 deletions

View file

@ -21,10 +21,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; open dired with default directory in left side window
(defun kmn/dired-directory-on-left (&optional dir_path)
(defun kmn/dired-directory-on-left (&optional dir_path no-win no-del-o-win slot-num)
(defvar parameters
'(window-parameters . ((no-other-window . t)
(no-delete-other-windows . t))))
'(window-parameters . ((no-other-window . ,(or no-win (setq no-win t)))
(no-delete-other-windows . ,(or no-del-o-win (setq no-del-o-win t))))))
(setq fit-window-to-buffer-horizontally t)
(setq window-resize-pixelwise t)
@ -34,7 +34,52 @@
(let ((buffer (dired-noselect (or dir_path (setq dir_path default-directory)))))
(with-current-buffer buffer (dired-hide-details-mode t))
(display-buffer-in-side-window
buffer `((side . left) (slot . -1)
buffer `((side . left) (slot . ,(or slot-num (setq slot-num -1)))
(window-width . fit-window-to-buffer)
, parameters)
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; open eshell in left side window
(defun kmn/eshell-on-left (&optional shell-directory no-win no-del-o-win slot-num)
(defvar parameters
'(window-parameters . ((no-other-window . ,(or no-win (setq no-win t)))
(no-delete-other-windows . ,(or no-del-o-win (setq no-del-o-win t))))))
(setq fit-window-to-buffer-horizontally t)
(setq window-resize-pixelwise t)
(setq default-directory (or shell-directory (setq shell-directory default-directory)))
(interactive)
(let ((buffer (eshell)))
(display-buffer-in-side-window
buffer `((side . left) (slot . ,(or slot-num (setq slot-num -1)))
(window-width . fit-window-to-buffer)
, parameters)
)
)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; open eww in right side window
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; open eww in right side window
(defun kmn/eww-on-right (url &optional no-win no-del-o-win slot-num)
(defvar parameters
'(window-parameters . ((no-other-window . ,(or no-win (setq no-win t)))
(no-delete-other-windows . ,(or no-del-o-win (setq no-del-o-win t))))))
(setq fit-window-to-buffer-horizontally t)
(setq window-resize-pixelwise t)
(interactive)
(eww url)
(let ((buffer (current-buffer)))
(previous-buffer)
(display-buffer-in-side-window
buffer `((side . right) (slot . ,(or slot-num (setq slot-num -1)))
(window-width . fit-window-to-buffer)
, parameters)
)

View file

@ -26,6 +26,43 @@
(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)
(delete-other-windows)
(centaur-tabs-mode t)
(setq src-sub-dir (concat "~/src/" src-sub-dir))
(interactive)
(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
(when (not kmn/is-dayjob)