All Projects → alfunx → .dotfiles

alfunx / .dotfiles

Licence: mit
There's no place like ~ !

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to .dotfiles

config-public
Linux/WSL config to optimize ergonomics, security, and productivity: vim/neovim, zsh, tmux, i3, emacs, vscode, ipython, jupyter, ranger, fzf, kitty, xkb, selfquant, firejail, systemd, etc
Stars: ✭ 14 (-94.72%)
Mutual labels:  dotfiles, zsh, tmux, archlinux
Dotfiles
Dotfiles for unix, managed by GNU stow.
Stars: ✭ 617 (+132.83%)
Mutual labels:  zsh, tmux, dotfiles, awesomewm
Dotfiles
😈 Vim, git, zsh, tmux, and other goodies.
Stars: ✭ 240 (-9.43%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles
dotfiles for the command line home
Stars: ✭ 21 (-92.08%)
Mutual labels:  tmux, archlinux, awesomewm
dotfiles
🚀 tmux, ohmyzsh, powerlevel10k, neovim 🔧
Stars: ✭ 24 (-90.94%)
Mutual labels:  dotfiles, zsh, tmux
dotfiles
My arch setup script and dotfiles
Stars: ✭ 37 (-86.04%)
Mutual labels:  dotfiles, tmux, archlinux
Dot Files
⚡️ Well documented, terminal centric web developer's dot files. Neovim, Zsh, Tmux, Git, etc.
Stars: ✭ 209 (-21.13%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles
🏠 dotfiles for my macOS environment
Stars: ✭ 17 (-93.58%)
Mutual labels:  dotfiles, zsh, tmux
Dotfiles
🔩 Dotfiles for bash, zsh, tmux, emacs, vim, etc
Stars: ✭ 175 (-33.96%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles
🏡 .files, including zsh, tmux, vim, and git. Also macOS setup. Good stuff.
Stars: ✭ 30 (-88.68%)
Mutual labels:  dotfiles, zsh, tmux
dot
No description or website provided.
Stars: ✭ 40 (-84.91%)
Mutual labels:  dotfiles, zsh, tmux
dotfiles
My dot files
Stars: ✭ 25 (-90.57%)
Mutual labels:  dotfiles, zsh, tmux
Dotfiles
Ninrod's sharpened dotfiles for emacs, vim, zsh, tmux. Since '15.
Stars: ✭ 208 (-21.51%)
Mutual labels:  zsh, tmux, dotfiles
Dotfiles
My dotfiles: Experimental, ongoing configuration files, development environment and scripts for various Unix-like systems, text-based command-line applications and interfaces.
Stars: ✭ 185 (-30.19%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles
Dotfiles for my current dev environment.
Stars: ✭ 14 (-94.72%)
Mutual labels:  dotfiles, zsh, tmux
Neovim Config
Neovim configuration
Stars: ✭ 180 (-32.08%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles
cross-platform (linux (arch), macos, android (termux), windows (WSL)) dotfiles and scripts, using yadm
Stars: ✭ 17 (-93.58%)
Mutual labels:  dotfiles, zsh, tmux
Dotfiles
📍 My dotfiles for macOS using Fish/Zsh, Neovim, and Tmux
Stars: ✭ 151 (-43.02%)
Mutual labels:  zsh, tmux, dotfiles
Dotfiles
vim, zsh, git, homebrew, nvm, neovim - my whole world
Stars: ✭ 2,217 (+736.6%)
Mutual labels:  zsh, tmux, dotfiles
dotfiles-legacy
. .✧ · 🌎 ✷ ✫ 🌙 · ✵ 🚀✵ * ✵ · 🌌✫ ✷ · ✧ .
Stars: ✭ 15 (-94.34%)
Mutual labels:  dotfiles, zsh, tmux

.dotfiles

There's no place like ~ !



Table of Contents

Screenshots

Awesome WM Awesome WM Awesome WM

Introduction

This repository contains my personal configuration files (also known as dotfiles). The package lists can be found in ~/.pkglist/. To install all official packages, you can use for example cat .pkglist/pacman | pacman -S -.

In the following sections I'll explain how this dotfiles repository was set up, how to use it and how to restore them, for example on a new device.

Note: I migrated to dotfiles.sh by Eli Schwartz, which is a thin wrapper for git that implements the method described here.

Setup Repository

Setup a bare git repository in your home directory. Bare repositories have no working directory, so setup an alias to avoid typing the long command. Add the git directory ~/.dotfiles/ to the gitignore as a security measure. Setup remote and push. Hide untracked files when querying the status.

git init --bare "$HOME/.dotfiles"

echo 'alias dotfiles="/usr/bin/env git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"' \
    >> "$HOME/.zshrc"
source "$HOME/.zshrc"

echo '.dotfiles' >> "$HOME/.gitignore"
dotfiles add "$HOME/.gitignore"
dotfiles commit -m 'Git: Add gitignore'

dotfiles remote add origin https://github.com/alfunx/.dotfiles
dotfiles push --set-upstream origin master
dotfiles config --local status.showUntrackedFiles no

Track Files

Use the default git subcommands to track, update and remove files. You can obviously also use branches and all other features of git.

dotfiles status
dotfiles add .zshrc
dotfiles commit -m 'Zsh: Add zshrc'
dotfiles add .vimrc
dotfiles commit -m 'Vim: Add vimrc'
dotfiles push

To remove a file from the repository while keeping it locally you can use:

dotfiles rm --cached ~/.some_file

Restore Configurations

First clone dependent repositories, in this case for example oh-my-zsh. Clone your dotfiles repository as bare repository. Setup temporary alias and then checkout. If there exist files that collide with your repository (like a default .bashrc), the files will be moved to ~/.dotfiles.bak/. Then update all submodules and again hide untracked files when querying the status.

git clone https://github.com/robbyrussell/oh-my-zsh \
    "$HOME/.oh-my-zsh"

git clone --bare --recursive https://github.com/alfunx/.dotfiles \
    "$HOME/.dotfiles"

function dotfiles() {
    /usr/bin/env git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "[email protected]"
}

dotfiles checkout
if [ "$?" -ne 0 ]; then
    mkdir -p "$HOME/.dotfiles.bak"
    dotfiles checkout 2>&1 \
        | grep -P '^\s+[\w.]' \
        | awk {'print $1'} \
        | xargs -I{} sh -c 'cp -r --parents "{}" "$HOME/.dotfiles.bak/" && rm -rf "{}"'
    dotfiles checkout
fi

dotfiles submodule update --recursive --remote
dotfiles config --local status.showUntrackedFiles no

Note that the automatic moving of already existing (thus conflicting) files fails if there are too many of them (git cuts the message at some point).

The short variant, using a script with the commands above:

. <(curl -Ls https://dotfiles.mariya.ch)

(Note: This is for my personal use. Instead of directly sourcing the install script, you should save it somewhere on your system and review it.)

Additional Commands

Instead of the alias provided above, you can use following function. listall will show all tracked files, listtree will show those files in a tree format (requires the package treeify). You may need to use a pager for these commands.

dotfiles() {
    case "$1" in
        listall)
            shift
            dotfiles ls-tree --full-tree -r --name-only HEAD "[email protected]"
            ;;
        listtree)
            shift
            if hash treeify 2>/dev/null; then
                dotfiles ls-tree --full-tree -r --name-only HEAD "[email protected]" | treeify
            else
                dotfiles listall
            fi
            ;;
        *)
            /usr/bin/env git --git-dir="$HOME/.dotfiles/" --work-tree="$HOME" "[email protected]"
            ;;
    esac
}

compdef can provide zsh autocompletion of the git command for your equivalent dotfiles command.

compdef dotfiles='git'
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].