adjusted zsh config

feat/kile-v2
Ricard Illa 2022-01-18 10:33:23 +01:00
parent fd07491bbd
commit 968518609f
No known key found for this signature in database
GPG Key ID: F69A672B72E54902
3 changed files with 64 additions and 107 deletions

View File

@ -27,6 +27,7 @@
# enableAliases = true; # enableAliases = true;
}; };
programs.zsh = { programs.zsh = {
enable = true;
enableAutosuggestions = true; enableAutosuggestions = true;
enableCompletion = true; enableCompletion = true;
initExtraBeforeCompInit = '' initExtraBeforeCompInit = ''
@ -41,7 +42,6 @@
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
''; '';
enableSyntaxHighlighting = true; enableSyntaxHighlighting = true;
enableVteIntegration = true;
autocd = true; autocd = true;
defaultKeymap = "viins"; defaultKeymap = "viins";
history = { history = {
@ -60,5 +60,42 @@
"......" = "../../../../.."; "......" = "../../../../..";
}; };
localVariables = { KEYTIMEOUT = 1; }; localVariables = { KEYTIMEOUT = 1; };
initExtra = ''
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
# setopt PROMPT_CR
# setopt PROMPT_SP
# export PROMPT_EOL_MARK=""
unsetopt PROMPT_SP
precmd() {
precmd() {
echo
}
}
VENV_DIR="${config.home.homeDirectory}/virtualenvs"
export WORKON_HOME="''${VENV_DIR}"
function activate-venv() {
local selected_env
selected_env=$(
${pkgs.findutils}/bin/find \
"''${VENV_DIR}" \
-maxdepth 1 \
-mindepth 1 \
-type d \
-exec basename {} \; | \
${pkgs.fzf}/bin/fzf
)
[ -n "$selected_env" ] && \
source "''${VENV_DIR}/''${selected_env}/bin/activate"
}
export LANG=en_US.utf8
export LC_ALL=en_US.UTF-8
'';
}; };
} }

View File

@ -2,47 +2,9 @@
{ {
imports = [ ./common.nix ]; imports = [ ./common.nix ];
programs.starship = { programs.starship.settings = {
settings = { gcloud = { disabled = true; };
gcloud = { disabled = true; }; python = { disabled = true; };
python = { disabled = true; };
};
};
programs.zsh = {
enable = true;
initExtra = ''
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
# setopt PROMPT_CR
# setopt PROMPT_SP
# export PROMPT_EOL_MARK=""
unsetopt PROMPT_SP
precmd() {
precmd() {
echo
}
}
VENV_DIR="${config.home.homeDirectory}/virtualenvs"
export WORKON_HOME="''${VENV_DIR}"
function activate-venv() {
local selected_env
selected_env=$(
${pkgs.findutils}/bin/find \
"''${VENV_DIR}" \
-maxdepth 1 \
-mindepth 1 \
-type d \
-exec basename {} \; | \
${pkgs.fzf}/bin/fzf
)
[ -n "$selected_env" ] && \
source "''${VENV_DIR}/''${selected_env}/bin/activate"
}
'';
}; };
programs.zsh.enableVteIntegration = true;
} }

View File

@ -2,70 +2,28 @@
{ {
imports = [ ./common.nix ]; imports = [ ./common.nix ];
programs.starship = { programs.starship.settings = {
settings = { gcloud = {
gcloud = { disabled = false;
disabled = false; format = ''
format = '' on [$symbol$account(@$domain)(($region))]($style)
on [$symbol$account(@$domain)(($region))]($style) '';
''; symbol = " ";
symbol = " "; };
}; python = {
python = { disabled = true;
disabled = true; symbol = "";
symbol = ""; format = ''
format = '' via [$symbol$pyenv_prefix($version )(($virtualenv) )]($style)
via [$symbol$pyenv_prefix($version )(($virtualenv) )]($style) '';
''; python_binary = [
python_binary = [ "python"
"python" "python2"
"python2" "python3"
"python3" "/usr/bin/python"
"/usr/bin/python" "/usr/local/bin/python3"
"/usr/local/bin/python3" ];
];
};
}; };
}; };
programs.zsh.enableVteIntegration = false;
programs.zsh = {
enableVteIntegration = false;
initExtra = ''
autoload -U history-search-end
zle -N history-beginning-search-backward-end history-search-end
zle -N history-beginning-search-forward-end history-search-end
bindkey "^[[A" history-beginning-search-backward-end
bindkey "^[[B" history-beginning-search-forward-end
# setopt PROMPT_CR
# setopt PROMPT_SP
# export PROMPT_EOL_MARK=""
unsetopt PROMPT_SP
precmd() {
precmd() {
echo
}
}
VENV_DIR="${config.home.homeDirectory}/virtualenvs"
export WORKON_HOME="''${VENV_DIR}"
function activate-venv() {
local selected_env
selected_env=$(
${pkgs.findutils}/bin/find \
"''${VENV_DIR}" \
-maxdepth 1 \
-mindepth 1 \
-type d \
-exec basename {} \; | \
${pkgs.fzf}/bin/fzf
)
[ -n "$selected_env" ] && \
source "''${VENV_DIR}/''${selected_env}/bin/activate"
}
export LANG=en_US.utf8
export LC_ALL=en_US.UTF-8
'';
};
} }