This commit is contained in:
Till 2026-03-29 14:23:01 +02:00
parent d8032cc35d
commit e945735fa1
61 changed files with 344 additions and 550 deletions

78
home/minimal/fish.nix Normal file
View file

@ -0,0 +1,78 @@
{ config, ... }:
{
programs.fish = {
enable = true;
interactiveShellInit = "fish_add_path ${config.xdg.dataHome}/npm/packages/bin";
shellInit = ''
set -gx EDITOR "nvim"
set -gx VISUAL "nvim"
function fish_greeting;
echo (set_color magenta)fish $version(set_color normal)
end
function brief;
khal list today 1d --day-format=
echo ""
task rc.verbose=nothing rc.report.foo.columns:id,description.count rc.report.foo.sort:urgency- foo +READY limit:5
echo ""
tree --noreport -L 1 ~/desktop
end
fzf --fish | source
function startrloft --description 'Starts R with custom environment'
set -lx R_ENVIRON_USER "~/.config/rloft/RLoft_environ"
R -q
end
function vd --wraps vim --description 'vim with date in filename'
nvim (ymd)_$argv.md
end
function note --description 'Create a new note'
if count $argv > /dev/null
nvim -c "call CreateNote('$argv')"
else
nvim ~/notes/(ls ~/notes/ | fzf)
end
end
function diary --description 'Create or edit today\'s diary entry'
nvim -c "call Diary()"
end
set -U fish_prompt_pwd_dir_length 0
function fish_prompt --description "Write out the prompt"
echo -s (set_color green) (whoami) (set_color brblack) @ (set_color yellow) (hostname) (set_color brblack) : (prompt_pwd) '$ ' (set_color normal)
end
function fish_right_prompt --description "Display info to the right of the prompt"
echo -s (__fish_git_prompt)
end
function fish_mode_prompt; end
set fish_cursor_default line blink
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showstashstate 'yes'
set __fish_git_prompt_showuntrackedfiles 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_color_upstream_ahead green
set __fish_git_prompt_color_upstream_behind red
set __fish_git_prompt_char_dirtystate '*'
set __fish_git_prompt_char_stagedstate ''
set __fish_git_prompt_char_untrackedfiles ''
set __fish_git_prompt_char_stashstate ''
set __fish_git_prompt_char_upstream_ahead '+'
set __fish_git_prompt_char_upstream_behind '-'
test -f ${config.xdg.configHome}/alias.fish && source ${config.xdg.configHome}/alias.fish
'';
};
}