Browse Source

Added convenient sublime-like desktop management

master
Macoy Madson 4 years ago
parent
commit
6b970e2fa9
  1. 29
      Emacs/emacsConfig.txt

29
Emacs/emacsConfig.txt

@ -421,9 +421,32 @@
;; Use swiper for search instead of isearch (use e.g. space to fuzzy search)
(global-set-key (kbd "C-f") 'macoy-swiper-search-mark)
;; "Desktops" replace sublime workspaces. This makes it easier to switch desktops
;; This causes an annoying "desktop already registered" prompt. Fucking stupid
;;(desktop-registry-auto-register 1)
;;
;; Faster desktop creation/switching
;;
(setq macoy-desktop-dir "~/.emacs.d/macoy-desktops/")
(unless (file-exists-p macoy-desktop-dir)
(make-directory macoy-desktop-dir)
)
(defun macoy-save-desktop (new-desktop-name)
"Save a desktop to the desktop registry for easy switching"
(interactive "sNew desktop name:")
(let ((new-desktop (concat macoy-desktop-dir new-desktop-name)))
(make-directory new-desktop)
(desktop-save new-desktop)
(message "Created desktop at %s" new-desktop)
))
(defun macoy-switch-desktop ()
"Use ido to list desktops to switch to"
(interactive)
(desktop-change-dir
(concat macoy-desktop-dir
(ido-completing-read "Desktop:"
(remove "."
(remove ".."
(directory-files macoy-desktop-dir)))))))
;; Open file in explorer
(defun browse-file-directory ()

Loading…
Cancel
Save