2020-03-13 19:41:55 +01:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
2021-05-05 00:08:15 +02:00
|
|
|
let shellAliases = { };
|
2020-10-20 15:49:33 +02:00
|
|
|
in {
|
|
|
|
imports = [ ./terminal.nix ];
|
2020-03-24 00:57:11 +01:00
|
|
|
|
2020-10-20 15:49:33 +02:00
|
|
|
programs.fzf = { enable = true; };
|
2020-03-14 01:38:34 +01:00
|
|
|
programs.starship = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
add_newline = false;
|
2020-10-20 15:49:33 +02:00
|
|
|
status.symbol = "❌ ";
|
|
|
|
status.disabled = false;
|
2020-08-15 00:12:28 +02:00
|
|
|
aws.disabled = true;
|
2020-10-20 15:49:33 +02:00
|
|
|
gcloud.disabled = true;
|
2020-03-14 01:38:34 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.zsh = {
|
|
|
|
enable = true;
|
|
|
|
enableAutosuggestions = true;
|
|
|
|
autocd = true;
|
|
|
|
defaultKeymap = "viins";
|
2020-05-22 18:19:36 +02:00
|
|
|
history.extended = true;
|
2020-03-14 04:13:43 +01:00
|
|
|
plugins = with pkgs; [
|
|
|
|
{
|
|
|
|
name = "first-tab-completion";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
file = "first-tab-completion.zsh";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zsh-syntax-highlighting";
|
|
|
|
src = zsh-syntax-highlighting;
|
|
|
|
file = "share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "zsh-history-substring-search";
|
|
|
|
src = zsh-history-substring-search;
|
2020-10-20 15:49:33 +02:00
|
|
|
file =
|
|
|
|
"share/zsh-history-substring-search/zsh-history-substring-search.zsh";
|
2020-03-14 04:13:43 +01:00
|
|
|
}
|
|
|
|
];
|
2020-03-15 14:46:51 +01:00
|
|
|
initExtra = with pkgs; ''
|
|
|
|
export KEYTIMEOUT=1
|
|
|
|
|
2020-03-21 16:39:56 +01:00
|
|
|
ZSH_AUTOSUGGEST_USE_ASYNC=1
|
|
|
|
ZSH_AUTOSUGGEST_STRATEGY=(history completion)
|
|
|
|
|
2020-03-14 03:00:16 +01:00
|
|
|
zmodload zsh/complist
|
2020-03-14 01:38:34 +01:00
|
|
|
zstyle ':completion:*' menu select
|
2020-03-14 03:00:16 +01:00
|
|
|
zstyle ':completion:*' insert-tab false
|
|
|
|
bindkey '^I' first-tab-completion
|
|
|
|
bindkey -M menuselect '\e' send-break
|
2020-03-15 14:46:51 +01:00
|
|
|
bindkey -M menuselect "$terminfo[kcbt]" reverse-menu-complete
|
|
|
|
bindkey -M menuselect 'h' vi-backward-char
|
|
|
|
bindkey -M menuselect 'k' vi-up-line-or-history
|
|
|
|
bindkey -M menuselect 'l' vi-forward-char
|
|
|
|
bindkey -M menuselect 'j' vi-down-line-or-history
|
2020-03-14 03:00:16 +01:00
|
|
|
|
2020-03-21 16:31:14 +01:00
|
|
|
setopt HIST_FIND_NO_DUPS
|
|
|
|
bindkey "$terminfo[kcuu1]" history-substring-search-up
|
|
|
|
bindkey "$terminfo[kcud1]" history-substring-search-down
|
2020-03-14 01:38:34 +01:00
|
|
|
bindkey -M vicmd 'k' history-substring-search-up
|
|
|
|
bindkey -M vicmd 'j' history-substring-search-down
|
2020-11-14 11:19:04 +01:00
|
|
|
|
|
|
|
setopt extendedglob
|
|
|
|
setopt kshglob
|
2020-03-14 01:38:34 +01:00
|
|
|
'';
|
|
|
|
inherit shellAliases;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.bash = {
|
|
|
|
enable = true;
|
|
|
|
inherit shellAliases;
|
|
|
|
};
|
|
|
|
|
|
|
|
programs.direnv = {
|
|
|
|
enable = true;
|
2020-08-26 10:34:08 +02:00
|
|
|
enableNixDirenvIntegration = true;
|
2020-03-14 01:38:34 +01:00
|
|
|
};
|
|
|
|
|
2021-05-05 00:10:35 +02:00
|
|
|
# for .envrc's in child directories add "source_up"
|
|
|
|
# for them to pick up this config
|
|
|
|
home.file."dev/work/.envrc".text = ''
|
2020-03-14 01:38:34 +01:00
|
|
|
dotenv
|
|
|
|
'';
|
2021-05-05 00:10:35 +02:00
|
|
|
home.file."dev/work/.env".text = ''
|
|
|
|
BROWSER=firefox-work
|
|
|
|
'';
|
2020-03-21 16:31:14 +01:00
|
|
|
}
|