Since I knew that I will be using different IDEs and environments, I decided to learn vim and use vim bindings in all my IDEs to ensure some sort of similarity across all my development environments, but it doesn't cover it all. I've also tried manually migrating my home directory between different computers, but that comes with several issues, primarily that I'd have to try to share it between professional and personal computers. So what I'm left with is basically remembering what I'm using, and then tediously spend a day or more re-configuring newly installed computers with the software and configurations I know I'm using. It feels like I have to throw away my perfectly configured hammer which I know by heart and get a new one every time I work at a different workplace instead of bringing it along and perfecting it further. Surely there's a better way.
How do you keep your development environments/ways of working synced and backed up?
For example, let's say an app has a default keyboard shortcut I don't like. I won't change it. Instead, I'll just get used to it until it becomes muscle memory.
Now the default configurations are my preferred configurations. Of course, there are still a few things I change from the defaults. But since there are so few I can just configure them by hand, because how often am I setting up a new computer? Not very often. And there are so few config changes, it only takes a minute.
The only thing I have to actually sync is my vim config. It's a very small config, but it's still more than nothing. I just store it in a Git repository.
Use the GUI settings panel to make CAPS LOCK an extra ctrl. Takes maybe 10 seconds.
Use same to make dock auto-hide. 10 seconds if I'm slow about it.
Install Homebrew. Maybe 15 seconds hands-on and a couple minutes in the background.
Use Homebrew to install spectacle. Less than 5 seconds hands-on time, done less than a minute later.
Start Spectacle and use its preferences panel to set it to start on boot. Maybe 15 seconds.
Remove all the pinned programs on the dock. 60-90 seconds.
The last one's the only part I've considered scripting, but since I only do it once every couple years at most, it's not really worth it.
Once I'm past a Mac's initial "welcome to Mac" flow and on the actual desktop, I'm only about 5 minutes (not all of it actively doing things) from having a comfortable environment set up and being all ready to install project-specific tools, as needed.
If I ever switch back to Linux (or FreeBSD, which is more likely at this point) I might go back to versioning and backing up a bunch of config and dot files. I need them, there.
Cmd-Opt-D to toggle auto-hiding – I use this one to check if the dock is frozen :)
(Also a great option to rebind: it's a global hotkey so no other app should be using it)
Another fine specimen, salute!
I have even written a short essay, as I found myself repeating the same suggestions many a times. https://notes.oinam.com/digital/apple/
Most configuration stuff doesn’t fit that category - or if it does, it’s best to first work on just caring about it less if possible.
This is the worst advice you could give. There are plenty of shitty defaults and default tastes vary from app to app and there's a reason things are customizable.
Customize to your taste throughout your tools and don't let a new tool eat your time.
Almost every linux box has bash, vim, and the GNU command line tools. If you can become proficient with default config cli tools, you can become proficient on almost any linux box.
I guess my personal strategy is to run with the defaults until you find the pain points, and install/configure something to address them. And put them in git repo if possible.
I don't use any plugins for PyCharm or IntelliJ, but they're pretty full-featured right out of the box. I certainly don't do it as a badge of honor, that indeed is pretty silly.
But vim is useless without any plugins. Even VSCode is only marginally better than Notepad++ unless you give it the plugins necessary to turn it into an actual IDE and not just a code editor.
Deleted Comment
Couple of bits from a guide I wrote recently: https://gist.github.com/aclarknexient/0ffcb98aa262c585c49d4b...
That OSTYPE is great for all those little bits that are unique to each operating system. The zshenv-local is in .gitignore, so you can keep tokens, api keys, etc etc in there. OSTYPE could even be used to import specific files like .zshenv-darwin or .zshenv-linux-gnuIf you're ssh'ing between your hosts, you can use something like this:
It's not fancy and doesn't use cool tools, but my setup works for me just fine.I'm gonna go though your guide later though-- I like quite a bit of what I've skimmed so far. Thanks for posting that.
EDIT: and that "*" for gitignore is intriguing, I'll have to take a better look at that whitelist vs blacklist setup, thank you!
I pull some information from the local keychain and others from 1Password (with `op`; I will be moving most of the rest to 1Password from the keychain). It can run additional scripts _after_ each update (I use it to update my fish plug-in installations if I change `fish_plugins`).
It has integrations with many different password managers so that it is possible truly keep your secrets out of your dotfile configuration and _still_ vary the configuration based on those secrets.
Deleted Comment
I keep my config on Github (latest branch https://github.com/alexghr/nix/tree/host/vader). I'm still new to this so a lot of my config is duplicated across different hosts but I want to refactor it to eliminate duplication.
If you haven't yet, I'd recommend giving Nix/NixOS a try. There's a bit of a learning curve but it's very powerful.
Coming up on my 1 year anniversary with NixOS and couldn't be happier, even though it has taken quite some time to adjust to (and I still barely know the language).
Having one place for all configurations is such a breath of fresh air, and having my work & home PC being identical (even Gnome is declaraticely configured!) is so nice.
Before NixOS, I resented using my private PC because it was never up to date with what I had configured on my work PC, but now that's just a "git pull && nixos-revuild switch --flake ." away - regardless of what has changed.
I will never, ever, use anything that doesn't behave like NixOS again. It is a sea-change.
Is the language weird? Oh yes. Is the documentation scattered? Quite. It's all worth it.
If the love of your live spoke a different native language, you'd learn it.
Stick to defaults? Hell no. Own your computing life.
If you're trying to do something with Nix and it works, neat.
If you're trying to do something and can't get it to work, you'll have a very difficult time. (It demands a depth of understanding, and Nix is a bit weird).
Hopefully in future, "documentation", "blogposts from randoms", etc. help alleviate that pain as more people use it.
I use it on windows, Debian, macos and even Chromebooks and don't have to worry about any kind of syncing. It just works
It has a built in settings sync thing, but as a general rule I strongly strongly avoid the use custom settings (in anything) to avoid the issue you are facing. There is in my experience a huge productivity gain to be had by just being pragmatic and using (and knowing) defaults in everything you use frequently, and not being a useless prima dona if your custom key bindings are missing from every single machine you need to use each day/week/month/year. We jump around servers and computers frequently, so I find it is easiest and most productive to just go with the flow and use the defaults so I can be working immediately as soon as I SSH into a new host or am given a new laptop to use for a 3 week long contract or whatever.
The files you're managing don't even need to be text, though, of course, it makes versioning, etc. a lot easier.
I also check the host name in some of the scripts to modify behavior depending on the machine.
I did a write-up about my whole setup (emphasis on GNU Stow + Git) here:
https://ratfactor.com/setup2
[1]: https://syncthing.net/
But there were a few problems with it: - installed packages needed to be managed separately (the mechanisms for which varied by platform) - managing differing configs for different machines (e.g. headless servers, hardware quirks) was done by managing different branches of this repo and rebasing, which was a pain - it was generally brittle and hard to change
I've started to use https://nixos.org/ and it's been like night and day: https://github.com/RyanGibb/nixos/
My config is version controlled, reproducible, manages packages, and is very composable.
Using the nix package manager and https://github.com/nix-community/home-manager this should work on other Linux distributions, MacOS, and even Windows Subsystem for Linux. Although I haven't tried this for myself yet.
The install script and configuration works on macOS and Linux, but sometimes requires updating when running on a new machine (like recently when provisioning a new M1 Max MacBook Pro). At one point I had it installing default packages (particularly a lot of stuff from Homebrew), but ultimately moved away from that because I realized it just kept too much old unused cruft hanging around.
I also have my configuration files setup so that it can be used for work or personal machine. For example, my .gitconfig includes another config when in the ~/work directory:
https://github.com/sethdeckard/dotfiles