config

#brew#nushell

git clone https://git.pyrossh.dev/config

Common configuration


7eb28b3 — Peter John 2026-11-07T18:04:23+05:30
improve zshrc
Files changed (2) hide show
  1. .gitignore +3 -0
  2. zshrc +44 -0
.gitignore CHANGED
@@ -11,3 +11,6 @@ gh
11
11
  rclone
12
12
  .wrangler
13
13
  helix
14
+ homebrew
15
+ devvm
16
+ *.zwc
zshrc CHANGED
@@ -21,6 +21,32 @@ antigen bundle zsh-users/zsh-history-substring-search
21
21
 
22
22
  antigen apply
23
23
 
24
+ # =============================================================================
25
+ # History (nushell: max_size 1_000_000, sync_on_enter -> oh-my-zsh share_history)
26
+ # =============================================================================
27
+ HISTSIZE=1000000
28
+ SAVEHIST=1000000
29
+
30
+ # =============================================================================
31
+ # Line editor (nushell: edit_mode emacs + reedline keybindings that differ
32
+ # from zsh/oh-my-zsh defaults)
33
+ # =============================================================================
34
+ bindkey -e
35
+ autoload -Uz edit-command-line
36
+ zle -N edit-command-line
37
+ bindkey '^O' edit-command-line # open_command_editor
38
+ bindkey '^Z' undo # undo_change
39
+ bindkey '^G' redo # redo_change
40
+ bindkey '^U' backward-kill-line # cut_line_from_start
41
+ bindkey '^Q' history-incremental-search-backward # search_history
42
+ bindkey '^P' up-line-or-beginning-search # move_up (same as Up)
43
+ bindkey '^N' down-line-or-beginning-search # move_down (same as Down)
44
+ bindkey '^[[1;3D' backward-word # alt+left
45
+ bindkey '^[[1;3C' forward-word # alt+right
46
+ bindkey '^[[3;3~' kill-word # alt+delete
47
+ bindkey '^[[3;5~' delete-char # ctrl+delete
48
+ bindkey '^[m' backward-kill-word # alt+m
49
+
24
50
  alias ls="eza -la --icons --hyperlink --git"
25
51
 
26
52
  # Source Cargo environment
@@ -60,6 +86,15 @@ backup-website() {
60
86
  rclone sync website:website "/Volumes/SSD T7/website" --checksum --fast-list --multi-thread-streams=32 -P
61
87
  }
62
88
 
89
+ # Deletes ALL Docker images, volumes and build cache, without asking.
90
+ docker-clean-all() {
91
+ docker images -aq | sort -u | xargs docker rmi -f
92
+ docker volume ls -q | xargs docker volume rm
93
+ docker builder prune -a -f
94
+ docker system df
95
+ df -h /
96
+ }
97
+
63
98
 
64
99
  # =============================================================================
65
100
  # Environment Variables
@@ -101,3 +136,12 @@ export PATH
101
136
  if command -v oh-my-posh &> /dev/null; then
102
137
  eval "$(oh-my-posh init zsh --config /opt/homebrew/opt/oh-my-posh/themes/zash.omp.json)"
103
138
  fi
139
+
140
+ # nushell PROMPT_INDICATOR: yellow "$> " after the oh-my-posh prompt.
141
+ # Must run after oh-my-posh's precmd, which rebuilds PS1 every prompt.
142
+ # Also sets nushell's emacs cursor_shape (line) via DECSCUSR.
143
+ _nu_prompt_indicator() {
144
+ PS1+='%F{yellow}$> %f'
145
+ print -n '\e[6 q'
146
+ }
147
+ (( ${precmd_functions[(I)_nu_prompt_indicator]} )) || precmd_functions+=(_nu_prompt_indicator)