From dc7e16044f3213efb8b2ef0df71a933e01fc2f04 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Mon, 30 Mar 2026 14:29:20 +0300 Subject: [PATCH] refactor!: use stow --- .config/{lazygit.yml => lazygit/config.yml} | 0 .config/nvim/lua/casraf/plugins/remap.lua | 6 +- .config/sofmani.yml | 58 ++++--------------- .editorconfig | 36 +++++++++++- .editorconfig.global | 39 ------------- .gitignore | 1 + .../local}/ascii_font/ascii_font.plugin.zsh | 2 +- .../local}/ascii_font/fonts/Big-Money-ne.flf | 0 .../plugins/local}/assets/mdp-template.html | 0 .../zsh/plugins/local}/common.plugin.zsh | 0 .../zsh/plugins/local}/common/android.zsh | 0 .../zsh/plugins/local}/common/colors.zsh | 2 +- .../zsh/plugins/local}/common/copilot.zsh | 0 .../zsh/plugins/local}/common/defaults.zsh | 0 .../zsh/plugins/local}/common/docker.zsh | 0 .../plugins/local}/common/dotfiles_edit.zsh | 0 .../zsh/plugins/local}/common/flutter.zsh | 0 .../zsh/plugins/local}/common/fs_utils.zsh | 0 .../share/zsh/plugins/local}/common/git.zsh | 0 .../zsh/plugins/local}/common/git_utils.zsh | 0 .../zsh/plugins/local}/common/github.zsh | 0 .../share/zsh/plugins/local}/common/gpg.zsh | 0 .../zsh/plugins/local}/common/input_utils.zsh | 0 .../zsh/plugins/local}/common/killproc.zsh | 0 .../plugins/local}/common/list_functions.zsh | 2 +- .../local}/common/markdown-preview.zsh | 2 +- .../zsh/plugins/local}/common/nextcloud.zsh | 0 .../plugins/local}/common/number_utils.zsh | 0 .../share/zsh/plugins/local}/common/nx.zsh | 0 .../plugins/local}/common/ollama.disabled.zsh | 0 .../zsh/plugins/local}/common/os_utils.zsh | 0 .../zsh/plugins/local}/common/pkg_utils.zsh | 0 .../zsh/plugins/local}/common/proc_utils.zsh | 0 .../share/zsh/plugins/local}/common/sc.zsh | 0 .../zsh/plugins/local}/common/spinner.zsh | 0 .../zsh/plugins/local}/common/ssh_server.zsh | 0 .../zsh/plugins/local}/common/ssh_utils.zsh | 0 .../plugins/local}/common/string_utils.zsh | 0 .../zsh/plugins/local}/common/talk_export.zsh | 0 .../share/zsh/plugins/local}/common/tmux.zsh | 0 .../share/zsh/plugins/local}/common/tpl.zsh | 0 .stow-local-ignore | 24 ++++++++ .zshrc | 4 +- README.md | 46 +++++++++++++-- {plugins => _plugins}/loader.zsh | 0 {plugins => _plugins}/motd/10-logo | 2 +- aliases.zsh | 4 +- exports.zsh | 6 +- 48 files changed, 124 insertions(+), 110 deletions(-) rename .config/{lazygit.yml => lazygit/config.yml} (100%) delete mode 100644 .editorconfig.global rename {plugins => .local/share/zsh/plugins/local}/ascii_font/ascii_font.plugin.zsh (98%) rename {plugins => .local/share/zsh/plugins/local}/ascii_font/fonts/Big-Money-ne.flf (100%) rename {plugins => .local/share/zsh/plugins/local}/assets/mdp-template.html (100%) rename {plugins => .local/share/zsh/plugins/local}/common.plugin.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/android.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/colors.zsh (97%) rename {plugins => .local/share/zsh/plugins/local}/common/copilot.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/defaults.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/docker.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/dotfiles_edit.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/flutter.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/fs_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/git.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/git_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/github.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/gpg.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/input_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/killproc.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/list_functions.zsh (98%) rename {plugins => .local/share/zsh/plugins/local}/common/markdown-preview.zsh (96%) rename {plugins => .local/share/zsh/plugins/local}/common/nextcloud.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/number_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/nx.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/ollama.disabled.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/os_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/pkg_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/proc_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/sc.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/spinner.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/ssh_server.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/ssh_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/string_utils.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/talk_export.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/tmux.zsh (100%) rename {plugins => .local/share/zsh/plugins/local}/common/tpl.zsh (100%) create mode 100644 .stow-local-ignore rename {plugins => _plugins}/loader.zsh (100%) rename {plugins => _plugins}/motd/10-logo (85%) diff --git a/.config/lazygit.yml b/.config/lazygit/config.yml similarity index 100% rename from .config/lazygit.yml rename to .config/lazygit/config.yml diff --git a/.config/nvim/lua/casraf/plugins/remap.lua b/.config/nvim/lua/casraf/plugins/remap.lua index 595e1143..05f47e9e 100644 --- a/.config/nvim/lua/casraf/plugins/remap.lua +++ b/.config/nvim/lua/casraf/plugins/remap.lua @@ -284,9 +284,9 @@ local function nope() vim.keymap.set("n", "x", "!chmod +x %", { silent = true, desc = "Make file executable" }) vim.keymap.set("n", "X", "!chmod -x %", { silent = true, desc = "Make file not executable" }) - vim.keymap.set("n", "vpp", "e ~/.dotfiles/.config/nvim/lua/casraf/packer.lua", - { desc = "Edit packer config" }); - vim.keymap.set("n", "vpr", "e ~/.dotfiles/.config/nvim/lua/casraf/remap.lua", + vim.keymap.set("n", "vpp", "e ~/.config/nvim/lua/casraf/plugins/init.lua", + { desc = "Edit plugins config" }); + vim.keymap.set("n", "vpr", "e ~/.config/nvim/lua/casraf/plugins/remap.lua", { desc = "Edit remaps" }); -- vim.keymap.set("n", "mir", "CellularAutomaton make_it_rain", { desc = "Make it rain" }); -- vim.keymap.set("n", "gol", "CellularAutomaton game_of_life", { desc = "Game of life" }); diff --git a/.config/sofmani.yml b/.config/sofmani.yml index 31cd8720..db6a8092 100644 --- a/.config/sofmani.yml +++ b/.config/sofmani.yml @@ -25,35 +25,6 @@ install: # - category: 🧰 Configs & Dotfiles # desc: Installers that sync dotfiles or apply local system configurations. - - name: .config - type: rsync - tags: config dotfiles sofmani-config - skip_summary: - update: true - opts: - source: $DOTFILES/.config/ - destination: ~/.config/ - flags: --exclude lazygit.yml --exclude nvim --exclude .git --exclude .DS_Store --exclude 'tmux_*.yml' - - - name: editorconfig - type: rsync - tags: config dotfiles - skip_summary: - update: true - opts: - source: $DOTFILES/.editorconfig.global - destination: ~/.editorconfig - - - name: nvim-config - type: rsync - tags: config nvim-config - skip_summary: - update: true - opts: - source: $DOTFILES/.config/nvim/ - destination: ~/.config/nvim/ - flags: --delete --exclude .git --exclude .DS_Store - - name: tmux-config type: shell tags: config tmux @@ -69,21 +40,22 @@ install: - name: tx-config type: shell tags: config tmux - enabled: test -f "$DOTFILES/.config/tmux_{{ .DeviceIDAlias }}.yml" + enabled: test -f "$HOME/.config/tmux_{{ .DeviceIDAlias }}.yml" check_installed: test -f ~/.config/tmux_local.yml - check_has_update: '! diff -q "$DOTFILES/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml > /dev/null 2>&1' + check_has_update: '! diff -q "$HOME/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml > /dev/null 2>&1' opts: - command: cp "$DOTFILES/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml - update_command: cp "$DOTFILES/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml + command: cp "$HOME/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml + update_command: cp "$HOME/.config/tmux_{{ .DeviceIDAlias }}.yml" ~/.config/tmux_local.yml - name: lazygit-config - type: rsync + type: shell tags: lazygit lazygit-config config skip_summary: update: true opts: - source: $DOTFILES/.config/lazygit.yml - destination: $LAZYGIT_HOME/config.yml + check_installed: test -L "$LAZYGIT_HOME/config.yml" + command: ln -sf "$HOME/.config/lazygit.yml" "$LAZYGIT_HOME/config.yml" + update_command: ln -sf "$HOME/.config/lazygit.yml" "$LAZYGIT_HOME/config.yml" - name: osx-defaults type: shell @@ -150,7 +122,7 @@ install: git config --global gpg.format "ssh" git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers" git config --global commit.gpgsign true - git config --global maintenance.repo "~/.dotfiles" + git config --global maintenance.repo "$HOME/.dotfiles.git" git config --global fetch.writeCommitGraph true git config --global log.showSignature true git config --global core.excludesfile ~/.config/.gitignore @@ -500,7 +472,7 @@ install: opts: bin_name: tx command: | - cd $DOTFILES/utils + cd $HOME/.config/dotfiles/utils pnpm i && pnpm build && pnpm ginst - name: pandoc @@ -755,15 +727,7 @@ install: # - category: 🔌 Zsh & Tmux Plugins # desc: Git-based plugins and themes for Zsh shell and Tmux. - - name: local-plugins - type: rsync - tags: plugin config - post_install: source "$DOTFILES/plugins/loader.zsh" - post_update: source "$DOTFILES/plugins/loader.zsh" - opts: - source: ~/.dotfiles/plugins/ - destination: ~/.local/share/zsh/plugins/local/ - flags: --delete + # local-plugins: no longer needed — tracked in-place by bare repo at ~/.local/share/zsh/plugins/local/ - name: mfaerevaag/wd type: git diff --git a/.editorconfig b/.editorconfig index c1d757f3..0a7e4ea5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,9 +1,39 @@ +root = true + [*] -tab_width = 2 -indent_size = 2 +charset = utf-8 +end_of_line = lf indent_style = space +indent_size = 2 +tab_width = 2 insert_final_newline = true trim_trailing_whitespace = true -[*.md] +[*.{md,markdown}] trim_trailing_whitespace = false + +[Makefile] +indent_style = tab +indent_size = 4 +tab_width = 4 + +[*.py] +indent_size = 4 + +[*.go] +indent_style = tab + +[*.gd] +indent_style = tab +indent_size = 4 +tab_width = 4 + +[*.cs] +indent_size = 4 + +[*.{java,kt,kts}] +indent_size = 4 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 diff --git a/.editorconfig.global b/.editorconfig.global deleted file mode 100644 index 0a7e4ea5..00000000 --- a/.editorconfig.global +++ /dev/null @@ -1,39 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_style = space -indent_size = 2 -tab_width = 2 -insert_final_newline = true -trim_trailing_whitespace = true - -[*.{md,markdown}] -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab -indent_size = 4 -tab_width = 4 - -[*.py] -indent_size = 4 - -[*.go] -indent_style = tab - -[*.gd] -indent_style = tab -indent_size = 4 -tab_width = 4 - -[*.cs] -indent_size = 4 - -[*.{java,kt,kts}] -indent_size = 4 - -[*.{yml,yaml}] -indent_style = space -indent_size = 2 diff --git a/.gitignore b/.gitignore index b1e37417..b545f265 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ plugins/.cache .config/local.tmux var/log/sofmani .config/tmux_local.yml +/_plugins/.cache diff --git a/plugins/ascii_font/ascii_font.plugin.zsh b/.local/share/zsh/plugins/local/ascii_font/ascii_font.plugin.zsh similarity index 98% rename from plugins/ascii_font/ascii_font.plugin.zsh rename to .local/share/zsh/plugins/local/ascii_font/ascii_font.plugin.zsh index d3a59671..1feaad91 100755 --- a/plugins/ascii_font/ascii_font.plugin.zsh +++ b/.local/share/zsh/plugins/local/ascii_font/ascii_font.plugin.zsh @@ -2,7 +2,7 @@ ascii-text() { # ascii-font() { - dir="$DOTFILES/plugins/ascii_font" + dir="${0:A:h}" font="$dir/fonts/Big-Money-ne" size=1 color="" diff --git a/plugins/ascii_font/fonts/Big-Money-ne.flf b/.local/share/zsh/plugins/local/ascii_font/fonts/Big-Money-ne.flf similarity index 100% rename from plugins/ascii_font/fonts/Big-Money-ne.flf rename to .local/share/zsh/plugins/local/ascii_font/fonts/Big-Money-ne.flf diff --git a/plugins/assets/mdp-template.html b/.local/share/zsh/plugins/local/assets/mdp-template.html similarity index 100% rename from plugins/assets/mdp-template.html rename to .local/share/zsh/plugins/local/assets/mdp-template.html diff --git a/plugins/common.plugin.zsh b/.local/share/zsh/plugins/local/common.plugin.zsh similarity index 100% rename from plugins/common.plugin.zsh rename to .local/share/zsh/plugins/local/common.plugin.zsh diff --git a/plugins/common/android.zsh b/.local/share/zsh/plugins/local/common/android.zsh similarity index 100% rename from plugins/common/android.zsh rename to .local/share/zsh/plugins/local/common/android.zsh diff --git a/plugins/common/colors.zsh b/.local/share/zsh/plugins/local/common/colors.zsh similarity index 97% rename from plugins/common/colors.zsh rename to .local/share/zsh/plugins/local/common/colors.zsh index e1aec018..16c644ab 100755 --- a/plugins/common/colors.zsh +++ b/.local/share/zsh/plugins/local/common/colors.zsh @@ -55,7 +55,7 @@ all_colors() { echo "Display all 256 terminal colors. Use -f to force regenerate the cache." return 0 fi - cache_file="$DOTFILES/plugins/.cache/colors.cache" + cache_file="$PLUGINS_DIR/local/.cache/colors.cache" if [[ "$1" == "-f" ]]; then rm -f $cache_file fi diff --git a/plugins/common/copilot.zsh b/.local/share/zsh/plugins/local/common/copilot.zsh similarity index 100% rename from plugins/common/copilot.zsh rename to .local/share/zsh/plugins/local/common/copilot.zsh diff --git a/plugins/common/defaults.zsh b/.local/share/zsh/plugins/local/common/defaults.zsh similarity index 100% rename from plugins/common/defaults.zsh rename to .local/share/zsh/plugins/local/common/defaults.zsh diff --git a/plugins/common/docker.zsh b/.local/share/zsh/plugins/local/common/docker.zsh similarity index 100% rename from plugins/common/docker.zsh rename to .local/share/zsh/plugins/local/common/docker.zsh diff --git a/plugins/common/dotfiles_edit.zsh b/.local/share/zsh/plugins/local/common/dotfiles_edit.zsh similarity index 100% rename from plugins/common/dotfiles_edit.zsh rename to .local/share/zsh/plugins/local/common/dotfiles_edit.zsh diff --git a/plugins/common/flutter.zsh b/.local/share/zsh/plugins/local/common/flutter.zsh similarity index 100% rename from plugins/common/flutter.zsh rename to .local/share/zsh/plugins/local/common/flutter.zsh diff --git a/plugins/common/fs_utils.zsh b/.local/share/zsh/plugins/local/common/fs_utils.zsh similarity index 100% rename from plugins/common/fs_utils.zsh rename to .local/share/zsh/plugins/local/common/fs_utils.zsh diff --git a/plugins/common/git.zsh b/.local/share/zsh/plugins/local/common/git.zsh similarity index 100% rename from plugins/common/git.zsh rename to .local/share/zsh/plugins/local/common/git.zsh diff --git a/plugins/common/git_utils.zsh b/.local/share/zsh/plugins/local/common/git_utils.zsh similarity index 100% rename from plugins/common/git_utils.zsh rename to .local/share/zsh/plugins/local/common/git_utils.zsh diff --git a/plugins/common/github.zsh b/.local/share/zsh/plugins/local/common/github.zsh similarity index 100% rename from plugins/common/github.zsh rename to .local/share/zsh/plugins/local/common/github.zsh diff --git a/plugins/common/gpg.zsh b/.local/share/zsh/plugins/local/common/gpg.zsh similarity index 100% rename from plugins/common/gpg.zsh rename to .local/share/zsh/plugins/local/common/gpg.zsh diff --git a/plugins/common/input_utils.zsh b/.local/share/zsh/plugins/local/common/input_utils.zsh similarity index 100% rename from plugins/common/input_utils.zsh rename to .local/share/zsh/plugins/local/common/input_utils.zsh diff --git a/plugins/common/killproc.zsh b/.local/share/zsh/plugins/local/common/killproc.zsh similarity index 100% rename from plugins/common/killproc.zsh rename to .local/share/zsh/plugins/local/common/killproc.zsh diff --git a/plugins/common/list_functions.zsh b/.local/share/zsh/plugins/local/common/list_functions.zsh similarity index 98% rename from plugins/common/list_functions.zsh rename to .local/share/zsh/plugins/local/common/list_functions.zsh index dab70346..aebf239e 100755 --- a/plugins/common/list_functions.zsh +++ b/.local/share/zsh/plugins/local/common/list_functions.zsh @@ -40,7 +40,7 @@ hscl() { fi # Get the plugins directory (directory of this script) - local plugins_dir="$DOTFILES/plugins" + local plugins_dir="$PLUGINS_DIR/local" # Find all script files in plugins directory and subdirectories local script_files=("${plugins_dir}"/**/*.zsh(N)) diff --git a/plugins/common/markdown-preview.zsh b/.local/share/zsh/plugins/local/common/markdown-preview.zsh similarity index 96% rename from plugins/common/markdown-preview.zsh rename to .local/share/zsh/plugins/local/common/markdown-preview.zsh index df243752..0b40da83 100755 --- a/plugins/common/markdown-preview.zsh +++ b/.local/share/zsh/plugins/local/common/markdown-preview.zsh @@ -36,7 +36,7 @@ mdp() { done filename=${1:-README.md} - html_file="$DOTFILES/plugins/assets/mdp-template.html" + html_file="$PLUGINS_DIR/local/assets/mdp-template.html" title=$(basename $filename) filewoext="$(basename ${filename%.*})" diff --git a/plugins/common/nextcloud.zsh b/.local/share/zsh/plugins/local/common/nextcloud.zsh similarity index 100% rename from plugins/common/nextcloud.zsh rename to .local/share/zsh/plugins/local/common/nextcloud.zsh diff --git a/plugins/common/number_utils.zsh b/.local/share/zsh/plugins/local/common/number_utils.zsh similarity index 100% rename from plugins/common/number_utils.zsh rename to .local/share/zsh/plugins/local/common/number_utils.zsh diff --git a/plugins/common/nx.zsh b/.local/share/zsh/plugins/local/common/nx.zsh similarity index 100% rename from plugins/common/nx.zsh rename to .local/share/zsh/plugins/local/common/nx.zsh diff --git a/plugins/common/ollama.disabled.zsh b/.local/share/zsh/plugins/local/common/ollama.disabled.zsh similarity index 100% rename from plugins/common/ollama.disabled.zsh rename to .local/share/zsh/plugins/local/common/ollama.disabled.zsh diff --git a/plugins/common/os_utils.zsh b/.local/share/zsh/plugins/local/common/os_utils.zsh similarity index 100% rename from plugins/common/os_utils.zsh rename to .local/share/zsh/plugins/local/common/os_utils.zsh diff --git a/plugins/common/pkg_utils.zsh b/.local/share/zsh/plugins/local/common/pkg_utils.zsh similarity index 100% rename from plugins/common/pkg_utils.zsh rename to .local/share/zsh/plugins/local/common/pkg_utils.zsh diff --git a/plugins/common/proc_utils.zsh b/.local/share/zsh/plugins/local/common/proc_utils.zsh similarity index 100% rename from plugins/common/proc_utils.zsh rename to .local/share/zsh/plugins/local/common/proc_utils.zsh diff --git a/plugins/common/sc.zsh b/.local/share/zsh/plugins/local/common/sc.zsh similarity index 100% rename from plugins/common/sc.zsh rename to .local/share/zsh/plugins/local/common/sc.zsh diff --git a/plugins/common/spinner.zsh b/.local/share/zsh/plugins/local/common/spinner.zsh similarity index 100% rename from plugins/common/spinner.zsh rename to .local/share/zsh/plugins/local/common/spinner.zsh diff --git a/plugins/common/ssh_server.zsh b/.local/share/zsh/plugins/local/common/ssh_server.zsh similarity index 100% rename from plugins/common/ssh_server.zsh rename to .local/share/zsh/plugins/local/common/ssh_server.zsh diff --git a/plugins/common/ssh_utils.zsh b/.local/share/zsh/plugins/local/common/ssh_utils.zsh similarity index 100% rename from plugins/common/ssh_utils.zsh rename to .local/share/zsh/plugins/local/common/ssh_utils.zsh diff --git a/plugins/common/string_utils.zsh b/.local/share/zsh/plugins/local/common/string_utils.zsh similarity index 100% rename from plugins/common/string_utils.zsh rename to .local/share/zsh/plugins/local/common/string_utils.zsh diff --git a/plugins/common/talk_export.zsh b/.local/share/zsh/plugins/local/common/talk_export.zsh similarity index 100% rename from plugins/common/talk_export.zsh rename to .local/share/zsh/plugins/local/common/talk_export.zsh diff --git a/plugins/common/tmux.zsh b/.local/share/zsh/plugins/local/common/tmux.zsh similarity index 100% rename from plugins/common/tmux.zsh rename to .local/share/zsh/plugins/local/common/tmux.zsh diff --git a/plugins/common/tpl.zsh b/.local/share/zsh/plugins/local/common/tpl.zsh similarity index 100% rename from plugins/common/tpl.zsh rename to .local/share/zsh/plugins/local/common/tpl.zsh diff --git a/.stow-local-ignore b/.stow-local-ignore new file mode 100644 index 00000000..b888478e --- /dev/null +++ b/.stow-local-ignore @@ -0,0 +1,24 @@ +\.git +\.gitignore +\.stow-local-ignore +\.claude +\.DS_Store +\.device_uid +\.github +exports\.zsh +aliases\.zsh +_local\.zsh +autoload_completions\.zsh +completions +_plugins +utils +brew +node_modules +pnpm-lock\.yaml +README\.md +\.prettierrc +\.prettierignore +\.eslintignore +\.shellcheckrc +\.config/tmux_m1\.yml +\.config/tmux_planck\.yml diff --git a/.zshrc b/.zshrc index 88c9671f..3838c438 100644 --- a/.zshrc +++ b/.zshrc @@ -25,14 +25,14 @@ export DOTBIN_META="$HOME/.config/.bin" # Load sofmani-managed zsh plugins -source "$DOTFILES/plugins/loader.zsh" +source "$DOTFILES/_plugins/loader.zsh" wd() { . ~/.local/share/zsh/plugins/wd/wd.sh } source "$DOTFILES/exports.zsh" if [[ -t 0 && -t 1 ]]; then - [[ "$1" == "-q" ]] || run-parts "$DOTFILES/plugins/motd" + [[ "$1" == "-q" ]] || run-parts "$DOTFILES/_plugins/motd" fi # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. diff --git a/README.md b/README.md index 6eebeec6..4d0fea98 100644 --- a/README.md +++ b/README.md @@ -78,26 +78,60 @@ Some (but not all) of the plugins/modifications are listed here: ## How to install -1. Install zsh +1. Install zsh and [GNU Stow](https://www.gnu.org/software/stow/) + + ```bash + brew install stow + ``` + 2. Clone this repository into `~/.dotfiles`: ```bash git clone git@github.com:chenasraf/dotfiles.git --depth 1 ~/.dotfiles ``` -3. Replace entire contents of `~/.zshrc` to the new version using (`ln -s` does **not** work): +3. Symlink configs into your home directory using stow: ```bash - echo 'source "$HOME/.dotfiles/.zshrc"' > ~/.zshrc + cd ~/.dotfiles + stow -t ~ . ``` -4. Run install scripts: + This creates symlinks for `.zshrc`, `.editorconfig`, `.config/*`, `.local/share/zsh/plugins/local/*`, etc. + Files listed in `.stow-local-ignore` (scripts, utilities, repo metadata) are excluded. + + To restow after pulling changes: ```bash - source ~/.dotfiles/install.zsh + cd ~/.dotfiles + stow -R -t ~ . ``` - And reload the terminal +4. Install tools via [sofmani](https://github.com/chenasraf/sofmani): + + ```bash + sofmani + ``` + + This handles brew packages, git plugins, language runtimes, and other dependencies. + +### Structure + +``` +~/.dotfiles/ +├── .config/ # App configs (aerospace, alacritty, ghostty, lazygit, nvim, tmux, wezterm, ...) +├── .local/ # Zsh plugins (stowed to ~/.local/share/zsh/plugins/local/) +├── .editorconfig # Global editorconfig (stowed to ~/.editorconfig) +├── .zshrc # Shell config (stowed to ~/.zshrc) +├── exports.zsh # Environment variables (sourced by .zshrc) +├── aliases.zsh # Shell aliases (sourced by .zshrc) +├── completions/ # Zsh completions (added to fpath by .zshrc) +├── _plugins/ # Plugin loader and MOTD scripts (sourced from $DOTFILES) +├── utils/ # Build utilities +└── .stow-local-ignore +``` + +Stow symlinks everything in the repo root into `~`, except items in `.stow-local-ignore` (scripts, utilities, and repo metadata that are sourced directly from `$DOTFILES`). ## My Other Stuff diff --git a/plugins/loader.zsh b/_plugins/loader.zsh similarity index 100% rename from plugins/loader.zsh rename to _plugins/loader.zsh diff --git a/plugins/motd/10-logo b/_plugins/motd/10-logo similarity index 85% rename from plugins/motd/10-logo rename to _plugins/motd/10-logo index fc976b27..ee7738d3 100755 --- a/plugins/motd/10-logo +++ b/_plugins/motd/10-logo @@ -1,7 +1,7 @@ #!/usr/bin/env zsh source "$DOTFILES/aliases.zsh" -source $DOTFILES/plugins/ascii_font/ascii_font.plugin.zsh +source $DOTFILES/_plugins/ascii_font/ascii_font.plugin.zsh if [[ $(hostname) == 'spider.casraf.dev' || $(hostname) == 'spider' ]]; then text='spider' diff --git a/aliases.zsh b/aliases.zsh index 30d213dd..f452bcad 100755 --- a/aliases.zsh +++ b/aliases.zsh @@ -87,9 +87,9 @@ alias hdiff="home git diff" alias hdiff1="home git diff HEAD~1" alias hf="home git fetch" alias hp="home push" -alias hl="home pull && cp ~/.dotfiles/.config/sofmani.yml ~/.config/" +alias hl="home pull && stow -R -t ~ ." alias hlog="home git log" -alias motd="run-parts \$DOTFILES/plugins/motd" +alias motd="run-parts \$DOTFILES/_plugins/motd" alias spider="ssh root@spider.casraf.dev" # docker diff --git a/exports.zsh b/exports.zsh index 6ff311ce..fbdd4d58 100755 --- a/exports.zsh +++ b/exports.zsh @@ -15,10 +15,10 @@ export PLUGINS_DIR="$HOME/.local/share/zsh/plugins" export TMUX_PLUGINS_DIR="$HOME/.tmux/plugins" # Lazygit -if [[ -d "$HOME/Library/ApplicationSupport/lazygit" ]]; then - export LAZYGIT_HOME="$HOME/Library/ApplicationSupport/lazygit" -elif [[ -d "$HOME/.config/lazygit" ]]; then +if [[ -d "$HOME/.config/lazygit" ]]; then export LAZYGIT_HOME="$HOME/.config/lazygit" +elif [[ -d "$HOME/Library/ApplicationSupport/lazygit" ]]; then + export LAZYGIT_HOME="$HOME/Library/ApplicationSupport/lazygit" fi # Postgres.app