Begin 2024 Refactor

This commit is contained in:
Bill Niblock 2024-10-12 15:35:48 -04:00
parent 041d195556
commit f5865c0e06
2 changed files with 26 additions and 156 deletions

View file

@ -1,65 +1,11 @@
# Dot Files
Configuration files (often called dot-files because they start with a ".") for
the applications I use on a regular basis.
the applications I use on a regular basis. The configuration files are fully
commented and self-descriptive.
### Requirements
## Usage
Update the system from repo: `cp -rut ~/.config <dir>`
Update the repo from system: `cp -rut . ~/.config/<dir>`
You'll need `make` for the automated linking of the dotfiles. Obviously you'll
need the related program for each config file to be applicable.
## Installation
> 1. git clone git@github.com:VagabondAzulien/dotfiles.git
>
> 2. cd dotfiles
>
> 3. Type `make` to see your options
## Applications Configured
### Vim
My vim configuration is relatively straight forward and thoroughly commented.
#### Plugin File
The vimrc-plugins file stores the plugin information for
[Vim-Plug](https://github.com/junegunn/vim-plug). Included in the file is a
command to check for and pull-down the vim-plug files, if not previously
installed. All configurations related to plugins goes into this file also, so if
I want a plugin-free install, I can ignore this file and still run fine.
### Tmux
My tmux configuration is very straight forward and fully commented. Of note, I
enable mouse mode, have custom colors, and have a custom clock script for the
status bar (`clocks.sh`).
### Git
My git configuration is a skeleton `gitconfig` file, and an always-growing
`gitignore` file.
### Bash
My `bashrc` includes a custom prompt, several PATH additions, and
several custom functions.
The `bashrc-remote` file I use for any remote environments I'm in. The prompt is
different, and some of the functions aren't included.
## To-Do
* [ ] Improve makefile
## License
All files are licensed under the [WTFPL](http://www.wtfpl.net/), the full
license text of which can be found below.
> **DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE**
>
> _Version 2, December 2004_ ||
> _Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>_
>
> Everyone is permitted to copy and distribute verbatim or modified
> copies of this license document, and changing it is allowed as long
> as the name is changed.
>
> DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
> TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
>
> 0. You just DO WHAT THE FUCK YOU WANT TO.
Alternatively, `make` to automate some of it.

116
makefile
View file

@ -1,98 +1,22 @@
#===============================================================================
# Makefile for niblock dotfiles || $ make for options
#===============================================================================
.PHONY: help \
link-dotfiles \
build-default \
build-simple \
clean-all \
install-vim-config \
install-vim-plugins \
install-git \
install-tmux \
install-bash-config \
install-bash-profile \
#=====================================================#
# Makefile for niblock dotfiles || $ make for options #
#=====================================================#
help: ## Default target; shows options
echo "update-system: Update system from repository."
echo " update-repo: Update repository from system."
.DEFAULT-GOAL := help
#===============================================================================
# Utility
#===============================================================================
help: ## Display this menu
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "%-25s %s\n", $$1, $$2}'
update-system: ## Update system from repository
@cp -rut "$(HOME)"/.config "$(CURDIR)"/alacritty/
@cp -rut "$(HOME)"/.config "$(CURDIR)"/git/
@cp -rut "$(HOME)"/.config "$(CURDIR)"/nvim/
@cp -rut "$(HOME)"/.config "$(CURDIR)"/tmux/
@cp -rut "$(HOME)"/.config "$(CURDIR)"/vim/
@cp -u "$(CURDIR)"/bash/rc "$(HOME)"/.bashrc
link-dotfiles: ## Create dotfiles link in Home directory
ln -s -- "$(CURDIR)" "$(HOME)"/.dotfiles
#===============================================================================
# Bundles
#===============================================================================
build-default: ## Create default environment, using all dotfiles
build-default: link-dotfiles \
install-vim-config \
install-vim-plugins \
install-git \
install-tmux \
install-bash-config
build-simple: ## Create minimal environment, for remote or single-use
build-simple: install-vim-config \
install-bash-remote
clean-all: ## Remove all dotfiles linked via this makefile
#===============================================================================
# Dotfiles
#===============================================================================
install-vim-config: ## Create vimrc file and vim directory in Home directory
@if [ -L "$(HOME)"/.vimrc ] ; then \
echo "File vimrc already linked; skipping." ; \
else \
echo "Linking vimrc to ~/.vimrc" ; \
ln -s -- "$(CURDIR)"/vim/vimrc "$(HOME)"/.vimrc ; \
fi
@if [ ! -d "$(HOME)"/.vim ] ; then \
mkdir "$(HOME)"/.vim ; \
fi
@echo "Copying Vim directory into ~/.vim"
@cp -uir -- "$(CURDIR)"/vim/vim/* "$(HOME)"/.vim/
install-vim-plugins: ## Install configure Vim plugin submodules
install-vim-plugins: install-vim-config
@echo "Updating all submodules"
@git submodule foreach git pull origin master
@echo "Updating Vim helptags"
@vim -u NONE -c "helptags ALL" -c q
install-git: ## Create git config and ignore files in Home directory
@cp -i -- "$(CURDIR)"/git/gitconfig "$(HOME)"/.gitconfig
@if [ -L "$(HOME)"/.gitignore ] ; then \
echo "File gitignore already linked; skipping." ; \
else \
echo "Linking gitignore to ~/.gitignore" ; \
ln -s -- "$(CURDIR)"/git/gitignore "$(HOME)"/.gitignore ; \
fi
install-tmux: ## Create tmux config file in Home directory
install-tmux: link-dotfiles
@if [ -L "$(HOME)"/.tmux.conf ] ; then \
echo "File tmux.conf already linked; skipping." ; \
else \
echo "Linking tmux.conf to ~/.tmux.conf" ; \
ln -s -- "$(CURDIR)"/tmux/tmux.conf "$(HOME)"/.tmux.conf ; \
fi
install-bash-config: ## Create bash config file in Home directory
@if [ -L "$(HOME)"/.bashrc ] ; then \
echo "File .bashrc already linked; skipping." ; \
else \
echo "Linking bashrc to ~/.bashrc" ; \
ln -s -- "$(CURDIR)"/bash/bashrc "$(HOME)"/.bashrc ; \
fi
install-bash-remote: ## Create remote bash config file in Home directory
@if [ -L "$(HOME)"/.bashrc ] ; then \
echo "File .bashrc already linked; skipping." ; \
else \
echo "Linking bashrc-remote to ~/.bashrc" ; \
ln -s -- "$(CURDIR)"/bash/bashrc-remote "$(HOME)"/.bashrc ; \
fi
update-repo: ## Update repository from system
@cp -rut "$(CURDIR)" "$(HOME)"/.config/alacritty/
@cp -rut "$(CURDIR)" "$(HOME)"/.config/git/
@cp -rut "$(CURDIR)" "$(HOME)"/.config/nvim/
@cp -rut "$(CURDIR)" "$(HOME)"/.config/tmux/
@cp -rut "$(CURDIR)" "$(HOME)"/.config/vim/
@cp -u "$(HOME)"/.bashrc "$(CURDIR)"/bash/rc