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.enableVteIntegration = 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"
}
'';
};
} }

View File

@ -2,8 +2,7 @@
{ {
imports = [ ./common.nix ]; imports = [ ./common.nix ];
programs.starship = { programs.starship.settings = {
settings = {
gcloud = { gcloud = {
disabled = false; disabled = false;
format = '' format = ''
@ -26,46 +25,5 @@
]; ];
}; };
}; };
}; 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
'';
};
} }