Keeping backups of every edited file
I recently ran
rm -rf * in my home directory, which apart from being very foolish, reminded me that I have backups of basically every file I’ve edited:
I was just introduced to a tool called Delta which is a pager you can use with Git to give you Github-esque diffs.
Hopefully the docstring explains this well enough:
Handy function to export environment variables to Emacs from the command line:
Yadm’s an amazing dotfile manager that’s basically a thin wrapper around git and a bare repo. With it being a bare repo, you’ll not be able to manage it directly with Magit so here’s a really smart tip I found that will let you access it via Tramp:
To load a random emacs theme on startup (I restart daily) you can use the following snippet. Just add your theme as a new function to
funs. If you don’t restart often, you could add a timer to change themes while you’re going.
Here’s a little evil operator that will fill in the first part of an evil/ex substitution with the region / visual / object. This allows you to replace objects quickly without having to type out the ex command in full.
If you’re in a monorepo searching through stuff can be a bit chaotic. Here’s a way of narrowing down to specific file extensions with
If ever I’m writing a chunk of text that will change a lot over time, I like to use this script to make sure I have a constant record of what has changed over time. Combined with your equivelent of git-timemachine, it’s really handy for looking back at progression or finding where you might have gone wrong. 🙂
On a widescreen monitor, especially the really wide ones, it’s nice to have only vertical splits. This snippet will give bias to vertical splits: