Skip to content

Commit

Permalink
Merge pull request #82 from pascal-zarrad/feature/improve-stability
Browse files Browse the repository at this point in the history
Remove seldom used plugins and optimize performance
  • Loading branch information
pascal-zarrad committed Jul 26, 2024
2 parents e6beae4 + 1242524 commit 42aa2fe
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 99 deletions.
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#==================================================================

# Semantic versioning version constant
readonly PSH_VERSION="2.0.0"
readonly PSH_VERSION="2.1.0"
echo "PSH - VERSION: ${PSH_VERSION}"

if [ -f /etc/os-release ]; then
Expand Down
12 changes: 12 additions & 0 deletions lib/plugin_api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ function apply_plugin() {
fi
}

# Function that checks if zplug plugin is loaded or not
# and then adds the plugin with a specific version to the .zshrc
#
# @param $1 The plugin to add to the .zshrc
function apply_plugin_version() {
zplug_plugin="$1"
zplug_plugin_version="$2"
if ! grep -q "zplug \"${zplug_plugin}\"" "${ZSHRC_PATH}" ; then
write_zshrc "zplug \"${zplug_plugin}\", at:${zplug_plugin_version}"
fi
}

# Function that checks if zplug oh-my-zsh lib is loaded or not
# and then adds the lib to the .zshrc
#
Expand Down
27 changes: 0 additions & 27 deletions plugins/aws/plugin.sh

This file was deleted.

27 changes: 0 additions & 27 deletions plugins/azure/plugin.sh

This file was deleted.

2 changes: 0 additions & 2 deletions plugins/docker/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,3 @@
#==================================================================

apply_ohmyzsh_plugin "docker"
apply_ohmyzsh_plugin "docker-compose"
apply_ohmyzsh_plugin "ctop"
27 changes: 0 additions & 27 deletions plugins/encode64/plugin.sh

This file was deleted.

10 changes: 8 additions & 2 deletions plugins/ssh-agent/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@
# Script Name : psh-ssh-agent-installer
# Description : Enables oh-my-zsh's ssh-agent plugin
# to automatically load the ssh-agent.
# Especially usefull on WSL2.
# Only enabled on WSL2.
# Args : -
# Author : Pascal Zarrad
# Email : P.Zarrad@outlook.de
#==================================================================

apply_ohmyzsh_plugin "ssh-agent"
if grep -q "Microsoft" "/proc/version" || grep -q ".*microsoft-standard*." "/proc/version"
then
apply_ohmyzsh_plugin "ssh-agent"

# Configure ssh agent to not instantly load keys on zsh start
write_zshrc "zstyle :omz:plugins:ssh-agent lazy yes"
fi
1 change: 0 additions & 1 deletion plugins/yarn/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@
#==================================================================

apply_ohmyzsh_plugin "yarn"
apply_ohmyzsh_plugin "yarn-autocompletions"
11 changes: 4 additions & 7 deletions plugins/zsh-enhancements/plugin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,10 @@ apply_plugin "zsh-users/zsh-completions"
# It suggests commands as you type based on history and completions.
apply_plugin "zsh-users/zsh-autosuggestions"

# This is a clean-room implementation of the Fish shell's history
# search feature, where you can type in any part of any command
# from history and then press chosen keys, such as the UP and
# DOWN arrows, to cycle through matches.
apply_plugin "zsh-users/zsh-history-substring-search"

# This plugin adds autocompletion to further speed up command
# line work. Together with autosuggestions, it makes typing
# commands a breeze.
apply_plugin "marlonrichert/zsh-autocomplete"
# The plugin has been locked to a specific commit as ~ expansion
# on path autocomplete "broke" one commit after this one.
# See: https://github.com/marlonrichert/zsh-autocomplete/issues/741
apply_plugin_version "marlonrichert/zsh-autocomplete" "a66d6ae6f7e703b1bf5ae57e48a7da3cf307aeab"
2 changes: 2 additions & 0 deletions templates/git_integration_disable_async_prompt.template.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#PSH_TEMPLATE=AFTER_PLUGINS_BEFORE_ZPLUG_APPLY
zstyle ':omz:alpha:lib:git' async-prompt no
2 changes: 0 additions & 2 deletions templates/gpg_tty_fix.template.zshrc

This file was deleted.

3 changes: 0 additions & 3 deletions templates/ssh_agent_lazy.template.zshrc

This file was deleted.

11 changes: 11 additions & 0 deletions templates/zsh_better_history.template.zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#PSH_TEMPLATE=END
# History improvements
# Source: https://jdhao.github.io/2021/03/24/zsh_history_setup/
export HISTFILE=~/.histfile # history file location
export HISTSIZE=1000000 # the number of items for the internal history list
export SAVEHIST=1000000 # maximum number of items for the history file
setopt HIST_IGNORE_ALL_DUPS # do not put duplicated command into history list
setopt HIST_SAVE_NO_DUPS # do not save duplicated command
setopt HIST_REDUCE_BLANKS # remove unnecessary blanks
setopt INC_APPEND_HISTORY_TIME # append command to history file immediately after execution
setopt EXTENDED_HISTORY # record command start time

0 comments on commit 42aa2fe

Please sign in to comment.