Skip to content

maxdevjs/dotfiles-fish

Repository files navigation

dotfiles-fish

Configuration files for the fish shell.

kitty screenshot listing the content of the
  folder

How to install it

When using yadm, add this repo as submodule. The general recipe is:

NOTE: this specific command MUST be issued in $HOME

~ $ yadm submodule add <url> path
~ $ yadm submodule update --init --recursive

In this specific case:

~ $ yadm submodule add https://github.com/maxdevjs/dotfiles-fish .config/fish
~ $ yadm submodule update --init --recursive

Plugins πŸ€ͺ

Plugins initilization

This repo is currently added as submodule to my dotfiles via yadm.

fish plugins are managed via fisher.

I encountered a few issues trying to bootstrap fisher πŸ¦Ήβ€β™‚οΈ after adding this submodule:

~ $ yadm submodule add https://github.com/maxdevjs/dotfiles-fish .config/fish

Everything did πŸ’₯ putting the Multiverse in πŸ”₯.

Theoretically I'd use fisher's shiny ~/.config/fish/fish_plugins file to install every needed plugin. In my case it looks something like:

jorgebucaran/fisher
rafaelrinaldi/pure
jethrokuan/z
acomagu/fish-async-prompt
jorgebucaran/spark.fish
joseluisq/gitnow
jorgebucaran/autopair.fish
gazorby/fish-abbreviation-tips

Unfortunately, on its own install fisher removes any previous track of ~/.config/fish/fish_plugins.

Troubleshooting
If needed, get rid of the submodule πŸ€•
  1. delete the relevant section from the ~/.gitmodules file:
[submodule ".config/fish"]
    path = .config/fish
    url = https://github.com/maxdevjs/dotfiles-fish
  1. stage the .gitmodules changes
~ $ git add .gitmodules
  1. delete the relevant section from ~/.local/share/yadm/repo.git/config
[submodule ".config/fish"]
    url = https://github.com/maxdevjs/dotfiles-fish
    active = true
  1. yadm rm --cached ~/.config/fish (no trailing slash)

  2. rm -rf ~/.local/share/yadm/repo.git/modules/.config/fish (no trailing slash)

  3. yadm commit -m "Remove fish submodule"

  4. delete the now untracked submodule files rm -rf ~/.config/fish

πŸ₯³πŸŽ‰πŸ˜ΊπŸΊπŸ˜‹

Current workaround 🩹
Hooks

NOTE: this must be set in ~/.local/share/yadm/repo.git/modules/.config/fish/hooks/

I use Git Hooks (8.3 Customizing Git - Git Hooks / githooks - Hooks used by Git), specifically the pre-commit, to:

  1. backup a copy of ~/.config/fish/fish_plugins to ~/.config/fish/fish_plugins_BACKUP
  2. git add ~/.config/fish/fish_plugins_BACKUP
Setup

setup is then executed via TODO: test it yadm bootstrap on submodule add/update.

The script basically does the following steps:

  1. fetch, install, and update fisher (at this point fisher will create a new ~/.config/fish/fish_plugins (eventually getting rid of any previous one))

  2. copy ~/.config/fish/fish_plugins_BACKUP over the ~/.config/fish/fish_plugins created at step 1

  3. fisher update to update/install the plugins

TODO πŸ€“

  • I went through the fisher.fish function code
    • did not seem trivial to change its behaviour on fisher installation

Start from fisher update returns conflicting files errors and removes fish_plugins file #670

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages