Moving fish
This commit is contained in:
parent
796c574c6a
commit
1628cd36b5
3 changed files with 100 additions and 65 deletions
69
common.nix
69
common.nix
|
@ -1,7 +1,10 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ ./kakoune/kak.nix ];
|
imports = [
|
||||||
|
./kakoune/kak.nix
|
||||||
|
./fish/fish.nix
|
||||||
|
];
|
||||||
|
|
||||||
# Enable the manual so we don't have to load it
|
# Enable the manual so we don't have to load it
|
||||||
manual.html.enable = true;
|
manual.html.enable = true;
|
||||||
|
@ -59,70 +62,6 @@
|
||||||
# later
|
# later
|
||||||
firefox = {};
|
firefox = {};
|
||||||
|
|
||||||
fish = {
|
|
||||||
enable = true;
|
|
||||||
functions = {
|
|
||||||
};
|
|
||||||
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
|
|
||||||
interactiveShellInit = ''
|
|
||||||
set fish_greeting
|
|
||||||
|
|
||||||
# Set up an editor alias
|
|
||||||
if test -n "$EDITOR"
|
|
||||||
alias e="$EDITOR"
|
|
||||||
else
|
|
||||||
alias e="kak"
|
|
||||||
end
|
|
||||||
|
|
||||||
# sudo => pls
|
|
||||||
source ~/.config/fish/pls.fish
|
|
||||||
|
|
||||||
# set up change_cmd
|
|
||||||
source ~/.config/fish/change_cmd.fish
|
|
||||||
|
|
||||||
|
|
||||||
# Load completion for github
|
|
||||||
gh completion --shell fish | source
|
|
||||||
|
|
||||||
# Bitwarden
|
|
||||||
source ~/.config/fish/bw.fish
|
|
||||||
|
|
||||||
# Source iTerm2 integration
|
|
||||||
source ~/.iterm2_shell_integration.fish
|
|
||||||
'';
|
|
||||||
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";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
fzf = {
|
fzf = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableFishIntegration = true;
|
enableFishIntegration = true;
|
||||||
|
|
24
fish/change_cmd.fish
Normal file
24
fish/change_cmd.fish
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
function __fish_change_cmd -d "Change the current command"
|
||||||
|
# If there is no commandline, insert the last item from history
|
||||||
|
# and *then* toggle
|
||||||
|
if not commandline | string length -q
|
||||||
|
commandline -r "$history[1]"
|
||||||
|
end
|
||||||
|
|
||||||
|
set -l cmd (commandline -po)
|
||||||
|
set -l cursor (commandline -C)
|
||||||
|
|
||||||
|
if test (count $cmd) = "1"
|
||||||
|
commandline -C 0
|
||||||
|
else if test "$cmd[1]" = ""
|
||||||
|
commandline -C 0
|
||||||
|
else
|
||||||
|
commandline -r (string sub --start=(math (string length "$cmd[1]") + 1) (commandline -p))
|
||||||
|
commandline -C 0
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
bind --preset -e -M insert \cs
|
||||||
|
bind -M insert \cs __fish_change_cmd
|
||||||
|
bind --preset -e -M default \cs
|
||||||
|
bind -M default \cs __fish_change_cmd
|
72
fish/fish.nix
Normal file
72
fish/fish.nix
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
functions = {
|
||||||
|
};
|
||||||
|
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
|
||||||
|
interactiveShellInit = ''
|
||||||
|
set fish_greeting
|
||||||
|
|
||||||
|
# Set up an editor alias
|
||||||
|
if test -n "$EDITOR"
|
||||||
|
alias e="$EDITOR"
|
||||||
|
else
|
||||||
|
alias e="kak"
|
||||||
|
end
|
||||||
|
|
||||||
|
# sudo => pls
|
||||||
|
source ~/.config/fish/pls.fish
|
||||||
|
|
||||||
|
# set up change_cmd
|
||||||
|
source ~/.config/fish/change_cmd.fish
|
||||||
|
|
||||||
|
|
||||||
|
# Load completion for github
|
||||||
|
gh completion --shell fish | source
|
||||||
|
|
||||||
|
# Source iTerm2 integration
|
||||||
|
source ~/.iterm2_shell_integration.fish
|
||||||
|
'';
|
||||||
|
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/change_cmd.fish";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue