From 8789a2a83e336791beacae3f66078e2d378fc675 Mon Sep 17 00:00:00 2001 From: Von Random Date: Sat, 4 Feb 2023 12:45:02 +0200 Subject: [PATCH] use stow for dotfiles (#1) Reviewed-on: https://mechanus.net/von/vdotfiles/pulls/1 --- .gitignore | 5 +++-- bashrc => cli/.bashrc | 0 cli/.config/bat/config | 2 ++ {fish => cli/.config/fish}/config.fish | 0 {nvim => cli/.config/nvim}/init.lua | 0 {nvim => cli/.config/nvim}/lua/maps.lua | 0 .../.config/nvim}/lua/packer_init.lua | 0 {nvim => cli/.config/nvim}/lua/plugins.lua | 0 {nvim => cli/.config/nvim}/lua/settings.lua | 0 {zsh => cli/.config/zsh}/functions.zsh | 21 ++++++++++++++----- {zsh => cli/.config/zsh}/powerline.zsh | 0 {zsh => cli/.config/zsh}/settings.zsh | 0 {doom => cli/.doom.d}/config.el | 0 {doom => cli/.doom.d}/init.el | 0 {doom => cli/.doom.d}/packages.el | 0 inputrc => cli/.inputrc | 0 defunct/nanorc => cli/.nanorc | 0 defunct/screenrc => cli/.screenrc | 0 tigrc => cli/.tigrc | 0 tmux.conf => cli/.tmux.conf | 0 vimplugrc => cli/.vimplugrc | 0 vimrc => cli/.vimrc | 0 cli/.zshrc | 16 ++++++++++++++ .../.config/alacritty}/alacritty.yml | 0 kitty.conf => gui/.config/kitty/kitty.conf | 0 wezterm.lua => gui/.wezterm.lua | 0 defunct/xresources => lnx/.Xresources | 0 {defunct => lnx/.config/foot}/foot.ini | 0 defunct/i3_config => lnx/.config/i3/config | 0 .../.config/i3status-rust/config.toml | 0 .../sway_config => lnx/.config/sway/config | 0 defunct/dunstrc => lnx/.dunstrc | 0 zsh/init.zsh | 17 --------------- 33 files changed, 37 insertions(+), 24 deletions(-) rename bashrc => cli/.bashrc (100%) create mode 100644 cli/.config/bat/config rename {fish => cli/.config/fish}/config.fish (100%) rename {nvim => cli/.config/nvim}/init.lua (100%) rename {nvim => cli/.config/nvim}/lua/maps.lua (100%) rename {nvim => cli/.config/nvim}/lua/packer_init.lua (100%) rename {nvim => cli/.config/nvim}/lua/plugins.lua (100%) rename {nvim => cli/.config/nvim}/lua/settings.lua (100%) rename {zsh => cli/.config/zsh}/functions.zsh (85%) rename {zsh => cli/.config/zsh}/powerline.zsh (100%) rename {zsh => cli/.config/zsh}/settings.zsh (100%) rename {doom => cli/.doom.d}/config.el (100%) rename {doom => cli/.doom.d}/init.el (100%) rename {doom => cli/.doom.d}/packages.el (100%) rename inputrc => cli/.inputrc (100%) rename defunct/nanorc => cli/.nanorc (100%) rename defunct/screenrc => cli/.screenrc (100%) rename tigrc => cli/.tigrc (100%) rename tmux.conf => cli/.tmux.conf (100%) rename vimplugrc => cli/.vimplugrc (100%) rename vimrc => cli/.vimrc (100%) create mode 100644 cli/.zshrc rename {defunct => gui/.config/alacritty}/alacritty.yml (100%) rename kitty.conf => gui/.config/kitty/kitty.conf (100%) rename wezterm.lua => gui/.wezterm.lua (100%) rename defunct/xresources => lnx/.Xresources (100%) rename {defunct => lnx/.config/foot}/foot.ini (100%) rename defunct/i3_config => lnx/.config/i3/config (100%) rename defunct/i3status-rust_config.toml => lnx/.config/i3status-rust/config.toml (100%) rename defunct/sway_config => lnx/.config/sway/config (100%) rename defunct/dunstrc => lnx/.dunstrc (100%) delete mode 100644 zsh/init.zsh diff --git a/.gitignore b/.gitignore index a959aa7..d0ace42 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -fish/fish_variables -nvim/plugin/packer_compiled.lua +cli/.config/zsh/local.zsh +cli/.config/fish/fish_variables +cli/.config/nvim/plugin/packer_compiled.lua diff --git a/bashrc b/cli/.bashrc similarity index 100% rename from bashrc rename to cli/.bashrc diff --git a/cli/.config/bat/config b/cli/.config/bat/config new file mode 100644 index 0000000..e7704bd --- /dev/null +++ b/cli/.config/bat/config @@ -0,0 +1,2 @@ +--theme=gruvbox-dark +--italic-text=always diff --git a/fish/config.fish b/cli/.config/fish/config.fish similarity index 100% rename from fish/config.fish rename to cli/.config/fish/config.fish diff --git a/nvim/init.lua b/cli/.config/nvim/init.lua similarity index 100% rename from nvim/init.lua rename to cli/.config/nvim/init.lua diff --git a/nvim/lua/maps.lua b/cli/.config/nvim/lua/maps.lua similarity index 100% rename from nvim/lua/maps.lua rename to cli/.config/nvim/lua/maps.lua diff --git a/nvim/lua/packer_init.lua b/cli/.config/nvim/lua/packer_init.lua similarity index 100% rename from nvim/lua/packer_init.lua rename to cli/.config/nvim/lua/packer_init.lua diff --git a/nvim/lua/plugins.lua b/cli/.config/nvim/lua/plugins.lua similarity index 100% rename from nvim/lua/plugins.lua rename to cli/.config/nvim/lua/plugins.lua diff --git a/nvim/lua/settings.lua b/cli/.config/nvim/lua/settings.lua similarity index 100% rename from nvim/lua/settings.lua rename to cli/.config/nvim/lua/settings.lua diff --git a/zsh/functions.zsh b/cli/.config/zsh/functions.zsh similarity index 85% rename from zsh/functions.zsh rename to cli/.config/zsh/functions.zsh index 216c847..2996bb8 100644 --- a/zsh/functions.zsh +++ b/cli/.config/zsh/functions.zsh @@ -1,3 +1,8 @@ +# Fuck default aliases +unalias -a + +testbin() { whence $@ > /dev/null } + termcompat() { typeset term=$TERM case $term in @@ -34,15 +39,21 @@ fixterm() { printf $'c' } diff() { command diff --color $@ } tailf() { command less +F $@ } -rgrep() { command grep --exclude-dir=\.git -R $@ } +grep() { command grep --color=auto } +rgrep() { grep --color=auto --exclude-dir=\.git -R $@ } fwcmd() { command firewall-cmd $@ } sush() { command sudo -Es } s() { termcompat ssh $@ } -nv() { command nvim $@ } +if testbin nvim; then + vi() { command nvim $@ } + vim() { command nvim $@ } +fi + tmux() { command tmux -2 $@ } atmux() { tmux attach || tmux } +g() { command lazygit $@ } tig() { termcompat tig $@ } gsi() { tig status } gci() { command git commit $@ } @@ -62,13 +73,13 @@ greset() { /usr/bin/git reset --hard } -if [[ -x $(whence -p diff-so-fancy) ]]; then +if testbin diff-so-fancy; then gdf() { gdiff $@ | command diff-so-fancy | command less --tabs=4 -RSFX } else gdf() { gdiff $@ } fi -if [[ -x $(whence -p exa) ]]; then +if testbin exa; then ls() { command exa --group-directories-first $@ } ll() { ls -alg $@ } ld() { ls -dlg $@ } @@ -79,7 +90,7 @@ else fi # grc -if [[ -x $(whence -p grc) ]]; then +if testbin grc; then cmds=(\ cc configure cvs df dig gcc gmake id ip last lsof make mount \ mtr netstat ping ping6 ps tcpdump traceroute traceroute6 \ diff --git a/zsh/powerline.zsh b/cli/.config/zsh/powerline.zsh similarity index 100% rename from zsh/powerline.zsh rename to cli/.config/zsh/powerline.zsh diff --git a/zsh/settings.zsh b/cli/.config/zsh/settings.zsh similarity index 100% rename from zsh/settings.zsh rename to cli/.config/zsh/settings.zsh diff --git a/doom/config.el b/cli/.doom.d/config.el similarity index 100% rename from doom/config.el rename to cli/.doom.d/config.el diff --git a/doom/init.el b/cli/.doom.d/init.el similarity index 100% rename from doom/init.el rename to cli/.doom.d/init.el diff --git a/doom/packages.el b/cli/.doom.d/packages.el similarity index 100% rename from doom/packages.el rename to cli/.doom.d/packages.el diff --git a/inputrc b/cli/.inputrc similarity index 100% rename from inputrc rename to cli/.inputrc diff --git a/defunct/nanorc b/cli/.nanorc similarity index 100% rename from defunct/nanorc rename to cli/.nanorc diff --git a/defunct/screenrc b/cli/.screenrc similarity index 100% rename from defunct/screenrc rename to cli/.screenrc diff --git a/tigrc b/cli/.tigrc similarity index 100% rename from tigrc rename to cli/.tigrc diff --git a/tmux.conf b/cli/.tmux.conf similarity index 100% rename from tmux.conf rename to cli/.tmux.conf diff --git a/vimplugrc b/cli/.vimplugrc similarity index 100% rename from vimplugrc rename to cli/.vimplugrc diff --git a/vimrc b/cli/.vimrc similarity index 100% rename from vimrc rename to cli/.vimrc diff --git a/cli/.zshrc b/cli/.zshrc new file mode 100644 index 0000000..f116dc9 --- /dev/null +++ b/cli/.zshrc @@ -0,0 +1,16 @@ +# If not running interactively, don't do anything +[[ $- != *i* ]] && return + +confdir=$HOME/.config/zsh +conflist=( + settings.zsh + powerline.zsh + functions.zsh + local.zsh +) + +for conf in $conflist; do + [[ -f $confdir/$conf ]] && . $confdir/$conf +done + +unset conf confdir conflist diff --git a/defunct/alacritty.yml b/gui/.config/alacritty/alacritty.yml similarity index 100% rename from defunct/alacritty.yml rename to gui/.config/alacritty/alacritty.yml diff --git a/kitty.conf b/gui/.config/kitty/kitty.conf similarity index 100% rename from kitty.conf rename to gui/.config/kitty/kitty.conf diff --git a/wezterm.lua b/gui/.wezterm.lua similarity index 100% rename from wezterm.lua rename to gui/.wezterm.lua diff --git a/defunct/xresources b/lnx/.Xresources similarity index 100% rename from defunct/xresources rename to lnx/.Xresources diff --git a/defunct/foot.ini b/lnx/.config/foot/foot.ini similarity index 100% rename from defunct/foot.ini rename to lnx/.config/foot/foot.ini diff --git a/defunct/i3_config b/lnx/.config/i3/config similarity index 100% rename from defunct/i3_config rename to lnx/.config/i3/config diff --git a/defunct/i3status-rust_config.toml b/lnx/.config/i3status-rust/config.toml similarity index 100% rename from defunct/i3status-rust_config.toml rename to lnx/.config/i3status-rust/config.toml diff --git a/defunct/sway_config b/lnx/.config/sway/config similarity index 100% rename from defunct/sway_config rename to lnx/.config/sway/config diff --git a/defunct/dunstrc b/lnx/.dunstrc similarity index 100% rename from defunct/dunstrc rename to lnx/.dunstrc diff --git a/zsh/init.zsh b/zsh/init.zsh deleted file mode 100644 index 175c684..0000000 --- a/zsh/init.zsh +++ /dev/null @@ -1,17 +0,0 @@ -# Source me via an absolute path -# If not running interactively, don't do anything -[[ $- != *i* ]] && return - -# We rely on absolute path here, so don't do anything if it's relative -[[ $0[1] != / ]] && return - -confdir=$(dirname $0) -conflist=( - settings.zsh - powerline.zsh - functions.zsh -) - -for config in $conflist; do - [[ -r $confdir/$config ]] && . $confdir/$config -done