diff --git a/README.md b/README.md index e895c35..d59bf4b 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Or your usual **`dfu`** alias if it wraps the same steps. ## Layout notes -- **Fish** (`dot_config/fish/`): `conf.d/` snippets (PATH from **`00-chezmoi-path.fish.tmpl`**, env, abbreviations, dircolors, Catppuccin theme, vi bindings, secrets) and **`functions/`** for `dfu`, `load_secret`, `cdgr`, `up`, helpers, plus **`fish_prompt`** / **`fish_right_prompt`** (cwd + `USER at <~/.name>` + `fish_git_prompt`). Not ported from zsh: async right-prompt, `tog` / `vshow` / `vmultiline`. +- **Fish** (`dot_config/fish/`): `conf.d/` snippets (PATH from **`00-path.fish.tmpl`**, env, abbreviations, Catppuccin theme, vi bindings, secrets) and **`functions/`** for `dfu`, `load_secret`, `mcd`, `peek`, `up`, plus **`fish_prompt`** / **`fish_right_prompt`** (cwd + `USER at <~/.name>` + `fish_git_prompt`). Not ported from zsh: async right-prompt, `tog` / `vshow` / `vmultiline`. - **Vim externals** ([`.chezmoiexternal.toml`](.chezmoiexternal.toml)): [vim-polyglot](https://github.com/sheerun/vim-polyglot) for bundled syntax; [vim-go](https://github.com/fatih/vim-go) with **`g:polyglot_disabled = ['go']`** in `dot_vimrc` so Go stays on vim-go. Separate trees for [preservim/nerdtree](https://github.com/preservim/nerdtree), [lightline.vim](https://github.com/itchyny/lightline.vim), [material.vim](https://github.com/kaicataldo/material.vim), [incsearch.vim](https://github.com/haya14busa/incsearch.vim). Dircolors: [nordtheme/dircolors](https://github.com/nordtheme/dircolors) under `~/.shell/plugins/nord-dircolors/`. - **`dot_zshrc.tmpl`**: main zsh init (PATH, Homebrew on macOS, shared `~/.shell` and `~/.zsh` bits). Optional **`~/.zshrc.local`** is sourced last for machine-only overrides (not in this repo). - **`dot_hammerspoon/`** is skipped on non-macOS via **`.chezmoiignore.tmpl`**. diff --git a/dot_config/fish/functions/_machine_name.fish b/dot_config/fish/functions/_machine_name.fish new file mode 100644 index 0000000..031fcc3 --- /dev/null +++ b/dot_config/fish/functions/_machine_name.fish @@ -0,0 +1,7 @@ +function _machine_name + if test -f $HOME/.name + cat $HOME/.name + else + hostname -s + end +end diff --git a/dot_config/fish/functions/fish_prompt.fish b/dot_config/fish/functions/fish_prompt.fish new file mode 100644 index 0000000..26d2b06 --- /dev/null +++ b/dot_config/fish/functions/fish_prompt.fish @@ -0,0 +1,15 @@ +function fish_prompt + set -l cmd_status $status + + echo -n (set_color green)(prompt_pwd)(set_color normal)' ' + + if test $cmd_status -ne 0 + echo -n (set_color red)'!'(set_color normal)' ' + end + + if test (id -u) -eq 0 + echo -n (set_color red)'>'(set_color normal)' ' + else + echo -n (set_color magenta)'>'(set_color normal)' ' + end +end diff --git a/dot_config/fish/functions/fish_right_prompt.fish b/dot_config/fish/functions/fish_right_prompt.fish new file mode 100644 index 0000000..fc0eead --- /dev/null +++ b/dot_config/fish/functions/fish_right_prompt.fish @@ -0,0 +1,12 @@ +function fish_right_prompt + if test (id -u) -eq 0 + echo -n (set_color red)(whoami)(set_color normal) + else + echo -n (set_color magenta)(whoami)(set_color normal) + end + + echo -n (set_color blue)' at '(set_color normal) + echo -n (set_color cyan)(_machine_name)(set_color normal)' ' + + fish_git_prompt +end