Switch out Dropbox for Syncthing in entire Emacs config
This commit is contained in:
parent
9094f49bc7
commit
608cf1a651
@ -841,23 +841,20 @@ Whenever the buffer changes, look up the major-mode to see if there is any code
|
||||
'((undo discard-info)))
|
||||
#+END_SRC
|
||||
|
||||
* Dropbox
|
||||
* Syncthing
|
||||
I put lots of stuff in Dropbox, but the actual folder location differs on my different computers. This function resolves to the Dropbox directory:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun get-dropbox-directory ()
|
||||
(cond
|
||||
((file-exists-p (expand-file-name "~/Dropbox (Personal)"))
|
||||
(expand-file-name "~/Dropbox (Personal)"))
|
||||
(t (expand-file-name "~/Dropbox"))))
|
||||
(defcustom syncthing-path (expand-file-name "~/Sync")
|
||||
"The absolute path to the Syncthing directory"
|
||||
:type 'directory)
|
||||
|
||||
(defun syncthing-directory (&optional path)
|
||||
(f-join syncthing-path (s-chop-prefix (f-path-separator) (or path ""))))
|
||||
#+END_SRC
|
||||
|
||||
Load up libraries from Dropbox, if there are any:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(add-to-list 'load-path
|
||||
(concat
|
||||
(file-name-as-directory (get-dropbox-directory))
|
||||
"site-lisp"))
|
||||
(add-to-list 'load-path (syncthing-directory "site-lisp"))
|
||||
#+END_SRC
|
||||
|
||||
* Init File
|
||||
@ -1504,12 +1501,9 @@ Notes, agenda, calendar, blogging, journaling, etc.
|
||||
|
||||
A function to get my org directory:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defvar syncthing-path (expand-file-name "~/Sync")
|
||||
"The absolute path to the Syncthing directory")
|
||||
|
||||
(defun org-directory (&optional path)
|
||||
"Returns the directory for my org notes, appends PATH if given"
|
||||
(f-join syncthing-path "org" (s-chop-prefix (f-path-separator) (or path ""))))
|
||||
(f-join (syncthing-directory "org") (s-chop-prefix (f-path-separator) (or path ""))))
|
||||
#+END_SRC
|
||||
|
||||
|
||||
@ -4830,8 +4824,8 @@ YASnippet is Yet Another Snippet template system.
|
||||
(unless (file-exists-p (expand-file-name "~/.emacs.d/snippets"))
|
||||
(mkdir (expand-file-name "~/.emacs.d/snippets") t))
|
||||
(setq yas-snippet-dirs
|
||||
`(,(concat (file-name-as-directory (get-dropbox-directory)) "yasnippet")
|
||||
,(expand-file-name "~/.emacs.d/snippets")))
|
||||
`(,(syncthing-directory "yasnippet")
|
||||
,(expand-file-name "~/.emacs.d/snippets")))
|
||||
(yas-global-mode))
|
||||
|
||||
(use-package yasnippet-snippets
|
||||
@ -5162,9 +5156,9 @@ The Emacs Multi-Media System. For libtag to work, libtag must be installed on th
|
||||
(emms-default-players)
|
||||
(require 'emms-info-libtag)
|
||||
(setq emms-info-functions
|
||||
'(emms-info-libtag)
|
||||
emms-source-file-default-directory
|
||||
(concat (get-dropbox-directory) "/music"))
|
||||
'(emms-info-libtag)
|
||||
emms-source-file-default-directory
|
||||
(syncthing-directory "/music"))
|
||||
(jdormit/define-prefix "ae" "emms")
|
||||
(with-eval-after-load 'evil
|
||||
(add-to-list 'evil-emacs-state-modes 'emms-browser-mode))
|
||||
@ -5181,8 +5175,8 @@ The Emacs Multi-Media System. For libtag to work, libtag must be installed on th
|
||||
(leader-def-key "aed" 'emms-play-directory-tree)
|
||||
(when (eq system-type 'darwin)
|
||||
(define-emms-simple-player afplay '(file)
|
||||
(regexp-opt '(".mp3" ".m4a" ".aac" ".m4p"))
|
||||
"afplay")
|
||||
(regexp-opt '(".mp3" ".m4a" ".aac" ".m4p"))
|
||||
"afplay")
|
||||
(setq emms-player-list `(,emms-player-afplay))))
|
||||
#+END_SRC
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user