nix-configs

Personal NixOS and home-manager configuration files
Log | Files | Refs

fish.nix (1141B)


      1 {
      2   programs.fish = {
      3     enable = true;
      4     functions = {
      5       __fish_command_not_found_handler = { body = "echo fish: Unknown command $argv[1]"; onEvent = "fish_command_not_found"; };
      6       vat = "math $argv + \"($argv * 0.2)\"";
      7       mcd = "mkdir -p $argv[1] && cd $argv[1]";
      8 			mergeinto = "rsync --progress --remove-source-files -av \"$argv[1]\" \"$argv[2]\" && find \"$argv[1]\" -empty -delete";
      9     };
     10     loginShellInit = ''
     11       set fish_greeting # Disable greeting
     12       set --erase fish_greeting # Disable greeting
     13       set -gx DOMAIN minskio.co.uk
     14       set -gx SYNCDIR $HOME/vault
     15       set -gx EDITOR nvim
     16       set -gx VISUAL $EDITOR
     17     '';
     18     shellAliases = {
     19       extract = "aunpack";
     20       jdupes = "jdupes -A"; # exclude hidden files
     21       empties = "find . -maxdepth 3 -mount -not -path \"*/\.*\" -empty -print";
     22       vaultedit = "find \"$SYNCDIR\" -maxdepth 5 -type f | fzf --preview \"cat {}\" --layout reverse | xargs -r -I{} \"$EDITOR\" {}";
     23       week = "date +%V";
     24     };
     25 #    binds = {
     26 #      "ctrl-h".command = "backward-kill-path-component";
     27 #      "ctrl-backspace".command = "kill-word";
     28 #    };
     29   };
     30 }