Dotfile Installing/Loading

If you’ve ever taken a look at r/unixporn, you would know that the setups there are superior to average linux users. And I’m asking this because I want to install/load the setups into my linux system. If a rice creator shares their dotfiles, other people can install/load their setups- but how? (I mean what commands.) So in this article about dotfiles: Dotfiles – What is a Dotfile and How to Create it in Mac and Linux it only shows how you can create dotfiles but not how to install them from another linux pc. How do I do this?

1 Like

Copy the files into the folder where they need to live normally. They’re literally just config files for specific programs, if you want to replace the config for programs you have then you just need to do that. The issue is that everyone has a very specific set of programs that they like to use (and fonts etc). So if you use nvim, then the nvim config goes in .convig/nvim/, if the terminal you use is kitty, the config goes in .config/kitty/. If it’s something that doesn’t use the .config/ convention then maybe it just goes in the home directory; it’s dependent on the program.

Just to be clear, repos of dotfiles are normally very useful for the person whose repo it is, but much less useful [directly, they’re incredibly useful as reference] for anyone else – they’ve personal and very specific to what a given person has installed. eg I have a dotfiles repo and it means I can set up my preferred environment really quickly on a new Linux/OSX machine, but it has configurations that are very specific to how I work. They’re useful as reference, but just cloning them directly onto your computer and overwriting your configs is normally going to break things because you’ll be missing programs, or you’ll already have config set that will get wiped out.

1 Like

I don’t think you will get much without an example. So let’s take one.

Say that you use Vim text editor. As any program in your laptop, Vim has a configuration file that it loads at runtime.

Every program follows a set of directories where is searches for a config file, and they end up being quite complex. But if you search for vim, a user config file can be put in this location:

  • ~/.vimrc

where ~ is an alias for home directory, for example mine is at /home/mahneh/ and therein I can access my .vimrc.

Where that is the so called dotfile for Vim.

dotfiles are hidden but you can “show hidden files” in the GUI, or in the CLI (won’t go in detail here.)

Assuming you don’t have one, lets add a config option to ~/.vimrc,:

"this is a comment 
" Add numbers to each line on the left-hand side.
set number

Although you normally wouldn’t see the line numbers in Vim, you’d see them here.

A general model

So now you can undestand that:

  • Each program has a config file
  • You need to check in the docs where to put it and how to name it
    The most common locations for user config files are either ~/.prog.conf or ~/.program/file.conf or .config/program/file.conf
    where file.conf and program are just placeholders.
  • You may need to re run the program.

I would recommend you to use and run Alacritty terminal emulator maybe. Then you check on the web how to add some config.