From fc5c26df3366a0de842cc868138f9780f0f396df Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:04:56 +0900 Subject: [PATCH 01/13] fix(load.sh): use /usr/bin/env bash\n\nFixes #13 --- etc/load.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/load.sh b/etc/load.sh index 0636e15aa..a368a49fd 100755 --- a/etc/load.sh +++ b/etc/load.sh @@ -1,4 +1,4 @@ -#!/usr/bash +#!/usr/bin/env bash export PLATFORM From 986994267b0255c21cc97e8a9bbf9492fc846103 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:11:44 +0900 Subject: [PATCH 02/13] fix(zshrc): guard anyenv init and correct KREW_ROOT path\n\nFixes #14 --- .zshrc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.zshrc b/.zshrc index 81a1d883d..f68607ef5 100755 --- a/.zshrc +++ b/.zshrc @@ -21,14 +21,16 @@ export PATH="$HOME/.cargo/bin:$PATH" export PATH="$HOME/.bin:$PATH" -# krew -export PATH="${KWER_ROOT:-$HOME/.krew}/bin:$PATH" +# krew: fix env var name (KREW_ROOT) +export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH" fpath=($HOME/.zsh/completion $fpath) -# anyenv -export PATH="$HOME/.anyenv/bin:$PATH" -eval "$(anyenv init -)" +# anyenv: guard initialization when not installed +if command -v anyenv >/dev/null 2>&1; then + export PATH="$HOME/.anyenv/bin:$PATH" + eval "$(anyenv init -)" +fi # Go export GOPATH="$HOME/go" From b0ae9027403d14184f1db1029ca0be47c049b4f0 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:13:18 +0900 Subject: [PATCH 03/13] fix(link.sh): make script POSIX-compliant under /bin/sh\n\nFixes #15 --- etc/link.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/etc/link.sh b/etc/link.sh index 5b4245931..1172957d7 100755 --- a/etc/link.sh +++ b/etc/link.sh @@ -1,17 +1,19 @@ #!/bin/sh +set -eu + DOT_DIRECTORY="${HOME}/dotfiles" -cd ${DOT_DIRECTORY} +cd "$DOT_DIRECTORY" -for f in .??* -do - [[ ${f} = ".git" ]] && continue - [[ ${f} = ".gitignore" ]] && continue - [[ ${f} = ".DS_Store" ]] && continue - ln -snfv ${DOT_DIRECTORY}/${f} ${HOME}/${f} +for f in .??*; do + [ "$f" = ".git" ] && continue + [ "$f" = ".gitignore" ] && continue + [ "$f" = ".DS_Store" ] && continue + ln -snfv "$DOT_DIRECTORY/$f" "$HOME/$f" done -ln -s ${DOT_DIRECTORY}/.tmux/.tmux.conf $HOME/.tmux.conf -if [[ `uname` = "Darwin" ]];then - ln -s ${DOT_DIRECTORY}/.tmux/.tmux.conf.mac $HOME/.tmux.conf.mac + +ln -snfv "$DOT_DIRECTORY/.tmux/.tmux.conf" "$HOME/.tmux.conf" +if [ "$(uname)" = "Darwin" ]; then + ln -snfv "$DOT_DIRECTORY/.tmux/.tmux.conf.mac" "$HOME/.tmux.conf.mac" fi echo 'Deploy dotfiles completed.' From 084842c93ba822ee340585cf05fbcd2ecfc01dd6 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:14:00 +0900 Subject: [PATCH 04/13] fix(set.sh): remove destructive rm -rf ~/.config; backup and link safely\n\nFixes #16 --- etc/set.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/etc/set.sh b/etc/set.sh index 29ea6cdec..f4ed29093 100755 --- a/etc/set.sh +++ b/etc/set.sh @@ -16,7 +16,20 @@ case "${OS}" in ;; esac -mv $HOME/.enhancd $HOME/dotfiles/.enhancd -mv $HOME/.cache $HOME/dotfiles/.cache -rm -rf $HOME/.config -sh $HOME/.config/nvim/init.sh +mv "$HOME/.enhancd" "$HOME/dotfiles/.enhancd" 2>/dev/null || true +mv "$HOME/.cache" "$HOME/dotfiles/.cache" 2>/dev/null || true + +# Make setup non-destructive: avoid removing the entire ~/.config +# If ~/.config exists and is not a symlink, back it up once with a timestamp +if [ -e "$HOME/.config" ] && [ ! -L "$HOME/.config" ]; then + backup_dir="$HOME/.config.backup.$(date +%Y%m%d%H%M%S)" + echo "Backing up ~/.config to ${backup_dir}" + mv "$HOME/.config" "$backup_dir" +fi + +# If this repo provides a ~/.config directory, link it when no link exists +if [ -d "$HOME/dotfiles/.config" ] && [ ! -L "$HOME/.config" ]; then + ln -s "$HOME/dotfiles/.config" "$HOME/.config" +fi + +sh "$HOME/.config/nvim/init.sh" From 0d9bc02da5caa2f59f1459618dcb2e5809e74682 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:18:39 +0900 Subject: [PATCH 05/13] fix(configs): typos in efm and neoterm; add log_warn\n\n- efm: use lint-formats (plural) for yamllint\n- neoterm: correct key name to position\n- load.sh: rename duplicate log_fail to log_warn\n\nFixes #19 --- .config/efm-langserver/config.yaml | 2 +- .config/nvim/lua/init.lua | 2 +- etc/load.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/efm-langserver/config.yaml b/.config/efm-langserver/config.yaml index 43b87b779..8f035915e 100644 --- a/.config/efm-langserver/config.yaml +++ b/.config/efm-langserver/config.yaml @@ -12,5 +12,5 @@ languages: yaml: lint-command: 'yamllint -f parsable -' lint-stdin: true - lint-format: + lint-formats: - '%f:%l:%c: %m' diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/init.lua index 81a159b97..60bcb3538 100644 --- a/.config/nvim/lua/init.lua +++ b/.config/nvim/lua/init.lua @@ -264,7 +264,7 @@ require('lazy').setup({ config = function() vim.keymap.set('n', 'n', 'NeotermToggle', { noremap = true }) require('neoterm').setup { - positon = 'fullscreen', + position = 'fullscreen', noinsert = false } end diff --git a/etc/load.sh b/etc/load.sh index a368a49fd..c8226bf01 100755 --- a/etc/load.sh +++ b/etc/load.sh @@ -245,7 +245,7 @@ log_fail() { logging ERROR "$1" 1>&2 } -log_fail() { +log_warn() { logging WARN "$1" } From d7df720977351c31d613d4bb7632ce84aea3005e Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:20:52 +0900 Subject: [PATCH 06/13] fix(coc): remove hardcoded clangd.path; rely on default discovery\n\nFixes #20 --- .config/nvim/coc-settings.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index 4f939469c..2ea88d0e6 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -72,6 +72,5 @@ "python.venvPath": ".", "python.formatting.provider": "ruff", "python.linting.ruffEnabled": true, - "biome.requireConfiguration": false, - "clangd.path": "~/dotfiles/.config/coc/extensions/coc-clangd-data/install/19.1.2/clangd_19.1.2/bin/clangd" + "biome.requireConfiguration": false } From e14fa2d3d70706cc42f851c841bbca9d03b07ff9 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:24:09 +0900 Subject: [PATCH 07/13] chore(coc): set rust-analyzer updates channel to stable\n\nFixes #21 --- .config/nvim/coc-settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/nvim/coc-settings.json b/.config/nvim/coc-settings.json index 2ea88d0e6..2916f66dc 100644 --- a/.config/nvim/coc-settings.json +++ b/.config/nvim/coc-settings.json @@ -62,7 +62,7 @@ "coc.preferences.formatOnSave": true, "coc.preferences.useQuickfixForLocations": true, "explorer.icon.enableNerdfont": true, - "rust-analyzer.updates.channel": "nightly", + "rust-analyzer.updates.channel": "stable", "tsserver.log": "verbose", "tsserver.trace.server": "verbose", "yaml.format.enable": true, From 203457afb82b3280fbf91bc8d259346639670d4e Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:24:48 +0900 Subject: [PATCH 08/13] perf(tmux): lower status refresh and guard external commands\n\n- status-interval: 1s -> 5s to reduce CPU wakeups\n- add '|| echo -' fallbacks to #() commands\n\nFixes #22 --- .tmux/.tmux.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.tmux/.tmux.conf b/.tmux/.tmux.conf index 416eded1e..43ff19153 100644 --- a/.tmux/.tmux.conf +++ b/.tmux/.tmux.conf @@ -55,9 +55,9 @@ set -g status-left-length 40 set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" ## 右パネルを設定する set -g status-right-length 150 -set -g status-right "#[fg=white] #($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --interval 1 --averages-count 0) #[fg=red]#(cpu_temp) #[fg=green]#(get_gpu_temp 2) #[fg=yellow]#(wifi)#[default] #(get_battery -t) #[fg=blue] #(get_sound_device) #[fg=magenta] #(get_volume)#[fg=cyan][%Y-%m-%d(%a) %H:%M:%S]" +set -g status-right "#[fg=white] #($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --interval 1 --averages-count 0 || echo '-') #[fg=red]#(cpu_temp || echo '-') #[fg=green]#(get_gpu_temp 2 || echo '-') #[fg=yellow]#(wifi || echo '-')#[default] #(get_battery -t || echo '-') #[fg=blue] #(get_sound_device || echo '-') #[fg=magenta] #(get_volume || echo '-')#[fg=cyan][%Y-%m-%d(%a) %H:%M:%S]" ## リフレッシュの間隔を設定する(デフォルト 15秒) -set -g status-interval 1 +set -g status-interval 5 ## ウィンドウリストの位置を中心寄せにする set -g status-justify centre ## ヴィジュアルノーティフィケーションを有効にする From f0607bed4d6df400d90a3e80793c0c4836fdb7eb Mon Sep 17 00:00:00 2001 From: coil398 Date: Sat, 9 Aug 2025 23:37:57 +0900 Subject: [PATCH 09/13] chore: remove absolute nvim symlink and document linking guidance\n\nFixes #23 --- README.md | 15 ++++++++++++--- nvim | 1 - 2 files changed, 12 insertions(+), 4 deletions(-) delete mode 120000 nvim diff --git a/README.md b/README.md index 3c278203c..b282e8efe 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ -My best dotfiles. - - curl -fsSL https://raw.githubusercontent.com/coil398/dotfiles/master/etc/init.sh | sh +My best dotfiles. + +- Install: `curl -fsSL https://raw.githubusercontent.com/coil398/dotfiles/master/etc/init.sh | sh` + +Notes +- Do not commit absolute, machine-specific symlinks in the repo (e.g., `nvim -> /Users/...`). +- To link Neovim config on your machine, run one of: + - `sh etc/link.sh` (links dotfiles, including `.config` contents) + - `ln -snfv "$PWD/.config/nvim" "$HOME/.config/nvim"` + +Baseline +- Target Ubuntu for Linux instructions; prefer apt-based tooling. diff --git a/nvim b/nvim deleted file mode 120000 index 53291ca78..000000000 --- a/nvim +++ /dev/null @@ -1 +0,0 @@ -/Users/takumikawase/dotfiles/.config/nvim \ No newline at end of file From 1e6dfd00dba455eb8675cec6f33f14cd9425a498 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sun, 10 Aug 2025 00:14:01 +0900 Subject: [PATCH 10/13] chore(gitignore): allow tracking wezterm and coc configs\n\nFixes #24 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 270393ff3..717ae3be1 100755 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,8 @@ !/.config/efm-langserver/ !/.config/alacritty/ !/.config/procs/ +!/.config/wezterm/ +!/.config/coc/ /node_modules/ .DS_Store .node-version From fece0c747d0a382a16284c56c8464eed0b1dc428 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sun, 10 Aug 2025 00:16:35 +0900 Subject: [PATCH 11/13] docs/wezterm: drop WSL:Arch defaults; document Ubuntu baseline\n\nFixes #12 --- .config/wezterm/.wezterm.lua | 12 +----------- README.md | 3 ++- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/.config/wezterm/.wezterm.lua b/.config/wezterm/.wezterm.lua index 4ff9daa7c..1b94bf1f7 100644 --- a/.config/wezterm/.wezterm.lua +++ b/.config/wezterm/.wezterm.lua @@ -15,17 +15,7 @@ local config = { } } -if wezterm.target_triple == 'x86_64-pc-windows-msvc' then - config.default_domain = 'WSL:Arch' - config.wsl_domains = { - { - name = 'WSL:Arch', - distribution = 'Arch', - username = 'coil398', - default_cwd = '/home/coil398' - } - } -elseif wezterm.target_triple == 'aarch64-apple-darwin' or wezterm.target_triple == 'x64_64-apple-darwin' then +if wezterm.target_triple == 'aarch64-apple-darwin' or wezterm.target_triple == 'x64_64-apple-darwin' then config.font_size = 13.0 end diff --git a/README.md b/README.md index b282e8efe..005556804 100755 --- a/README.md +++ b/README.md @@ -9,4 +9,5 @@ Notes - `ln -snfv "$PWD/.config/nvim" "$HOME/.config/nvim"` Baseline -- Target Ubuntu for Linux instructions; prefer apt-based tooling. +- Linux baseline is Ubuntu; prefer apt-based tooling. +- Avoid hardcoding WSL distributions or user-specific settings in config files. From 3cfc82d88f481c31fde8e91ef3943aa3ed6fad25 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sun, 10 Aug 2025 00:17:44 +0900 Subject: [PATCH 12/13] ci: add ShellCheck workflow for etc/ and bin/\n\nFixes #25 --- .github/workflows/shellcheck.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 000000000..7209e9e69 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,26 @@ +name: ShellCheck + +on: + push: + pull_request: + +jobs: + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install ShellCheck + run: | + sudo apt-get update + sudo apt-get install -y shellcheck + - name: Run ShellCheck + run: | + set -e + shopt -s globstar nullglob || true + files=(etc/**/*.sh bin/**/*) + # Fallback if bashisms are not available + if [ ${#files[@]} -eq 0 ]; then + files=$(find etc bin -type f -name "*.sh" 2>/dev/null || true) + fi + echo "Linting: ${files[@]}" + shellcheck -S warning ${files[@]} From 1cc6d46f58631950a8fa5cf5d593bb379ef9b572 Mon Sep 17 00:00:00 2001 From: coil398 Date: Sun, 10 Aug 2025 00:19:58 +0900 Subject: [PATCH 13/13] docs: Ubuntu baseline, prerequisites, and keybindings\n\nFixes #26 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 005556804..069a534d4 100755 --- a/README.md +++ b/README.md @@ -11,3 +11,12 @@ Notes Baseline - Linux baseline is Ubuntu; prefer apt-based tooling. - Avoid hardcoding WSL distributions or user-specific settings in config files. + +Prerequisites +- Ubuntu: `sudo apt update && sudo apt install -y git curl neovim tmux shellcheck` +- macOS: install Homebrew, then `brew install git curl neovim tmux shellcheck` + +Keybindings +- tmux: prefix is `C-q` (Ctrl+q). Reload config: `prefix + r`. +- Neovim: toggle terminal (neoterm) with `n`; Telescope is included, common mappings follow defaults (`ff`, etc., if configured). +- coc.nvim: format on save/type is enabled; check `:CocConfig` for language settings.