This package provides a seamless way to interact with your Dropbox files directly within Emacs. It aims to offer a simple and efficient user experience by leveraging Dired for file management and employing asynchronous operations with caching for improved responsiveness.
While other clients like pavpanchekha/dropbox.el exist, this package was developed to address my personal needs, anyone else can take it as an alternative approach.
Put the dropbox.el into your load-path. Or using use-package like this:
(use-package dropbox
:vc (:url "https://github.com/lorniu/dropbox.el"))
(use-package dropbox
:vc (:url "https://github.com/lorniu/dropbox.el")
:config
(setq dropbox-config-file "~/.dropbox")
(setq dropbox-http-backend (pdd-curl-backend)))Before you can access your Dropbox files, you need an auth configuration file (dropbox-config-file):
- The
~/.dropboxgenerated bydropbox_uploader.shcan be reused, it's compatible. Do nothing if it exists - If you don't have a
~/.dropboxfile, runM-x dropbox-gen-config, following the guide to generate one
Once authenticated, you can interact with your Dropbox files.
- Open Remote Path: Use
M-x find-file(C-x C-f) with the special/db:prefix to open a remote Dropbox directory or file.- Example:
C-x C-f /db:/Apps/MyEmacsApp/notes.org - Example:
C-x C-f /db:/Photos/2023/
- Example:
- Search and Open: Use
M-x dropbox-findto search for a file in your Dropbox and open it directly.
Remote files are opened in local Emacs buffers. Edit the buffer as you normally would. When you save the buffer (C-x C-s), the changes are automatically uploaded and synchronized with the remote file on Dropbox.
When you open a remote Dropbox directory (e.g., /db:/path/to/folder/), it will be displayed in Dired mode. You can perform many standard Dired operations, which will be applied to your remote Dropbox files. e.g.:
+: Create a new directory on DropboxC-x C-f path-not-exist.txt: Create new file (sync when save)RET: Open current file at point- With prefix
C-u, open and cache to disk. The next time it will be opened from cache directly - Some files (according to
dropbox-cache-disk-url-regexp) will auto cached into disk when be opened - Delete the cache on disk with
dropbox-clear-cache-on-diskif necessary (with prefixC-uto clear all)
- With prefix
C: Copie file or directory between Dropbox and local- File copy from remote to local is also called
download, from local to remote is also calledupload - Directory copy from remote to local and named as
*.zip, will be auto compressed and downloaded as a single file
- File copy from remote to local is also called
R: Rename or move files/directories. The logic is similar to the C (Copy) commandD: Delete the marked remote file(s) or directory
dropbox-browser: Open the current Dropbox directory (or your Dropbox root if not in a Dropbox Dired buffer) in your default web browser.dropbox-revisions: In a Dired mode or a remote file buffer, invoke this command will popup a buffer to view and operate the revisions (diff, download, restore and so on).dropbox-shared-link/dropbox-shared-link-revoke: Generate/revoke a link for current remote file/dir, which can be shared with others.dropbox-download-link: Generate a temporary link for current remote file, which can be used by download tool likecurl.
Issues and PRs are welcome. Enjoy.