stuff
This commit is contained in:
@@ -157,6 +157,10 @@
|
||||
(setq emms-source-file-default-directory "~/work/music/"
|
||||
emms-player-list '(emms-player-mpv))
|
||||
)
|
||||
(when (featurep 'dbusbind)
|
||||
(after! emms
|
||||
(require 'emms-mpris)
|
||||
(emms-mpris-enable)))
|
||||
|
||||
;;; infrasonic
|
||||
(use-package! infrasonic)
|
||||
@@ -302,6 +306,80 @@
|
||||
)
|
||||
|
||||
|
||||
;;; the file buffer opening I used to have in zed
|
||||
(defun my-toggle-dired-current-dir ()
|
||||
"Toggle between Dired for the current file's directory and the original file."
|
||||
(interactive)
|
||||
(if (eq major-mode 'dired-mode)
|
||||
;; If in Dired, cleanly kill the buffer and jump back
|
||||
(quit-window t)
|
||||
;; Otherwise, check if visiting a file, then open its directory
|
||||
(if (buffer-file-name)
|
||||
(dired (file-name-directory (buffer-file-name)))
|
||||
(message "Current buffer is not visiting a file."))))
|
||||
|
||||
;; Doom Emacs keybinding macro for Ctrl+Shift+P
|
||||
(map! "C-S-p" #'my-toggle-dired-current-dir)
|
||||
|
||||
|
||||
|
||||
|
||||
;;; open the config.el file directly instead of the whole config folder
|
||||
(map! :leader
|
||||
:desc "Open Doom config.el"
|
||||
"f p" (lambda ()
|
||||
(interactive)
|
||||
(find-file (expand-file-name "config.el" doom-private-dir))))
|
||||
|
||||
|
||||
|
||||
|
||||
;;; xwidget don't ask when killing a buffer
|
||||
(after! xwidget
|
||||
(remove-hook 'kill-buffer-query-functions #'xwidget-kill-buffer-query-function)
|
||||
)
|
||||
|
||||
|
||||
|
||||
;;; markdown stuff
|
||||
(use-package! md-mode
|
||||
:mode ("\\.md\\'" . md-mode))
|
||||
(after! md-mode
|
||||
(define-key md-mode-map (kbd "C-h") 'md-mode-goto-heading)
|
||||
)
|
||||
|
||||
|
||||
;;; evil - use visial line for down/up
|
||||
(after! evil
|
||||
(define-key evil-motion-state-map (kbd "j") 'evil-next-visual-line)
|
||||
(define-key evil-motion-state-map (kbd "k") 'evil-previous-visual-line)
|
||||
)
|
||||
|
||||
;;; workspace setup
|
||||
(after! persp-mode
|
||||
;; Automatically create a "main" workspace for miscellaneous tasks
|
||||
(setq +workspaces-main "things")
|
||||
;; Prevent emacsclient from forcing everything into a generic or new blank workspace
|
||||
(setq persp-emacsclient-init-frame-behaviour-override nil)
|
||||
|
||||
(defun my/switch-to-project-workspace-on-client (frame)
|
||||
"When an emacsclient frame is created, check if a file/folder was passed,
|
||||
and automatically switch to its matching Doom project workspace."
|
||||
(with-selected-frame frame
|
||||
;; Only execute if a target file or directory is actually loaded
|
||||
(when-let* ((target-path (or (buffer-file-name) default-directory))
|
||||
;; Ask Projectile to find if this path belongs to a known project root
|
||||
(project-root (projectile-project-root target-path)))
|
||||
;; Instruct Doom to switch to the project's named workspace
|
||||
(+workspace-switch project-root t)
|
||||
;; Update Projectile's current project state for that workspace context
|
||||
(setq projectile-project-root project-root))))
|
||||
|
||||
;; Hook this function to run every time an emacsclient connection spawns a frame
|
||||
(add-hook 'after-make-frame-functions #'my/switch-to-project-workspace-on-client)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
;;; scratch
|
||||
@@ -314,4 +392,7 @@
|
||||
(emms-insert-url "https://tunes.c2vi.dev/rest/stream.view?u=c2vi&t=59248d02914f93abee797adcf0f14d6a&s=8a3988f950895ee7bd87e17651e65eb1&v=1.16.1&c=infrasonic&f=json&id=0FnN5Sb3mCItKdIiJZcG7x")
|
||||
(message emms-playlist-buffer)
|
||||
|
||||
(+workspace-current-name)
|
||||
(selected-frame)
|
||||
|
||||
)
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
;;lean ; for folks with too much to prove
|
||||
;;ledger ; be audit you can be
|
||||
;;lua ; one-based indices? one-based indices
|
||||
markdown ; writing docs for people to ignore
|
||||
(markdown +grip) ; writing docs for people to ignore
|
||||
;;nim ; python + lisp at the speed of c
|
||||
;;nix ; I hereby declare "nix geht mehr!"
|
||||
;;ocaml ; an objective camel
|
||||
|
||||
@@ -66,3 +66,12 @@
|
||||
:recipe (:host github :repo "systemfreund/supersonic.el" )
|
||||
:pin "8d422489ffc84cc3907232afb51349c576c26cba"
|
||||
)
|
||||
(package! textui
|
||||
:recipe (:host github :repo "yibie/textui")
|
||||
:pin "8b3010d0f251b52dd1867c741d18bf66e405922d"
|
||||
)
|
||||
|
||||
(package! md-mode
|
||||
:recipe (:host github :repo "yibie/md-mode")
|
||||
:pin "d9e7e1d83a8601a9bda2fd604f6a0881a4f9a838"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user