Base

# vi key bindings
fish_vi_key_bindings

# show entire path
set fish_prompt_pwd_dir_length 0

# fix default editor
set -x EDITOR nvim
set -x VISUAL nvim

function ls
    command ls -rtlh --color=auto --time-style "+%Y-%m-%d %H:%M:%S" $argv
end

function v
    command nvim
end

function fish_preexec --on-event fish_preexec
    # Store the command about to be run
    set -g __last_cmd $argv
    # Store the start timestamp
    set -g __start_time (date +%s)
end

function fish_postexec --on-event fish_postexec
    # Compute how long the command took
    set -l end_time (date +%s)
    set -l duration (math $end_time - $__start_time)

    # If the command took longer than 30 seconds, send a notification
    if test $duration -gt 30
        # You can adapt the message/format as needed
        echo "$__last_cmd completed in $duration second(s)"
    end
end

function wls
    watch -d -n 5 "ls -rtlh | tail -n $argv"
end

set -x PYTHONDONTWRITEBYTECODE 1
set -x PYTHONUNBUFFERED 1