How to Create a Dotfiles Folder

  Рет қаралды 20,840

System Crafters

System Crafters

3 жыл бұрын

In this video, I'll show you how you can create a dotfiles folder and move important configuration files there. We'll also learn how to set up symbolic links back to the original file locations so that your programs can find their configuration files. This prepares us to learn how to manage and share our dotfiles with Git in the next episode!
Show notes: github.com/daviwil/emacs-from...
Check out the previous video "The Basics of Dotfiles" if you haven't already: • The Basics of Dotfiles
My Emacs configuration: github.com/daviwil/dotfiles/b...
If you enjoy this series, please consider becoming a sponsor on GitHub or Patreon:
- github.com/sponsors/daviwil
- / 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/files/mseq/26296

Пікірлер: 55
@EricT43
@EricT43 5 ай бұрын
It's surprised me how hard it has been to find a video that simply and clearly explains how to set up the dotfiles repo and get the files linked to the right places. Thanks!
@agostinobarbetti3819
@agostinobarbetti3819 3 жыл бұрын
That is the next step i need to do, this is very helpful. Two things that stop me are manage dotfiles and Git. Thank you for your videos about manage configuration and also your Emacs videos.
@ste_ph_en9018
@ste_ph_en9018 2 жыл бұрын
i'm glad i'm not the only one that keeps getting the order of symbolic links mixed up.
@alexdelgado186
@alexdelgado186 3 жыл бұрын
Thanks a lot man, being thinking of something like this for some weeks now
@vp275
@vp275 3 жыл бұрын
Any plans on continuing the dot files series ? Would love to see how you manage gnu stow.
@SystemCrafters
@SystemCrafters 3 жыл бұрын
I'll try to get back to it soon!
@user-ol4vs4ml8g
@user-ol4vs4ml8g Жыл бұрын
Thanks! Very cool!
@diegonayalazo
@diegonayalazo 2 жыл бұрын
Thanks David!
@edilmedeiros
@edilmedeiros 3 жыл бұрын
Very instructive, there will be other videos on this series?
@ruijieyu9035
@ruijieyu9035 2 жыл бұрын
10:00 linux version of ln supports -r flag that helps make relative symlinks; and -T flag for situations like the time stamp when linking should fail instead of creating a symlink at a wrong location.
@gksudolol
@gksudolol 3 жыл бұрын
Hey David, the way I manage my dotfiles is by creating a git bare repository in my home folder and setting an alias like: alias config="/usr/bin/git --git-dir=$HOME/dotfiles/.git/ --work-tree=$HOME" And then add files to the repository with: config add filename.txt, commit with: config commit, etc. This eliminates the need to create symlinks of all the files
@SystemCrafters
@SystemCrafters 3 жыл бұрын
Thanks! I'm planning to cover the bare repository approach in the future, so that was helpful.
@gksudolol
@gksudolol 3 жыл бұрын
@@SystemCrafters You're welcome, loving the videos so far- thank you
@AndersJackson
@AndersJackson 3 жыл бұрын
I was looking for this, so now I don't need to write this myself. :-)
@wackenalt878
@wackenalt878 3 жыл бұрын
can you use the bare repository with magit somehow, i also use a bare one and could not yet figure out, who it should work
@outragedline
@outragedline Жыл бұрын
Saved me, thanks
@Paxsali
@Paxsali 3 жыл бұрын
When you use "$ ln -sf ~/path symlink", the "~/" part is being translated into a fully qualified / absolute path, e.g. /home/crafter/... IDK if you want that in every case though (chroots, backup&restore or copying to another system ... other niche use cases). It would be better to cd to $HOME first, then use relative symlinking, i.e.: $ ln -sf .dotfiles/.config/mpv .config/mpv and so forth... but it's a minor point, really. There's nothing "wrong" about the way you do it. But if you do it the "truely relative" way, nothing can go wrong in any case, no matter what.
@SystemCrafters
@SystemCrafters 3 жыл бұрын
Good point, thanks for pointing that out!
@PoeLemic
@PoeLemic 9 ай бұрын
@@SystemCrafters Yes, I was confused why he didn't put "/mpv" on the end of that command, because I sure would have. But, it looks like it worked -- like @Paxsali said.
@MrOlegrom
@MrOlegrom 3 жыл бұрын
thank you! very useful! which is the next video?
@agataerminiapennisi5504
@agataerminiapennisi5504 3 жыл бұрын
Thanks ... 😀
@MarkusGraf2
@MarkusGraf2 3 жыл бұрын
The order of the arguments of "ln" used to confuse me, too. It helps me to think of them as "cp" and "mv" for the arguments to make sense. ymmv.
@AndersJackson
@AndersJackson 3 жыл бұрын
That is how I remember the command arguments too. The source(es) are first and last is the destination. It there are many sources, the last must be a directory. Which make it all make sense in mv(1), cp(1) and ln(1).
@JeanNoelAvila
@JeanNoelAvila 3 жыл бұрын
You have to remember that "ln" can create several links on the same file, so in order for the command to be extensible, the target comes first, then all the created links are listed after.
@satoristeve
@satoristeve 3 жыл бұрын
Is there a reason you prefer to create a .dotfiles folder versus creating folders in .config? E.g., a .config/zsh for your .zshrc, etc. Or is it just personal preference?
@bunnysuitlewds126
@bunnysuitlewds126 8 ай бұрын
it keeps your main directory cleaner because you will end up with a lot of dot files and its just basically continuity for every possible dot file you could have. its not a big deal just makes it more parsable for a human and easier to navigate through the CLI. Edit: i could show a pic of my ~/home/ directory but i'll just put into text the dot files I have, keep in mind im more of a gamer than programmer or practical user of linux. ".steam .minecraft .mozilla .java .local .config" you get the idea, it tends to make your home directory less parsable when you could just have a generalized dotfile folder for all of these. Edit2: you could also probably simplify your directories further at this point for your configs, so instead of going .config/alacritty/alacritty.yml you could probably just set it up to be .dotfiles/.config/alacritty.yml, but i dont know about that. im just imagining things.
@satoristeve
@satoristeve 8 ай бұрын
@@bunnysuitlewds126 No, I get it! I just know that some programs already make an entry in ~/.config/ so I've leaned toward exactly as you and the video suggest with moving them, but instead of into a ~/.dotfiles/ folder I've been moving them into ~/.config// I guess what I was trying to figure out is if the goal is to keep it as clean as possible, if there was some benefit to a ~/.dotfiles/ versus the already-used ~/.config/ I'm assuming there's some reasoning I'm just missing.
@liftlinux9421
@liftlinux9421 3 жыл бұрын
Is there any new video related to the topic?
@SystemCrafters
@SystemCrafters 3 жыл бұрын
Not yet! I need to get back to this series
@liftlinux9421
@liftlinux9421 3 жыл бұрын
@@SystemCrafters Thanks
@sach2372
@sach2372 3 жыл бұрын
Creating symlink with dired package function is super easy
@SystemCrafters
@SystemCrafters 3 жыл бұрын
I haven't tried it yet! What's the command?
@sach2372
@sach2372 3 жыл бұрын
@@SystemCrafters M-x dired-do-symlink
@sach2372
@sach2372 3 жыл бұрын
Adding details to describe the workflow: from dired buffer, put cursor on the item to create link for, and invoke dired-do-symlink, it'll ask for link path, navigate, type name for link, and enter. symlink is created.
@JeanNoelAvila
@JeanNoelAvila 3 жыл бұрын
Why create symbolic links instead of hard links? We would expect that the home folder is contained on a single file system?
@SystemCrafters
@SystemCrafters 3 жыл бұрын
That's just the way I've always done it. Are hard links necessary to link across storage devices? If so, I wasn't aware of that!
@JeanNoelAvila
@JeanNoelAvila 3 жыл бұрын
@@SystemCrafters That the contrary. Hardlinks are basically names pointing to the same content in the file system, so they need to be in the same filesystem. Symlink can cross filesystem, because they are resolved.
@SystemCrafters
@SystemCrafters 3 жыл бұрын
Gotcha, so you're saying for the purpose of linking the dotfiles, a hard link would be sufficient. Are there any other benefits? Faster? Don't have to call readlink to resolve?
@JeanNoelAvila
@JeanNoelAvila 3 жыл бұрын
@@SystemCrafters All the hardlinks on a file *are* the file, there's no assymetry between them, so if you remove one hardlink the others stay valid: there's no such thing as dangling link. For emacs, I don't know if there's a benefit. One cool thing about Emacs, is that when trying to open a symlink, you are asked if you want to open the linked file in the original directory so that e.g. magit can handle it correctly. With hardlinks, you couldn't have such process.
@skilled-person
@skilled-person 2 жыл бұрын
why move everything? you could've init a git on $home with --bare flag
@thacalebful
@thacalebful 3 жыл бұрын
Did my previous comment get deleted? :/
@SystemCrafters
@SystemCrafters 3 жыл бұрын
I didn't see one come through! I get e-mails for every comment posted on a video and haven't received one for a previous comment of yours. I also checked the "held for review" section for comments and didn't see one there. Maybe KZfaq didn't succeed in posting it to begin with?
@thacalebful
@thacalebful 3 жыл бұрын
@@SystemCrafters No problem. It just happened to me a few times lately in other channels so I began to wonder why. Keep up the good work :)
@undefinednull5749
@undefinednull5749 3 жыл бұрын
please make video about Org BRAIN.
@SystemCrafters
@SystemCrafters 3 жыл бұрын
I haven't heard of that before! I'll look into it. I will definitely make a video on org-roam which is used for a similar purpose but seemingly less complex
@wackenalt878
@wackenalt878 3 жыл бұрын
I originally also used org brain, but if you use org-roam with org-roam-server you hav a great way of visualizing your points with a mind map and its connection, which was the main thing i wanted to use org BRAIN for, and org-roam has many other advantages. So i finnaly abandoned Org brain in favor of org-roam (I know its difficult to wrap your mind around org-roam at the beginning and that was the main reason that I did not take a closer look at org-roam for a while, but in the end its better in many ways)
@SystemCrafters
@SystemCrafters 3 жыл бұрын
I haven't personally tried Org Brain, but Org Roam is great!
@richardbennett4365
@richardbennett4365 6 ай бұрын
Well, then the man could have made this directory instead, and then it would not have sounded redundant to him: ~/.files There. It's perfecter than his way.
Manage Your Dotfiles Like A Superhero
25:39
Jake Wiesler
Рет қаралды 15 М.
Git Bare Repository - A Better Way To Manage Dotfiles
16:56
DistroTube
Рет қаралды 131 М.
1,000 Diamonds! (Funny Minecraft Animation) #shorts #cartoon
00:31
toonz CRAFT
Рет қаралды 41 МЛН
Sigma girl and soap bubbles by Secret Vlog
00:37
Secret Vlog
Рет қаралды 15 МЛН
Fast and Furious: New Zealand 🚗
00:29
How Ridiculous
Рет қаралды 45 МЛН
Как бесплатно замутить iphone 15 pro max
00:59
ЖЕЛЕЗНЫЙ КОРОЛЬ
Рет қаралды 8 МЛН
Getting Started with Org Roam - Build a Second Brain in Emacs
34:19
System Crafters
Рет қаралды 143 М.
Sync your .dotfiles with git and GNU #Stow like a pro!
38:16
DevInsideYou
Рет қаралды 29 М.
Dotfiles! Here's how I organize them.
9:37
Andrew Burgess
Рет қаралды 41 М.
Capturing Notes Efficiently in Emacs with Org Roam
31:06
System Crafters
Рет қаралды 43 М.
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 228 М.
Guix System Crafting talk by David Wilson
1:09:12
guix.social
Рет қаралды 1,3 М.
Manage your dotfiles across multiple machines with GNU Stow and Git
12:27
Craft an Email Workflow with Org Mode
41:56
System Crafters
Рет қаралды 8 М.
Ускоряем ваш TV🚀
0:44
ARTEM_CHIBA
Рет қаралды 379 М.
Todos os modelos de smartphone
0:20
Spider Slack
Рет қаралды 65 МЛН
iPhone socket cleaning #Fixit
0:30
Tamar DB (mt)
Рет қаралды 18 МЛН
📱магазин техники в 2014 vs 2024
0:41
djetics
Рет қаралды 694 М.