modify fish, kitty and neovim
This commit is contained in:
parent
20225b4295
commit
c9f757e4bd
8 changed files with 63 additions and 45 deletions
|
|
@ -1,54 +1,28 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
home.packages = with pkgs; [ kdePackages.qttools ];
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
shellAliases = {
|
||||||
|
ssh = "kitty-ssh";
|
||||||
|
};
|
||||||
functions = {
|
functions = {
|
||||||
fish_prompt = {
|
fish_prompt = {
|
||||||
description = "Write out the prompt";
|
description = "Write out the prompt";
|
||||||
body = ''
|
body = builtins.readFile ./functions/fish-prompt.fish;
|
||||||
set -l last_status $status
|
};
|
||||||
|
kitty-ssh = {
|
||||||
set -l nix_shell_info (
|
description = "Integrate Kitten SSH with Fish";
|
||||||
if test -n "$IN_NIX_SHELL"
|
body = builtins.readFile ./functions/kitty-ssh.fish;
|
||||||
echo -n "<nix-shell> "
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
set -g fish_color_user 89dceb
|
|
||||||
|
|
||||||
# Set host color based on hostname
|
|
||||||
if test (hostname) = "peach"
|
|
||||||
set -g fish_color_host fab387
|
|
||||||
else if test (hostname) = "alien"
|
|
||||||
set -g fish_color_host 89b4fa
|
|
||||||
else if test (hostname) = "vm-aarch64"
|
|
||||||
set -g fish_color_host a6e3a1
|
|
||||||
else if test (uname) = "Darwin"
|
|
||||||
set -g fish_color_host f9e2af
|
|
||||||
end
|
|
||||||
|
|
||||||
set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal)
|
|
||||||
|
|
||||||
set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal)
|
|
||||||
|
|
||||||
set -l git_info (fish_git_prompt)
|
|
||||||
|
|
||||||
echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info"
|
|
||||||
echo -n -s "> "
|
|
||||||
'';
|
|
||||||
# echo -n -s "$user_host" " " "$nix_shell_info" "$cwd" "$git_info" "> "
|
|
||||||
};
|
};
|
||||||
nix-shell = {
|
nix-shell = {
|
||||||
description = "Wrapper for nix-shell that runs fish by default";
|
description = "Wrapper for nix-shell that runs fish by default";
|
||||||
body = ''
|
body = builtins.readFile ./functions/nix-shell.fish;
|
||||||
if test (count $argv) -eq 0
|
};
|
||||||
command nix-shell --run fish
|
logout = {
|
||||||
else
|
description = "Log out of KDE Plasma";
|
||||||
command nix-shell --run fish $argv
|
body = builtins.readFile ./functions/logout.fish;
|
||||||
end
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
24
home/terminal/fish/functions/fish-prompt.fish
Normal file
24
home/terminal/fish/functions/fish-prompt.fish
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
set -l last_status $status
|
||||||
|
set -l nix_shell_info (
|
||||||
|
if test -n "$IN_NIX_SHELL"
|
||||||
|
echo -n "<nix-shell> "
|
||||||
|
end
|
||||||
|
)
|
||||||
|
set -g fish_color_user 89dceb
|
||||||
|
|
||||||
|
# Set host color based on hostname
|
||||||
|
if test (hostname) = "peach"
|
||||||
|
set -g fish_color_host fab387
|
||||||
|
else if test (hostname) = "alien"
|
||||||
|
set -g fish_color_host 89b4fa
|
||||||
|
else if test (hostname) = "vm-aarch64"
|
||||||
|
set -g fish_color_host a6e3a1
|
||||||
|
else if test (uname) = "Darwin"
|
||||||
|
set -g fish_color_host f9e2af
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal)
|
||||||
|
set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal)
|
||||||
|
set -l git_info (fish_git_prompt)
|
||||||
|
echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info"
|
||||||
|
echo -n -s "> "
|
||||||
5
home/terminal/fish/functions/kitty-ssh.fish
Normal file
5
home/terminal/fish/functions/kitty-ssh.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
if set -q KITTY_WINDOW_ID
|
||||||
|
kitty +kitten ssh $argv
|
||||||
|
else
|
||||||
|
command ssh $argv
|
||||||
|
end
|
||||||
5
home/terminal/fish/functions/logout.fish
Normal file
5
home/terminal/fish/functions/logout.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
if status is-login
|
||||||
|
builtin exit
|
||||||
|
else
|
||||||
|
/run/current-system/sw/bin/qdbus org.kde.Shutdown /Shutdown org.kde.Shutdown.logout
|
||||||
|
end
|
||||||
5
home/terminal/fish/functions/nix-shell.fish
Normal file
5
home/terminal/fish/functions/nix-shell.fish
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
if test (count $argv) -eq 0
|
||||||
|
command nix-shell --run fish
|
||||||
|
else
|
||||||
|
command nix-shell --run fish $argv
|
||||||
|
end
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
tab_bar_edge = "top";
|
tab_bar_edge = "top";
|
||||||
tab_bar_style = "powerline";
|
tab_bar_style = "powerline";
|
||||||
tab_powerline_style = "slanted";
|
tab_powerline_style = "slanted";
|
||||||
|
mouse_hide_wait = "-1.0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,14 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
};
|
||||||
|
|
||||||
programs.nixvim = {
|
programs.nixvim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enablePrintInit = true;
|
enablePrintInit = true;
|
||||||
# defaultEditor = true;
|
defaultEditor = true;
|
||||||
waylandSupport = true;
|
waylandSupport = true;
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ let
|
||||||
(lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
|
(lib.toUpper (builtins.substring 0 1 str)) + (builtins.substring 1 (builtins.stringLength str) str);
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
home.sessionVariables = {
|
# home.sessionVariables = {
|
||||||
EDITOR = "code";
|
# EDITOR = "code";
|
||||||
};
|
# };
|
||||||
|
|
||||||
catppuccin.vscode.profiles.default = {
|
catppuccin.vscode.profiles.default = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue