nix-home/home/fish/fish.nix
Natsu Kagami 21c8317fd2
Implement a kitty module
Squashed commit of the following:

commit eb319d25ee2bc60dc4c58f3ee3e70ea2035a2b96
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 13:41:33 2022 -0400

    Map yen sign to backslash

commit 6d29a296ed789ac20bfcd6e74a48536d0e658582
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 13:23:30 2022 -0400

    Add kitty options

commit 47b366cbd0fd17c06c4e415b291e2329f8831939
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 11:42:51 2022 -0400

    Some basic set up to make kitty happy
2022-06-10 13:41:53 -04:00

110 lines
3 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, ... }:
{
imports = [
./tide/nix-shell.nix
];
home.packages = [ pkgs.timg ];
programs.fish = {
enable = true;
package = pkgs.unstable.fish;
functions = { };
tide = {
nix-shell.enable = true;
};
shellAliases = {
cat = "bat --theme=GitHub ";
l = "exa -l --color=always ";
htop = "btm --color nord-light -b --tree";
Htop = "btm --color nord-light --tree";
# My own commands for easy access
thisterm = "cd ~/Projects/uw/$CURRENT_TERM";
today = "date +%F";
};
shellInit = ''
# Source brew integration
if test -e /opt/homebrew/bin/brew
/opt/homebrew/bin/brew shellenv | source
end
# Gnome-keyring startup
if type -q gnome-keyring-daemon
set -x (gnome-keyring-daemon | string split "=")
end
'';
interactiveShellInit = ''
function fish_greeting
${pkgs.timg}/bin/timg ${./arona.jpg}
printf (env LANG=ja_JP.UTF-8 date +"\n%A%Y%m%d%H%M \n\n")
end
# Set up an editor alias
if test -n "$EDITOR"
alias e="$EDITOR"
else
alias e="kak"
end
# Source iTerm2 integration
if test -e ~/.iterm2_shell_integration.fish; and test $__CFBundleIdentifier = "com.googlecode.iterm2"
source ~/.iterm2_shell_integration.fish
end
# Source Kitty integration
if set -q KITTY_INSTALLATION_DIR
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"
end
# Enable vi keybindings
fish_vi_key_bindings
## Set some kak-focused keybindings
bind -M default gi beginning-of-line
bind -M default gl end-of-line
# Set up direnv
${pkgs.direnv}/bin/direnv hook fish | source
'';
plugins = [
{
name = "tide";
src = pkgs.fetchFromGitHub {
owner = "IlanCosman";
repo = "tide";
rev = "3787c725f7f6a0253f59a2c0e9fde03202689c6c";
sha256 = "00zsib1q21bgxffjlyxf5rgcyq3h1ixwznwvid9k6mkkmwixv9lj";
};
}
{
name = "fzf";
src = pkgs.fetchFromGitHub {
owner = "jethrokuan";
repo = "fzf";
rev = "479fa67d7439b23095e01b64987ae79a91a4e283";
sha256 = "0k6l21j192hrhy95092dm8029p52aakvzis7jiw48wnbckyidi6v";
};
}
];
};
# Source files
home.file = {
"fish/change_cmd.fish" = {
source = ./. + "/change_cmd.fish";
target = ".config/fish/conf.d/change_cmd.fish";
};
"fish/pls.fish" = {
source = ./. + "/pls.fish";
target = ".config/fish/conf.d/pls.fish";
};
};
}