How to automatically source ~/.profile after editing it in fish shell: Difference between revisions

From razwiki
Jump to navigation Jump to search
(Created page with "<pre> function postexec_source_profile --on-event fish_postexec if test (echo "$argv" | string trim) = "$EDITOR ~/.profile" echo -n 'Sourcing .profile... '...")
(No difference)

Revision as of 12:24, 6 December 2021

function postexec_source_profile --on-event fish_postexec
    if test (echo "$argv" | string trim) = "$EDITOR ~/.profile"
        echo -n 'Sourcing .profile... '
        source ~/.profile
        echo done.
    end

https://github.com/razzius/fish-functions/blob/master/config.fish#L30