Skip to content

Cleanup even more plugins #2282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions clean_files.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,25 @@ plugins/available/direnv.plugin.bash
plugins/available/dirs.plugin.bash
plugins/available/docker-compose.plugin.bash
plugins/available/docker-machine.plugin.bash
plugins/available/fasd.plugin.bash
plugins/available/fzf.plugin.bash
plugins/available/gif.plugin.bash
plugins/available/git-subrepo.plugin.bash
plugins/available/git.plugin.bash
plugins/available/gitstatus.plugin.bash
plugins/available/go.plugin.bash
plugins/available/goenv.plugin.bash
plugins/available/gradle.plugin.bash
plugins/available/hg.plugin.bash
plugins/available/history-eternal.plugin.bash
plugins/available/history-search.plugin.bash
plugins/available/history-substring-search.plugin.bash
plugins/available/history.plugin.bash
plugins/available/hub.plugin.bash
plugins/available/java.plugin.bash
plugins/available/javascript.plugin.bash
plugins/available/jekyll.plugin.bash
plugins/available/jenv.plugin.bash
plugins/available/jgitflow.plugin.bash
plugins/available/jump.plugin.bash
plugins/available/latex.plugin.bash
Expand All @@ -125,6 +131,7 @@ plugins/available/node.plugin.bash
plugins/available/nodenv.plugin.bash
plugins/available/osx-timemachine.plugin.bash
plugins/available/osx.plugin.bash
plugins/available/pack.plugin.bash
plugins/available/percol.plugin.bash
plugins/available/plenv.plugin.bash
plugins/available/postgres.plugin.bash
Expand Down
1 change: 1 addition & 0 deletions plugins/available/fasd.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'load fasd, if you are using it'

Expand Down
9 changes: 6 additions & 3 deletions plugins/available/fzf.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# shellcheck shell=bash
# Load after the system completion to make sure that the fzf completions are working
# BASH_IT_LOAD_PRIORITY: 375

cite about-plugin
about-plugin 'load fzf, if you are using it'

if [ -r ~/.fzf.bash ]; then
# shellcheck disable=SC1090
source ~/.fzf.bash
elif [ -r "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash ]; then
# shellcheck disable=SC1091
source "${XDG_CONFIG_HOME:-$HOME/.config}"/fzf/fzf.bash
fi

Expand All @@ -25,7 +28,7 @@ fe() {

local IFS=$'\n'
local files
files=($(fzf-tmux --query="$1" --multi --select-1 --exit-0))
IFS=" " read -r -a files --query="$1" --multi --select-1 --exit-0 <<< fzf-tmux
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
}

Expand All @@ -36,7 +39,7 @@ fcd() {
example "fcd aliases"

local dir
dir=$(find ${1:-.} -path '*/\.*' -prune \
dir=$(find "${1:-.}" -path '*/\.*' -prune \
-o -type d -print 2> /dev/null | fzf +m) \
&& cd "$dir"
&& cd "$dir" || return 1
}
1 change: 1 addition & 0 deletions plugins/available/gitstatus.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'speeds up your life by using gitstatus for git status calculations. install from https://github.com/romkatv/gitstatus'

Expand Down
1 change: 1 addition & 0 deletions plugins/available/hg.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'hg helper functions'

Expand Down
1 change: 1 addition & 0 deletions plugins/available/javascript.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
# The install directory is hard-coded. TODO: allow the directory to be specified on the command line.

cite about-plugin
Expand Down
1 change: 1 addition & 0 deletions plugins/available/jenv.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
cite about-plugin
about-plugin 'load jenv, if you are using it'

Expand Down
12 changes: 7 additions & 5 deletions plugins/available/pack.plugin.bash
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# shellcheck shell=bash
# bash completion for pack -*- shell-script -*-

cite about-plugin
Expand Down Expand Up @@ -49,7 +50,7 @@ __pack_handle_reply() {
else
allflags=("${flags[*]} ${two_word_flags[*]}")
fi
COMPREPLY=($(compgen -W "${allflags[*]}" -- "$cur"))
IFS=" " read -r -a COMPREPLY -W "${allflags[*]}" -- "$cur" <<< compgen
if [[ $(type -t compopt) = "builtin" ]]; then
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
fi
Expand All @@ -65,7 +66,7 @@ __pack_handle_reply() {
__pack_index_of_word "${flag}" "${flags_with_completion[@]}"
COMPREPLY=()
if [[ ${index} -ge 0 ]]; then
PREFIX=""
# PREFIX=""
cur="${cur#*=}"
${flags_completion[${index}]}
if [ -n "${ZSH_VERSION}" ]; then
Expand Down Expand Up @@ -99,10 +100,10 @@ __pack_handle_reply() {
if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
completions+=("${must_have_one_flag[@]}")
fi
COMPREPLY=($(compgen -W "${completions[*]}" -- "$cur"))
IFS=" " read -r -a COMPREPLY -W "${completions[*]}" -- "$cur" <<< compgen

if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
COMPREPLY=($(compgen -W "${noun_aliases[*]}" -- "$cur"))
IFS=" " read -r -a COMPREPLY -W "${noun_aliases[*]}" -- "$cur" <<< compgen
fi

if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
Expand All @@ -129,7 +130,7 @@ __pack_handle_filename_extension_flag() {

__pack_handle_subdirs_in_dir_flag() {
local dir="$1"
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd > /dev/null 2>&1
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd || return 1 > /dev/null 2>&1
}

__pack_handle_flag() {
Expand Down Expand Up @@ -568,6 +569,7 @@ _pack_root_command() {
__start_pack() {
local cur prev words cword
declare -A flaghash 2> /dev/null || :
export flaghash
declare -A aliashash 2> /dev/null || :
if declare -F _init_completion > /dev/null 2>&1; then
_init_completion -s || return
Expand Down
Loading
Loading