[Emacs] Better keybinds, Emacs no longer clears MPD playlist

This commit is contained in:
Lucien Cartier-Tilet 2021-11-09 13:39:34 +01:00
parent adc84818b1
commit c3f70f3e6d
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
1 changed files with 14 additions and 7 deletions

View File

@ -583,14 +583,23 @@ to the right or below the current window (respectively), but also to
focus the new window immediately. focus the new window immediately.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun split-window-right-and-focus () (defun split-window-right-and-focus ()
"Spawn a new window right of the current one and focus it."
(interactive) (interactive)
(split-window-right) (split-window-right)
(windmove-right)) (windmove-right))
(defun split-window-below-and-focus () (defun split-window-below-and-focus ()
"Spawn a new window below the current one and focus it."
(interactive) (interactive)
(split-window-below) (split-window-below)
(windmove-down)) (windmove-down))
(defun kill-buffer-and-delete-window ()
"Kill the current buffer and delete its window."
(interactive)
(progn
(kill-this-buffer)
(delete-window)))
#+end_src #+end_src
*** ~phundrak/toggle-org-src-window-split~ *** ~phundrak/toggle-org-src-window-split~
@ -1952,9 +1961,12 @@ configuration [[file:mpd.org][here]]).
(emms-all) (emms-all)
(add-to-list 'emms-info-functions 'emms-info-mpd) (add-to-list 'emms-info-functions 'emms-info-mpd)
(add-to-list 'emms-player-list 'emms-player-mpd) (add-to-list 'emms-player-list 'emms-player-mpd)
(emms-player-mpd-sync-from-mpd)
(emms-player-mpd-connect) (emms-player-mpd-connect)
(add-hook 'emms-playlist-cleared-hook #'emms-player-mpd-clear)
<<emms-media-hydra>> <<emms-media-hydra>>
(defun emms-player-toggle-pause ()
(interactive)
(shell-command-and-echo "mpc toggle"))
:custom :custom
((emms-source-file-default-directory (expand-file-name "~/Music")) ((emms-source-file-default-directory (expand-file-name "~/Music"))
(emms-player-mpd-server-name "localhost") (emms-player-mpd-server-name "localhost")
@ -5757,12 +5769,7 @@ Undefining some stuff to make keybind prefixes work correctly.
"w8" '(winum-select-window-8 :wk nil) "w8" '(winum-select-window-8 :wk nil)
"w9" '(winum-select-window-9 :wk nil) "w9" '(winum-select-window-9 :wk nil)
"wb" '((lambda () "wb" #'kill-buffer-and-delete-window
(interactive)
(progn
(kill-this-buffer)
(delete-window)))
:wk "Kill buffer and window")
"wd" #'delete-window "wd" #'delete-window
"wo" #'other-window "wo" #'other-window
"wD" #'delete-other-windows "wD" #'delete-other-windows