projects
/
grml-etc-core.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05a0771
)
make location of file .important_commands configurable keeping backward compatibility
author
Thilo Six
<tech@xk2c.de>
Sat, 10 Oct 2015 13:32:36 +0000
(15:32 +0200)
committer
Frank Terbeck
<ft@grml.org>
Sun, 29 Jan 2017 20:59:03 +0000
(21:59 +0100)
doc/grmlzshrc.t2t
patch
|
blob
|
history
etc/zsh/zshrc
patch
|
blob
|
history
diff --git
a/doc/grmlzshrc.t2t
b/doc/grmlzshrc.t2t
index
eadf7ce
..
fafe2d3
100644
(file)
--- a/
doc/grmlzshrc.t2t
+++ b/
doc/grmlzshrc.t2t
@@
-448,8
+448,9
@@
to: **'zsh: <repository name>'** via zsh's vcs_info.
== PERSISTENT HISTORY ==
If you got commands you consider important enough to be included in every
== PERSISTENT HISTORY ==
If you got commands you consider important enough to be included in every
-shell's history, you can put them into ~/.important_commands and they will be
-available via the usual history lookup widgets.
+shell's history, you can put them into $GRML_IMPORTANT_COMMANDS (which defaults
+for backward compatibility to ~/.important_commands) and they will be available
+via the usual history lookup widgets.
= REFERENCE =
= REFERENCE =
diff --git
a/etc/zsh/zshrc
b/etc/zsh/zshrc
index
0bf68f8
..
7b04de8
100644
(file)
--- a/
etc/zsh/zshrc
+++ b/
etc/zsh/zshrc
@@
-3133,10
+3133,14
@@
for var in BLUE RED GREEN CYAN YELLOW MAGENTA WHITE ; unset $var
builtin unset -v var
# "persistent history"
builtin unset -v var
# "persistent history"
-# just write important commands you always need to ~/.important_commands
+# just write important commands you always need to $GRML_IMPORTANT_COMMANDS
+# defaults for backward compatibility to ~/.important_commands
if [[ -r ~/.important_commands ]] ; then
if [[ -r ~/.important_commands ]] ; then
- fc -R ~/.important_commands
+ GRML_IMPORTANT_COMMANDS=~/.important_commands
+else
+ GRML_IMPORTANT_COMMANDS=${GRML_IMPORTANT_COMMANDS:-${ZDOTDIR:-${HOME}}/.important_commands}
fi
fi
+[[ -r ${GRML_IMPORTANT_COMMANDS} ]] && builtin fc -R ${GRML_IMPORTANT_COMMANDS}
# load the lookup subsystem if it's available on the system
zrcautoload lookupinit && lookupinit
# load the lookup subsystem if it's available on the system
zrcautoload lookupinit && lookupinit