mirror of
https://github.com/chenasraf/dotfiles.git
synced 2026-05-17 17:28:07 +00:00
refactor: cleanups, plugin refactors
This commit is contained in:
@@ -78,7 +78,6 @@ alias gundo="git reset --soft HEAD~1"
|
||||
alias unq="sudo xattr -rd com.apple.quarantine"
|
||||
alias sf="search-file"
|
||||
alias fnu="find-up"
|
||||
alias ascii-text=". \$DOTFILES/scripts/ascii_font/ascii_font.sh"
|
||||
alias dr="dotenv run"
|
||||
alias lua="luajit"
|
||||
alias prettypath="echo \$PATH | tr ':' '\n'"
|
||||
|
||||
18
install.zsh
18
install.zsh
@@ -274,15 +274,6 @@ echo_yellow "Sourcing alias/function files..."
|
||||
src "aliases"
|
||||
src "plugins/functions.plugin.zsh"
|
||||
|
||||
# Zplug packages reload
|
||||
if [[ $refresh_zplug -eq 1 ]]; then
|
||||
echo_yellow "Reloading zplug..."
|
||||
zplug clear
|
||||
source "$DOTFILES/zplug.init.zsh"
|
||||
zplug install
|
||||
zplug load --verbose
|
||||
fi
|
||||
|
||||
if [[ -z "$OPENAI_API_KEY" ]]; then
|
||||
if ask "OpenAI API key is not defined, set up?"; then
|
||||
echo_cyan "You might be asked to authenticate using 1Password to retrieve the key."
|
||||
@@ -297,6 +288,15 @@ if [[ -z "$OPENAI_API_KEY" ]]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Zplug packages reload
|
||||
if [[ $refresh_zplug -eq 1 ]]; then
|
||||
echo_yellow "Reloading zplug..."
|
||||
zplug clear
|
||||
source "$DOTFILES/zplug.init.zsh"
|
||||
zplug install
|
||||
zplug load --verbose
|
||||
fi
|
||||
|
||||
echo_cyan "Done"
|
||||
|
||||
popd
|
||||
|
||||
4
scripts/ascii_font/ascii_font.sh → plugins/ascii_font/ascii_font.zsh
Normal file → Executable file
4
scripts/ascii_font/ascii_font.sh → plugins/ascii_font/ascii_font.zsh
Normal file → Executable file
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# ascii-font() {
|
||||
dir="$DOTFILES/scripts/ascii_font"
|
||||
dir="$DOTFILES/plugins/ascii_font"
|
||||
font="$dir/fonts/Big-Money-ne"
|
||||
size=1
|
||||
color=""
|
||||
@@ -3,7 +3,7 @@
|
||||
source $DOTFILES/autoload_completions.zsh
|
||||
|
||||
motd() {
|
||||
out=$(run-parts $DOTFILES/scripts/motd)
|
||||
out=$(run-parts $DOTFILES/plugins/motd)
|
||||
echo $out
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[*]
|
||||
tab_width = 2
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
@@ -1 +0,0 @@
|
||||
gen/
|
||||
@@ -1 +0,0 @@
|
||||
gen/
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"printWidth": 100,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"overrides": [
|
||||
{
|
||||
"files": "*.md",
|
||||
"options": {
|
||||
"printWidth": 100,
|
||||
"proseWrap": "always"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# The following array values must be in the same order to be matches
|
||||
|
||||
# Dev directory of workflow to use as git source directory
|
||||
workflow_dirs=(
|
||||
"$HOME/Dev/heb-flip-alfred-workflow"
|
||||
"$HOME/Dev/gaardian-alfred-workflow"
|
||||
"$HOME/Dev/gitlab-search-alfred-workflow"
|
||||
)
|
||||
# Repository of workflow to clone from (if dev directory is missing)
|
||||
workflow_repos=(
|
||||
"https://github.com/chenasraf/heb-flip-alfred-workflow.git"
|
||||
"https://github.com/chenasraf/gaardian-alfred-workflow.git"
|
||||
"https://github.com/chenasraf/gitlab-search-alfred-workflow.git"
|
||||
)
|
||||
# IDs of workflows to use (same as in Alfred prefs directory)
|
||||
workflows_ids=(
|
||||
"3A312BFD-A5FC-4223-BBFC-400D03F10282"
|
||||
"55E2EF57-AB9F-45D9-AF04-B505E0D32238"
|
||||
"B4D2FD01-74DA-4F9D-8CDC-55A0DA1BC793"
|
||||
)
|
||||
|
||||
case "$1" in
|
||||
push | p)
|
||||
#
|
||||
shift
|
||||
|
||||
for ((i = 1; i <= $#workflow_dirs; i++)); do
|
||||
wf_dir="${workflow_dirs[$i]}"
|
||||
wf_repo="${workflow_repos[$i]}"
|
||||
wf_id="${workflows_ids[$i]}"
|
||||
|
||||
echo_cyan "Updating workflow: $wf_id ($wf_repo) into $wf_dir..."
|
||||
|
||||
if [[ ! -d "$wf_dir" ]]; then
|
||||
git clone "$wf_repo" "$wf_dir"
|
||||
fi
|
||||
|
||||
rsync -tvr --exclude=".git" "$DOTFILES/synced/Alfred.alfredpreferences/workflows/user.workflow.$wf_id/" "$wf_dir/"
|
||||
git -C "$wf_dir" add .
|
||||
auto_commit_flag="'Update workflow'"
|
||||
commit_flag="-m ${1:-$auto_commit_flag}"
|
||||
eval "git -C '$wf_dir' commit $commit_flag"
|
||||
git -C "$wf_dir" push origin master
|
||||
done
|
||||
;;
|
||||
pull | l)
|
||||
shift
|
||||
|
||||
for ((i = 1; i <= $#workflow_dirs; i++)); do
|
||||
wf_dir="${workflow_dirs[$i]}"
|
||||
wf_repo="${workflow_repos[$i]}"
|
||||
wf_id="${workflows_ids[$i]}"
|
||||
|
||||
echo_cyan "Pulling workflow: $wf_id ($wf_repo) into $DOTFILES/synced/Alfred.alfredpreferences/workflows/user.workflow.$wf_id/..."
|
||||
|
||||
if [[ ! -d "$wf_dir" ]]; then
|
||||
git clone "$wf_repo" "$wf_dir"
|
||||
fi
|
||||
|
||||
rsync -tvr --exclude=".git" "$wf_dir/" "$DOTFILES/synced/Alfred.alfredpreferences/workflows/user.workflow.$wf_id/"
|
||||
rm -rf "$DOTFILES/synced/Alfred.alfredpreferences/workflows/user.workflow.$wf_id/.git"
|
||||
done
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 [push|pull]"
|
||||
;;
|
||||
esac
|
||||
@@ -1,9 +1,11 @@
|
||||
source ~/.zplug/init.zsh
|
||||
|
||||
zplug "$DOTFILES/plugins/ascii_font", from:local, use:"ascii_font.zsh", as:command, hook-load:"ascii-text() { . $DOTFILES/plugins/ascii_font/ascii_font.zsh }"
|
||||
# zplug "$DOTFILES/plugins/ascii_font", from:local, use:"ascii_font.zsh", as:command, rename-to:ascii-text
|
||||
zplug "$DOTFILES/plugins", from:local
|
||||
|
||||
zplug "mfaerevaag/wd", as:command, use:"wd.sh", hook-load:"wd() { . $ZPLUG_REPOS/mfaerevaag/wd/wd.sh }"
|
||||
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
||||
zplug "romkatv/powerlevel10k", as:theme, depth:1
|
||||
zplug "zsh-users/zsh-autosuggestions"
|
||||
zplug "wfxr/tmux-power", from:github, as:theme, depth:1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user