1 parent 843bba3 commit b8e7659Copy full SHA for b8e7659
1 file changed
src/dot_config/zsh/zshrc.d/history.zsh
@@ -13,12 +13,6 @@ setopt interactive_comments
13
# hist_ignore_space (above) lets sensitive commands opt out.
14
setopt share_history # noka: ZC1928
15
16
-# http://mollifier.hatenablog.com/entry/20090728/p1
17
-# Return 2 keeps the line in the session history (reusable with ^p) but out of HISTFILE.
18
-_history_no_save() {
19
- local line=${1%%$'\n'}
20
- ((${#line} >= 4)) || return 2
21
- [[ $line != (cd|ls)(|' '*) ]] || return 2
22
-}
23
-autoload -Uz add-zsh-hook
24
-add-zsh-hook zshaddhistory _history_no_save
+# Applied when lines are written to HISTFILE, so matches stay in the session
+# history (reusable with ^p) but out of the file.
+HISTORY_IGNORE='(?(#c,3)|(cd|ls)(| *))'
0 commit comments