0 Custom items (prompt segments)
Ilan Cosman edited this page 2022-03-07 12:38:15 -08:00
  1. Use the tide item naming scheme: _tide_item_<ITEM NAME>.

    function _tide_item_example
       # print item       with this name   and this icon           with this text
       _tide_print_item   example          $tide_example_icon' '   (some_command --version | string split ' ')[2]
    end
    funcsave _tide_item_example # Save it to ~/.config/fish/functions
    
  2. Color your item by setting some variables. Again, notice the naming scheme.

    set -U tide_example_color CCFF00
    set -U tide_example_bg_color normal
    
  3. Set a corresponding icon for the item

    set -U tide_example_icon ''
    
  4. Finally, add it to your prompt

    echo $tide_right_prompt_items
    set --append tide_right_prompt_items example
    
  5. If you've gotten this far, and your item is working, Create a Pull Request!

  • Add your new function to /functions/_tide_item_{your item name}.fish
  • Add the variables for colors and icons to all the files in /functions/tide/configure/configs
  • Add a test to /tests
  • make sure everything is working. You may have to uninstall tide if you've previously installed it using fisher.