refactor(homeModules:fish): cleanup
This commit is contained in:
parent
25f471a76e
commit
7e69a8a917
1 changed files with 3 additions and 17 deletions
|
|
@ -1,33 +1,25 @@
|
||||||
{ pkgs, lib, config, ... }:
|
{ lib, config, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.homeModules.console.shell.fish;
|
cfg = config.homeModules.console.shell.fish;
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages;
|
hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages;
|
||||||
hasEza = hasPackage "eza";
|
hasEza = hasPackage "eza";
|
||||||
hasNeovim = config.programs.neovim.enable;
|
|
||||||
hasBat = hasPackage "bat";
|
hasBat = hasPackage "bat";
|
||||||
hasHelix = hasPackage "helix";
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = {
|
config = {
|
||||||
programs.fish = mkIf cfg.enable {
|
programs.fish = mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAbbrs = rec {
|
shellAbbrs = {
|
||||||
|
fe = "cd $FLAKE; $EDITOR $FLAKE";
|
||||||
fe = mkIf hasHelix "cd $FLAKE; hx $FLAKE";
|
|
||||||
f = "cd $FLAKE";
|
f = "cd $FLAKE";
|
||||||
s = "cd $SCRIPTS";
|
s = "cd $SCRIPTS";
|
||||||
|
|
||||||
tree = mkIf hasEza "eza -T --icons --group-directories-first";
|
tree = mkIf hasEza "eza -T --icons --group-directories-first";
|
||||||
ls = mkIf hasEza "eza -a --icons --group-directories-first";
|
ls = mkIf hasEza "eza -a --icons --group-directories-first";
|
||||||
lsd = mkIf hasEza "eza -al --icons --group-directories-first";
|
lsd = mkIf hasEza "eza -al --icons --group-directories-first";
|
||||||
lst = mkIf hasEza "eza -T -L 5 --icons --group-directories-first";
|
lst = mkIf hasEza "eza -T -L 5 --icons --group-directories-first";
|
||||||
lsta = mkIf hasEza "eza -T --icons --group-directories-first";
|
lsta = mkIf hasEza "eza -T --icons --group-directories-first";
|
||||||
|
|
||||||
cat = mkIf hasBat "bat";
|
cat = mkIf hasBat "bat";
|
||||||
|
|
||||||
vim = mkIf hasNeovim "nvim";
|
|
||||||
|
|
||||||
};
|
};
|
||||||
functions = {
|
functions = {
|
||||||
fish_greeting = "";
|
fish_greeting = "";
|
||||||
|
|
@ -45,12 +37,6 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
interactiveShellInit =
|
interactiveShellInit =
|
||||||
''
|
|
||||||
set --global KITTY_INSTALLATION_DIR "${pkgs.kitty}/lib/kitty"
|
|
||||||
set --global KITTY_SHELL_INTEGRATION enabled
|
|
||||||
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
|
|
||||||
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
|
|
||||||
'' +
|
|
||||||
# Use vim bindings and cursors
|
# Use vim bindings and cursors
|
||||||
''
|
''
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue