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...

КОМЕНТАРІ • 24

  • @LusidDreaming
    @LusidDreaming 3 роки тому +8

    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)

  • @hardrived009
    @hardrived009 3 роки тому +17

    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!

  • @vim449
    @vim449 3 роки тому +13

    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.

    • @unstable8968
      @unstable8968 3 роки тому +4

      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

    • @laughingvampire7555
      @laughingvampire7555 11 місяців тому

      @@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.

  • @Paxsali
    @Paxsali 3 роки тому +6

    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!

    • @laughingvampire7555
      @laughingvampire7555 11 місяців тому +2

      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

  • @JuicySmoothieFruityBoy
    @JuicySmoothieFruityBoy Рік тому

    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

  • @cjg1979
    @cjg1979 3 роки тому

    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.

    • @SystemCrafters
      @SystemCrafters  3 роки тому +1

      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.

    • @cjg1979
      @cjg1979 3 роки тому

      @@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.

  • @jitessh
    @jitessh 3 роки тому

    Awesome video! Continue this series.

  • @jackin83j
    @jackin83j 3 роки тому +1

    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.

  • @David-pz4gy
    @David-pz4gy 3 роки тому +3

    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?

    • @SystemCrafters
      @SystemCrafters  3 роки тому +1

      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!

  • @ricardomalnati
    @ricardomalnati 3 роки тому

    Thx a lot! 💪 Good content! 🤓

  • @thanhnguyenduy2452
    @thanhnguyenduy2452 3 роки тому +1

    Hi, are you using a terminal file manager? if so, which one is that?

  • @fParad0x_
    @fParad0x_ 3 роки тому

    Nice video!

  • @Dr_Dude
    @Dr_Dude 3 роки тому +1

    haha 😅 i thought first a dotfile that is graphviz.
    I do save my dot files on a repo especially .emacs and few others

  • @f23anone82
    @f23anone82 3 роки тому

    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?

  • @engraver52
    @engraver52 3 роки тому +1

    you don't use inputrc?

    • @SystemCrafters
      @SystemCrafters  3 роки тому +1

      Frankly I didn't know it existed! Looks pretty useful though. Anything special you put in yours?

    • @engraver52
      @engraver52 3 роки тому +1

      "\C-]":"''\C-b"
      "\C-[":"{}\C-b"
      "\C-v": '\C-a