Emacs' Org-Mode and Syncthing = Perfect (2017)
hiepph.github.io
hiepph.github.io
Last time, I configured a Receive only folder in device Y, but forgot to mark it as "shared to device Y" in device X's settings.
Net result: directory erased in device Y.
Sure, I still had the copy in device X, but that was gigabytes that needed copying around, a couple hours of wasted time. It's just mind boggling that Syncthing would happily go around deleting thousands of files without warning specially with a minor config error .
That only happened to me once (when I was initially setting up Syncthing), but even once is too often for something like this.
The incredible part for me is that there was no clear indication in the UI that I was doing something destructive, I only realized that Syncthing was destroying my files because I was manually keeping an eye on it through my file browser. Surely deleting local files should require the user to first confirm using large warnings and red buttons?!
I sync my org files using a low-tech solution: I have a .dir-locals file that injects a post-save hook that automatically commits changes to git and pushes them to the remote. It's stupid, but it works, and I never have to think about it.
I do take regular backups to Blu Ray optical disks 'just in case' but have yet to have need of them.
The implementation of the actual sync is pretty good (I never had a problem with it).
But, the UI is not intuitive at all. Its hard to setup a new sync, and if you're not careful you can set it up in a way that deletes all your files without any warning.
Software UI is hard, that's it.
If anything, it is the UI of Synctying that allows me (sometimes) to try and protect some directories.
When the same thing happens with Dropbox, all my computers automatically lose all files because there is no way to force a one directional sync to one specific directory.
I have a git alias setup called "git autopush" that adds all, commits with a generic "[autopush]" message, and pushes to the upstream remote. I use this for my repos of "running" files like org files etc. I've modified it recently to require a config param to explicitly enable it because I'm afraid of typing it in work repos :)
If you add Orgzly to the mix for mobile access, you also want to configure Orgzly to auto-save whenever you open it or make changes.
With these two adjustments this becomes a pretty good setup.
(global-auto-revert-mode 1)
(and thanks to the GP as well, of course!)
I'm gonna need a minute.
(heh)
(setq auto-revert-interval 1)
Found in https://www.gnu.org/software/emacs/manual/html_node/emacs/Re...
It was a frustrating experience, because basically ~once a day I'd have to manually fix diffs on each side.
I am always interested in seeing what else is out there for organizing, glad to see org mode is still popular!
Yes, inline images are an important part of rich documents. I'm not sure what you're looking for in terms of images, but I've written this function which allows you to paste images directly from the clipboard into documents:
1. You have a linked list of states with your current state:
A->B->C->D->(E)
2. Pressing undo moves you to earlier states. Once: A->B->C->(D)->E
Twice: A->B->(C)->D->E
Doing anything that isn’t undoing again will add your undoings to the history: A->B->C->D->E->D->(C)
So now when you undo you in some sense redo what you had preciously undone, then undo it again, then undo further.The advantage is that you never lose history by undoing. The disadvantage is that it can be confusing.
Undo in region complicates this.
Undo-tree's navigation interface isn't a pinnacle of intuitiveness, however.
A -> B -> C -> D
Undo: A -> B
Make some other changes: A -> B -> E
Then undo takes you up the ABE chain but if you use g- and g+, you navigate through the list ABCDEThose are the operations, yeah! They went a long way for me. I think there's also a command or a third-party addon to see the undo states, in the undo-tree spirit—but surprisingly I've never needed it.
What's the benefit of Syncthing? I know nothing about it.
Not needing a service/server is probably the main benefit, compared to stuff like Dropbox or Nextcloud.
I took the time to configure Dropbox from the command line on my headless Linode, and while it's not foolproof -- which is at this point probably on me, since I don't have it running as a proper init or whatever -- it's so far Good Enough, and as such I'm not super convinced going to a secondary sync tool is useful to me.
(I mean, since I already rely on Dropbox to manage sync of a broader set of files between 3 other computers + my iOS devices.)
----------
[1] https://play.google.com/store/apps/details?id=com.nutomic.sy...
[2] https://play.google.com/store/apps/details?id=com.github.cat...
EDIT: Fork looks really good too, I've installed it to check.
On top of that, afaik the original is rather sparsely developed and released.
I'm actually curious to hear from other vim to emacs org-mode converts since the article didn't elaborate on the cons and pros of the switch. How significantly is org-mode better than vimwiki and is it worth exploring for someone who's been baking in vim ecosystem for a decade?
Having "real" spreadsheet like tables within my wiki does look appealing. I do in fact already have a bunch of small spreadsheets doing some very basic stuff, and it does make more sense for them to be within the wiki itself.
Another combination that works really well for me is the pass Password store¹ and Syncthing to share some passwords with another user.
I have pass set up to have a subdirectory shared with my partner (by registering both our GPG-keys in a .gpg-id file in that directory), and that subdirectory is synched by Syncthing to our devices.
So now we can store shared accounts there, and have them available in our respective password managers.
I can't recommend it enough.
> Multiple GPG keys can be specified...
Some great guides:
I highly recommend Doom Emacs [2] and Zaiste Programming’s DoomCasts playlist on YouTube [3] to those just getting started.
[1] https://docs.nextcloud.com/server/15/admin_manual/configurat...
[2] https://github.com/hlissner/doom-emacs
[3] https://www.youtube.com/playlist?list=PLhXZp00uXBk4np17N39Wv...
If you just want a cheap Markdown editor with instant syncing, I recommend self-hosted CodiMD. Of course that’s not an option if you actually want the full power of org-mode.
On macOS FSEvents or kqueue can be used, I’m not sure which one is used. They are definitely using a notification mechanism though, otherwise changes won’t even happen in 15s.
According to https://docs.syncthing.net/users/syncing.html
> There are two methods how Syncthing detects changes: By regular full scans and by notifications received from the filesystem (“watcher”). By default the watcher is enabled and full scans are done once per hour.
Is your script available somewhere? Is it just a simple "echo org-stuff >> capture.org"?
There isn’t an alternative for that particular user case without dual-syncing with another sync provider. Best I can tell, there are zero iOS apps of any kind with SyncThing support.
You can (and I have) configure SyncThing to track and sync changes within the iCloud app directory corresponding to BeOrg. It definitely feels janky and I worry about file corruption.
I now use a combination of Orgzly, Dropbox, Tasker and Emacs to keep my desktop and mobile notes in sync and it works great.
The benefits are: plaintext/markdown (org-mode), automatic backup with restore (dropbox), open source or free apart from I think a couple of pounds for Tasker and of course whatever you are paying for dropbox. Plus, unlike Syncthing, only 1 version of a to-do list file at any one time, so less conflicts. Wider benefit of to-do list customisation limited only by your imagination and patience, via emacs lisp.
My various To-do lists (split according to the Eisenhower Matrix) are saved in a dropbox folder.
My Orgzly app is set to read from that dropbox folder: Settings > Sync > Repositories > Connect to dropbox
My Tasker is set up as Tasker > Tasks > New '+' > Enter Name > New '+' > Code > Run Shell
Copy and paste into Command field:
am start-foreground-service --user 0 -a
com.orgzly.intent.action.SYNC_START
com.orgzly/com.orgzly.android.sync.SyncService
You can also set a helpful notification via Alert > Notify > Title
Then in Profiles I set the task to run
- Every hour
- Whenever Orgzly is opened or closed
- Whenever the phone display is switched on or off
Takes about 2 seconds to sync, whenever triggered.
One problem with my device (Huawei) is the very aggressive battery optimisation which simply can't be turned off via their settings. You can fix this by going in via ADB as follows:
adb shell pm uninstall --user 0 com.huawei.powergenie (thanks to https://dontkillmyapp.com/huawei)
You may need to use ./adb (thanks to https://stackoverflow.com/questions/7609270/not-able-to-acce...)
and Settings > System > Dev options > dev options switch on (thanks https://www.xda-developers.com/install-adb-windows-macos-lin... )
... It's crazy that in 2020 I have to set all this up for a smooth experience. What I really, really want is an org-mode compatible (I'd live with regular markdown) web app with offline access and auto-sync, accessible from my mobile device and desktop browser and customisable or just any sane keyboard shortcuts. If free or open-source in Vue.js or React + Firebase even better.