2121 export HELPFUL_COMMANDLINES_SOURCE_SCRIPTS=${HELPFUL_COMMANDLINES_SOURCE_SCRIPTS}
2222fi
2323
24- # Extend for poco-select-history function
25- # export HISTSIZE=20000
26- # export SAVEHIST=15000
27- # https://github.com/mattjj/my-oh-my-zsh/blob/master/history.zsh
28-
29- LHS_CHANGE_HISTORY_SETTINGS=${3:- ' True' }
30-
31- if [[ " ${LHS_CHANGE_HISTORY_SETTINGS} " = " True" && " $( which setopt) " != " " ]]; then
32- export HISTFILE=" $HOME /.zsh_history"
33- export HISTSIZE=1048576
34- export SAVEHIST=1048576
35- # Ignore duplicates in command history and increase
36- export HISTCONTROL=ignoredups
37-
38- setopt BANG_HIST # Treat the '!' character specially during expansion.
39- setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
40- setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
41- setopt SHARE_HISTORY # Share history between all sessions.
42- setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
43-
44- setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
45- setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
46- setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
47- setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
48- setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
49- setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
50- setopt HIST_VERIFY # Don't execute immediately upon history expansion.
51- setopt HIST_BEEP # Beep when accessing nonexistent history.
52- fi
53-
5424export LHS_PROJECTS_DIR=~ /projects
5525# Get all history from folder /opt/lamhaison-tools
5626export LHS_HELPFUL_LOOKUP=" ${HELPFUL_COMMANDLINES_SOURCE_SCRIPTS} /.."
@@ -62,20 +32,29 @@ export LHS_HELPFUL_LOOKUP_FUNCTIONS_CACHED_EXPIRED_TIME=$((60 * 8))
6232# https://yukimemi.netlify.app/all-you-need-is-peco/
6333# https://thevaluable.dev/zsh-line-editor-configuration-mouseless/
6434for script in $(
65- find ${HELPFUL_COMMANDLINES_SOURCE_SCRIPTS} -type f -name ' *.sh' |
35+ find " ${HELPFUL_COMMANDLINES_SOURCE_SCRIPTS} " -type f -name ' *.sh' |
6636 grep -v -E ' .*(main.sh|test.sh|temp.sh|helpful-commandlines.sh)$'
6737) ; do
68- source $script
38+
39+ # shellcheck disable=SC1090
40+ source " ${script} "
6941done
7042
7143export lhs_cli_peco_input_expired_time=10
7244export lhs_cli_show_commandline=true
7345export lhs_cli_input=/tmp/lhs/inputs
7446export lhs_cli_logs=/tmp/lhs/logs
75- mkdir -p ${lhs_cli_input} ${lhs_cli_logs}
7647export lhs_cli_log_file_path=" ${lhs_cli_logs} /lhs-cli.log"
7748export lhs_cli_log_uploaded_file_path=" ${lhs_cli_logs} /lhs-cli-uploaded.log"
7849
50+ folder_list=(" ${lhs_cli_input} " " ${lhs_cli_logs} " )
51+ for folder in " ${folder_list[@]} " ; do
52+ if [ ! -d " $folder " ]; then
53+ mkdir -p " ${folder} "
54+ fi
55+ done
56+
57+ # Setup binding keys
7958LHS_BIND_KEY=${2:- ' True' }
8059
8160if [[ ${LHS_BIND_KEY} == " True" && " $( which zle) " != " " ]]; then
@@ -96,3 +75,33 @@ if [[ ${LHS_BIND_KEY} == "True" && "$(which zle)" != "" ]]; then
9675 # Hotkey: Option + gc
9776 bindkey ' ©ç' lhs_git_commit_suggestions_with_hint
9877fi
78+
79+ # Setup for history commandlines feature
80+ # Extend for poco-select-history function
81+ # export HISTSIZE=20000
82+ # export SAVEHIST=15000
83+ # https://github.com/mattjj/my-oh-my-zsh/blob/master/history.zsh
84+ LHS_CHANGE_HISTORY_SETTINGS=${3:- ' True' }
85+
86+ if [[ " ${LHS_CHANGE_HISTORY_SETTINGS} " = " True" && " $( which setopt) " != " " ]]; then
87+ export HISTFILE=" $HOME /.zsh_history"
88+ export HISTSIZE=1048576
89+ export SAVEHIST=1048576
90+ # Ignore duplicates in command history and increase
91+ export HISTCONTROL=ignoredups
92+
93+ setopt BANG_HIST # Treat the '!' character specially during expansion.
94+ setopt EXTENDED_HISTORY # Write the history file in the ":start:elapsed;command" format.
95+ setopt INC_APPEND_HISTORY # Write to the history file immediately, not when the shell exits.
96+ setopt SHARE_HISTORY # Share history between all sessions.
97+ setopt HIST_EXPIRE_DUPS_FIRST # Expire duplicate entries first when trimming history.
98+
99+ setopt HIST_IGNORE_DUPS # Don't record an entry that was just recorded again.
100+ setopt HIST_IGNORE_ALL_DUPS # Delete old recorded entry if new entry is a duplicate.
101+ setopt HIST_FIND_NO_DUPS # Do not display a line previously found.
102+ setopt HIST_IGNORE_SPACE # Don't record an entry starting with a space.
103+ setopt HIST_SAVE_NO_DUPS # Don't write duplicate entries in the history file.
104+ setopt HIST_REDUCE_BLANKS # Remove superfluous blanks before recording entry.
105+ setopt HIST_VERIFY # Don't execute immediately upon history expansion.
106+ setopt HIST_BEEP # Beep when accessing nonexistent history.
107+ fi
0 commit comments