1
Fork 0
satellite/home/adrielus/features/cli/fish.nix

58 lines
1.5 KiB
Nix
Raw Normal View History

{ pkgs, ... }:
2023-01-10 02:38:06 +01:00
{
programs.fish = {
enable = true;
shellAbbrs = {
ls = "exa -la";
cat = "bat";
};
shellAliases = {
# Print available battery
battery = "acpi";
};
plugins = with pkgs.fishPlugins; [
# Jump to directories by typing "z <directory-name>"
2023-01-10 02:58:59 +01:00
{
name = "z";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "z";
rev = "85f863f20f24faf675827fb00f3a4e15c7838d76";
sha256 = "1kaa0k9d535jnvy8vnyxd869jgs0ky6yg55ac1mxcxm8n0rh2mgq";
};
}
2023-01-10 02:38:06 +01:00
];
interactiveShellInit =
# Start tmux if not already inside tmux
''
if status is-interactive
and not set -q TMUX
exec tmux attach -t Welcome || tmux || echo "Something went wrong trying to start tmux"
end
'' +
# Sets cursor based on vim mode
''
set fish_cursor_default block # Set the normal and visual mode cursors to a block
set fish_cursor_insert line # Set the insert mode cursor to a line
set fish_cursor_replace_one underscore # Set the replace mode cursor to an underscore
2023-01-10 02:58:59 +01:00
# Force fish to skip some checks (I think?)
2023-01-10 02:38:06 +01:00
set fish_vi_force_cursor
'' +
# Use vim-style keybinds
''
function fish_user_key_bindings
# Use the vim keybinds
fish_vi_key_bindings
bind -e -M insert -k f10 # unbinds f10
bind -M insert -m default -k f10 'commandline -f repaint' # Exit insert mode with <f10>
end
'';
2023-01-10 02:38:06 +01:00
};
}