Skip to content

Commit f036510

Browse files
committed
feat: add transient prompt for zsh
1 parent ca84913 commit f036510

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

home/desktop/hyprland/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ in
8181
repeat_rate = 30;
8282
numlock_by_default = 1;
8383
accel_profile = "flat";
84-
sensitivity = 0.4;
84+
sensitivity = -0.4;
8585
force_no_accel = false;
8686
touchpad = {
8787
natural_scroll = 1;

home/desktop/theme/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
enable = true;
4646
};
4747
rofi.enable = true;
48-
starship.enable = true;
48+
starship.enable = false;
4949
sway.enable = true;
5050
tmux.enable = false;
5151
vesktop.enable = false;

home/shells/zsh/default.nix

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@
117117
];
118118

119119
initContent = ''
120+
bindkey -s ^f "tmux-sessionizer-script\n"
121+
tmux-init
122+
export PATH=$PATH:~/.local/bin/
123+
export PATH=/tmp/lazy-lvim/bin:$PATH
124+
125+
ZSH_AUTOSUGGEST_USE_ASYNC="true"
126+
120127
TRANSIENT_PROMPT=$(${pkgs.starship}/bin/starship module character)
121128
122129
function zle-line-init() {
@@ -132,11 +139,18 @@
132139
local saved_prompt=$PROMPT
133140
local saved_rprompt=$RPROMPT
134141
142+
# IMPORTANTE: Desativa os hooks do Starship temporariamente
143+
# para ele não redesenhar o prompt completo na linha anterior
144+
local saved_precmd_functions=("''${precmd_functions[@]}")
145+
precmd_functions=()
146+
135147
PROMPT=$TRANSIENT_PROMPT
136148
RPROMPT=""
137149
zle .reset-prompt
150+
138151
PROMPT=$saved_prompt
139152
RPROMPT=$saved_rprompt
153+
precmd_functions=("''${saved_precmd_functions[@]}")
140154
141155
if (( ret )); then
142156
zle .send-break
@@ -146,14 +160,6 @@
146160
return ret
147161
}
148162
zle -N zle-line-init
149-
# ---------------------------------
150-
151-
bindkey -s ^f "tmux-sessionizer-script\n"
152-
tmux-init
153-
export PATH=$PATH:~/.local/bin/
154-
export PATH=/tmp/lazy-lvim/bin:$PATH
155-
156-
ZSH_AUTOSUGGEST_USE_ASYNC="true"
157163
158164
# Zstyle completions
159165
zstyle ':completion:*' sort false

0 commit comments

Comments
 (0)