Skip to content
/ dotfiles Public

Shell settings, trying to be shell agnostic, supporting bash, fish and zsh.

License

Notifications You must be signed in to change notification settings

mnewt/dotfiles

Repository files navigation

Some dotfiles

A shell configuration supporting bash, zsh, and fish.

I spend most of my time in Emacs on macOS. This configuration can work fine on its own, and it has a companion Emacs config.

Most scripts are written in bash because it is the lowest common denominator.

Tour

Applications & Utilities

Included are configurations for some programs, such as:

Install

Clone the repository and link files into the current user’s $HOME directory.

git clone https://github.com/mnewt/dotfiles
dotfiles/bin/install-dotfiles

What it does

The install-dotfiles script links

USAGE: install-dotfiles [-f] [-h] [-t] [-v] [ SOURCE_DIRECTORY ]

Link dotfiles to $HOME. Directories listed in "child_dirs" have their children
linked so as not to interfere with other things in those directories.

SOURCE_DIRECTORY, if not specified, is /Users/mn/code/dotfiles.

OPTIONS:
  -f   Force overwrite of files or directories in $HOME
  -h   Display this help message
  -t   Test mode - don't make any changes
  -v   Verbose - print each action

The install-dotfiles script performs the following functions:

  1. Look for an install-dotfiles-config file in the root of the SOURCE_DIRECTORY. Read variables from that file:
    • child-dirs: A list of directories that will be created.
    • ignore: A list of top level files/directories to be ignored (not linked).
  2. Create a soft link in $HOME to each file in the repo that (a) starts with a ., and (b) isn’t listed in child_dirs.
  3. For each directory in child_dirs, ensure the directory is created in $HOME and then create links in that directory back to the corresponding files in the respective directory within the repo.
  4. Remove any stale links in the destination locations.

A note on bare repos

In a previous iteration of this repo, I had a somewhat lengthy “bare repo” setup. This worked great, except for the fact that various LSP servers, notably bash-language-server, kept trying to index my entire home directory because it found a .git root there. This was pretty annoying and is the main reason I decided to switch back to a linking model.

Update scripts

There are set of update scripts in the bin directory to keep all the different software on a given system up to date.

The master update script runs all of these in succession. Each script is smart enough to figure out whether the appropriate software is installed on the current machine.

These are some of the things which can be updated:

License

All the stuff in this repository is licensed to the public domain under the unlicense.