The Basics of Dotfiles
Вставка
- Опубліковано 22 сер 2024
- In this video, I introduce the concept of "dotfiles" and explain why they are an integral part of crafting your system configuration. We also discuss how you might want to think about managing and sharing your dotfiles!
My Emacs configuration: github.com/dav...
If you enjoy this series, please consider becoming a sponsor on GitHub or Patreon:
- github.com/spo...
- / systemcrafters
You can also leave a tip via PayPal: paypal.me/daviwil
Follow me on Twitter for more Emacs content!
/ systemcrafters
Chat with the System Crafters community on Discord: / discord
Intro music: Coriolis Effect by logos feat. stefsax, licensed CC-BY
ccmixter.org/fi...
This may sound dumb, but it's worth putting it out there for people who are new to dotfiles and Linux:
~/.ssh is NOT a dot file directory that you want to put on GitHub or share in any way
Again this may sound silly for people who are experienced with Linux, but I've definitely done some dumb stuff myself in my early days of website design (like push a file with my DB password onto a public GitHub repo)
Do you have a patreon tier where we get access to download all this Emacs knowledge directly from your brain?! Best Emacs content on youtube hands down!
Instead of GNU stow, I have found that using git bare repositories are simpler to manage. They act as if your home folder was a git repo, but with a hidden folder other than .git to store the data in it. This means that any other git repos under your home folder will not get affected and you will not have to manage submodules, and you also will never have to worry about symlinking.
I think its better to setup a normal git repository and add a .gitignore file in which you ignore everything with '/*' and then setup.ehat you dont want to ignore, you do so like this:
!.config/*
!.emacs.d/*
Etc
@@unstable8968 you are supposed to ignore everything on a bare git repo. the difference is that with the git bare repo you are setting your home as your working directory, with your version you are replicating the working directory.
Pro tipp: version your dotfiles with git.
Proer tipp: have a remote git repo for pushing your dotfiles.
Proest tipp: have a separate staging area (e.g. "~/.staging/testing") to test your changes before committing them in your actual (/productive) home directory, like so: "$ env HOME=~/.staging/testing bash -i".
You can replace "bash -i" with a particular programm, like "vim" or "emacs" or whatever, if you want to test only that one programs' config changes. However "bash -i" opens a shell and you can always run "vim", "emacs" or whatever from there, so it's not wrong to just leave it at "bash -i" (or whatever shell you prefer).
Proesterous tipp: you could even have two separate remote git repos (one test, one prod), where you develop outside your HOME dir, push your results into the testing repository, then you could configure your ~/.staging/testing/ (which is just a normal working dir git repo) to pull from your (remote) testing repo, do your tests, when tests are successfull, you can push from inside your ~/.staging/testing/ to your remote prod repository, and finally ... now it is save to pull from inside your real HOME from the prod repository.
Why bother with all this overly complicated stuff? I have absolutely NO idea... but I heard from "some friend" that they locked themselves out once from a bug in their .bashrc... NOT ME!
Because such noobish mistakes would never happen to me, NOR you. Right? Fo shizzle!
or just have a different user as a testing environment on your own machine, you could start two graphical sessions, one with your productive user and another with the testing user in Ctrl+Alt+8
Wow, this was really helpful! Thanks a lot mate! :D You really explained well what dotfiles are and how you can use them with different use case scenarios. This really helped me understanding them in a better way.
Other videos often give just a very brief explanation and then start to teach how to manage them. Which is great, but it doesn't tell you in depth what the dotfiles are and what you can do with them.
Thanks a lot! :D
Your live stream series about building an Emacs config from scratch brought be back to Emacs after several years. I enjoyed it many years ago and loved Org Mode, but never took the time to set it up again. It's also the first time I ever got literate programming working. Thanks so much for making it so easy to understand. Keep doing what you do, I can't wait to see your solution to a dot files repo. I've tried this in the past and failed, so I can't wait to see how you solve some of these issues.
Very glad to hear the videos helped! If you remember what kind of trouble you ran into while setting up your dotfiles repo, I'd love to hear about it so that I make sure I cover it in the next videos.
@@SystemCrafters I couldn't figure out a good layout. To folder and symlink or just create the Git repo in the root of the home folder. There are downsides to both (gitignore Hell or dumping Hell, that is the question). I finally started keeping them in a folder then sourcing them from the home folder files, but that's not as automated or simple as I would like. I look forward to seeing your solution in general really, I'm sure you have a better method than me.
Awesome video! Continue this series.
One thing I tried many times, but failed is, to put my dot files under version control and then extract it to proper locations (file paths) when needed (eg. reinstall OS) . So, Looking forward towards the next video.
Great video! I usually keep my dotfiles git repo in a seperate directory (usually ~/src/dotfiles) and have a bash script symlink the files to their respective locations. Do you know if there are any disadvantages of using this method?
That's what I do. Managing symlinks works well, but it can be a pain to do it yourself. Other tools like GNU Stow can help with it, I'll cover that in another video!
Thx a lot! 💪 Good content! 🤓
Hi, are you using a terminal file manager? if so, which one is that?
Nice video!
haha 😅 i thought first a dotfile that is graphviz.
I do save my dot files on a repo especially .emacs and few others
I'm not sure I understood correctly the proper way to store dotfiles. So let's say, I created git repo at dotfiles directory, where I store all my configs, how do I then should put everything into proper folders? Should I do this manually (i.e. copy config.py to .config/qtile/config.py, .nethackrc to ~/home/user/.nethackrc) or there is some smart automated way?
We will cover this next Wednesday!
you don't use inputrc?
Frankly I didn't know it existed! Looks pretty useful though. Anything special you put in yours?
"\C-]":"''\C-b"
"\C-[":"{}\C-b"
"\C-v": '\C-a