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)))
|
'((undo discard-info)))
|
||||||
#+END_SRC
|
#+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:
|
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
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defun get-dropbox-directory ()
|
(defcustom syncthing-path (expand-file-name "~/Sync")
|
||||||
(cond
|
"The absolute path to the Syncthing directory"
|
||||||
((file-exists-p (expand-file-name "~/Dropbox (Personal)"))
|
:type 'directory)
|
||||||
(expand-file-name "~/Dropbox (Personal)"))
|
|
||||||
(t (expand-file-name "~/Dropbox"))))
|
|
||||||
|
|
||||||
|
(defun syncthing-directory (&optional path)
|
||||||
|
(f-join syncthing-path (s-chop-prefix (f-path-separator) (or path ""))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Load up libraries from Dropbox, if there are any:
|
Load up libraries from Dropbox, if there are any:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(add-to-list 'load-path
|
(add-to-list 'load-path (syncthing-directory "site-lisp"))
|
||||||
(concat
|
|
||||||
(file-name-as-directory (get-dropbox-directory))
|
|
||||||
"site-lisp"))
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
* Init File
|
* Init File
|
||||||
@ -1504,12 +1501,9 @@ Notes, agenda, calendar, blogging, journaling, etc.
|
|||||||
|
|
||||||
A function to get my org directory:
|
A function to get my org directory:
|
||||||
#+BEGIN_SRC emacs-lisp
|
#+BEGIN_SRC emacs-lisp
|
||||||
(defvar syncthing-path (expand-file-name "~/Sync")
|
|
||||||
"The absolute path to the Syncthing directory")
|
|
||||||
|
|
||||||
(defun org-directory (&optional path)
|
(defun org-directory (&optional path)
|
||||||
"Returns the directory for my org notes, appends PATH if given"
|
"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
|
#+END_SRC
|
||||||
|
|
||||||
|
|
||||||
@ -4830,8 +4824,8 @@ YASnippet is Yet Another Snippet template system.
|
|||||||
(unless (file-exists-p (expand-file-name "~/.emacs.d/snippets"))
|
(unless (file-exists-p (expand-file-name "~/.emacs.d/snippets"))
|
||||||
(mkdir (expand-file-name "~/.emacs.d/snippets") t))
|
(mkdir (expand-file-name "~/.emacs.d/snippets") t))
|
||||||
(setq yas-snippet-dirs
|
(setq yas-snippet-dirs
|
||||||
`(,(concat (file-name-as-directory (get-dropbox-directory)) "yasnippet")
|
`(,(syncthing-directory "yasnippet")
|
||||||
,(expand-file-name "~/.emacs.d/snippets")))
|
,(expand-file-name "~/.emacs.d/snippets")))
|
||||||
(yas-global-mode))
|
(yas-global-mode))
|
||||||
|
|
||||||
(use-package yasnippet-snippets
|
(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)
|
(emms-default-players)
|
||||||
(require 'emms-info-libtag)
|
(require 'emms-info-libtag)
|
||||||
(setq emms-info-functions
|
(setq emms-info-functions
|
||||||
'(emms-info-libtag)
|
'(emms-info-libtag)
|
||||||
emms-source-file-default-directory
|
emms-source-file-default-directory
|
||||||
(concat (get-dropbox-directory) "/music"))
|
(syncthing-directory "/music"))
|
||||||
(jdormit/define-prefix "ae" "emms")
|
(jdormit/define-prefix "ae" "emms")
|
||||||
(with-eval-after-load 'evil
|
(with-eval-after-load 'evil
|
||||||
(add-to-list 'evil-emacs-state-modes 'emms-browser-mode))
|
(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)
|
(leader-def-key "aed" 'emms-play-directory-tree)
|
||||||
(when (eq system-type 'darwin)
|
(when (eq system-type 'darwin)
|
||||||
(define-emms-simple-player afplay '(file)
|
(define-emms-simple-player afplay '(file)
|
||||||
(regexp-opt '(".mp3" ".m4a" ".aac" ".m4p"))
|
(regexp-opt '(".mp3" ".m4a" ".aac" ".m4p"))
|
||||||
"afplay")
|
"afplay")
|
||||||
(setq emms-player-list `(,emms-player-afplay))))
|
(setq emms-player-list `(,emms-player-afplay))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user