Skip to content

Commit a345965

Browse files
committed
Hishtory: Add shell integration for bash and zsh
Add tracked hishtory setup with server URL from 1Password, shell modules for both bash and zsh, package spec, and a one-time setup script to initialize hishtory on fresh machines.
1 parent 93efdf0 commit a345965

File tree

5 files changed

+43
-0
lines changed

5 files changed

+43
-0
lines changed

home/.chezmoi.toml.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Personal information
103103
{{- $last_name := onepasswordRead (printf "%s/last name" $identity_entry) -}}
104104
{{- $ghuser := onepasswordRead (printf "%s/github" $identity_entry) -}}
105105
{{- $full_name := printf "%s %s" $first_name $last_name -}}
106+
{{- $hishtory_server := onepasswordRead "op://dotfiles/Hishtory Config/server" -}}
106107

107108
{{- /* Data: keep this here for the newline */}}
108109
[data]
@@ -115,6 +116,7 @@ Personal information
115116
is_linux = {{ $is_linux }}
116117
is_work = {{ $is_work }}
117118
copy_command = {{ if $is_macos }}"pbcopy"{{ else }}"xsel --clipboard --input"{{ end }}
119+
hishtory_server = {{ $hishtory_server | quote }}
118120

119121

120122
{{/*

home/.chezmoidata/package_specs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ softwarePackages:
7878
brew: yq
7979
eget:
8080
source: mikefarah/yq
81+
hishtory:
82+
homepage: https://github.com/ddworken/hishtory
83+
brew: hishtory
8184
zoxide:
8285
brew: zoxide
8386
eget:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
3+
# {{ template "dotfiles_bashlib.sh" . }}
4+
5+
# Help shellcheck identify the above include
6+
true || source ../.chezmoitemplates/dotfiles_bashlib.sh
7+
8+
dot::chezmoi_script_start "setup of hishtory"
9+
10+
if ! dot::has_command hishtory; then
11+
dot::chezmoi_script_skipped "hishtory is not installed"
12+
fi
13+
14+
if [[ -f "${HOME}/.hishtory/config.sh" ]]; then
15+
dot::chezmoi_script_skipped "hishtory is already configured"
16+
fi
17+
18+
dot::step::start "initializing hishtory shell integration"
19+
hishtory install --skip-config-modification || dot::step::fatal
20+
dot::step::done
21+
22+
dot::success "hishtory configured"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env zsh
2+
3+
# Initialize hishtory - better shell history
4+
# https://github.com/ddworken/hishtory
5+
6+
export HISHTORY_SERVER={{ .hishtory_server | quote }}
7+
8+
[[ -f ~/.hishtory/config.zsh ]] && source ~/.hishtory/config.zsh
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
# Initialize hishtory - better shell history
4+
# https://github.com/ddworken/hishtory
5+
6+
export HISHTORY_SERVER={{ .hishtory_server | quote }}
7+
8+
[[ -f ~/.hishtory/config.sh ]] && source ~/.hishtory/config.sh

0 commit comments

Comments
 (0)