updated dotfiles
This commit is contained in:
parent
1a320cc68a
commit
13cac0af3a
243
.config/fish/completions/sdk.fish
Normal file
243
.config/fish/completions/sdk.fish
Normal file
@ -0,0 +1,243 @@
|
||||
# Defines autocompletion for SDKMAN!
|
||||
|
||||
# Copyright (c) 2018-2023 Raphael Reitzig
|
||||
# MIT License (MIT)
|
||||
# https://github.com/reitzig/sdkman-for-fish
|
||||
|
||||
# Guard: SDKMAN! needs to be installed
|
||||
if not test -f "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||
exit 0
|
||||
end
|
||||
|
||||
# # # # # #
|
||||
# Completion trigger predicates
|
||||
# # # # # #
|
||||
|
||||
# Test if there is no command
|
||||
function __fish_sdkman_no_command
|
||||
set cmd (commandline -opc)
|
||||
|
||||
if [ (count $cmd) -eq 1 ]
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
# Test if the main command matches one of the parameters
|
||||
function __fish_sdkman_using_command
|
||||
set cmd (commandline -opc)
|
||||
|
||||
if [ (count $cmd) -eq 2 ]
|
||||
if contains $cmd[2] $argv
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_sdkman_specifying_candidate
|
||||
set cmd (commandline -opc)
|
||||
|
||||
if [ (count $cmd) -eq 3 ] # currently, sdk does not support multiple versions
|
||||
if contains $cmd[2] $argv
|
||||
return 0
|
||||
end
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
function __fish_sdkman_command_has_enough_parameters
|
||||
set cmd (commandline -opc)
|
||||
|
||||
if [ (count $cmd) -ge (math $argv[1] + 2) ]; and contains $cmd[2] $argv[2..-1]
|
||||
return 0
|
||||
end
|
||||
return 1
|
||||
end
|
||||
|
||||
# # # # # #
|
||||
# Data collectors
|
||||
# # # # # #
|
||||
|
||||
function __fish_sdkman_candidates
|
||||
cat "$SDKMAN_DIR"/var/candidates | string replace -a -r ',' '\n'
|
||||
end
|
||||
|
||||
function __fish_sdkman_candidates_with_versions
|
||||
set regexpHome (string replace -a '/' '\\/' "$HOME/")
|
||||
|
||||
find "$SDKMAN_DIR"/candidates/ -mindepth 2 -maxdepth 2 -name '*current' \
|
||||
| awk -F '/' '{ print $(NF-1) }' \
|
||||
| sort -u
|
||||
end
|
||||
|
||||
function __fish_sdkman_installed_versions
|
||||
set cmd (commandline -opc)
|
||||
if [ -d "$SDKMAN_DIR"/candidates/$cmd[3]/current ]
|
||||
ls -v1 "$SDKMAN_DIR"/candidates/$cmd[3] | grep -v current
|
||||
end
|
||||
end
|
||||
|
||||
# # # # # #
|
||||
# Completion specification
|
||||
# # # # # #
|
||||
|
||||
# install
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'i install' \
|
||||
-d 'Install new version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command i install' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
# TODO complete available versions --> issue #4
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \
|
||||
-a 'a.b.c' \
|
||||
-d "version list unavailable"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate i install' \
|
||||
-a 'x.y.z' \
|
||||
-d "Specify path to install custom version."
|
||||
# Implicit: complete files as fourth parameter
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 3 i install'
|
||||
# block
|
||||
|
||||
# uninstall
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'rm uninstall' -d 'Uninstall version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command rm uninstall' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate rm uninstall' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 rm uninstall'
|
||||
# block
|
||||
|
||||
# list
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'ls list' \
|
||||
-d 'List versions'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ls list' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ls list'
|
||||
# block
|
||||
|
||||
# use
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'u use' \
|
||||
-d 'Use specific version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command u use' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate u use' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 u use'
|
||||
# block
|
||||
|
||||
# default
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'd default' \
|
||||
-d 'Set default version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command d default' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate d default' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 d default'
|
||||
# block
|
||||
|
||||
# current
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'c current' \
|
||||
-d 'Display current version'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command c current' \
|
||||
-a "(__fish_sdkman_candidates)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 c current'
|
||||
# block
|
||||
|
||||
# upgrade
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'ug upgrade' \
|
||||
-d 'Display what is outdated'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command ug upgrade' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 ug upgrade'
|
||||
# block
|
||||
|
||||
# version
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'v version' \
|
||||
-d 'Display version'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 v version'
|
||||
# block
|
||||
|
||||
# help
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'help' \
|
||||
-d 'Display help message'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 h help'
|
||||
# block
|
||||
|
||||
# offline
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'offline' \
|
||||
-d 'Set offline status'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command offline' \
|
||||
-a 'enable' \
|
||||
-d 'Make sdk work while offline'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command offline' \
|
||||
-a 'disable' \
|
||||
-d 'Turn on all features'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 offline'
|
||||
# block
|
||||
|
||||
# selfupdate
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'selfupdate' \
|
||||
-d 'Update sdk'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command selfupdate' \
|
||||
-a 'force' \
|
||||
-d 'Force re-install of current version'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 selfupdate'
|
||||
# block
|
||||
|
||||
# update
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'update' \
|
||||
-d 'Reload the candidate list'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 0 update'
|
||||
# block
|
||||
|
||||
# flush
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'flush' \
|
||||
-d 'Clear out archives and temporary storage folders'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' \
|
||||
-a 'temp' \
|
||||
-d 'Clear out staging work folder'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command flush' \
|
||||
-a 'version' \
|
||||
-d 'Flush version file'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 flush'
|
||||
# block
|
||||
|
||||
# env
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'e env' \
|
||||
-d 'Load environment from .sdkmanrc file'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command e env' \
|
||||
-a 'init' \
|
||||
-d 'Initialize .sdkmanrc file'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command e env' \
|
||||
-a 'install' \
|
||||
-d 'Install all candidate versions listed in .sdkmanrc'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command e env' \
|
||||
-a 'clear' \
|
||||
-d 'Unload currently loaded environment'
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 1 e env'
|
||||
# block
|
||||
|
||||
# home
|
||||
complete -c sdk -f -n '__fish_sdkman_no_command' \
|
||||
-a 'h home' \
|
||||
-d 'Show installation folder of given candidate'
|
||||
complete -c sdk -f -n '__fish_sdkman_using_command h home' \
|
||||
-a "(__fish_sdkman_candidates_with_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_specifying_candidate h home' \
|
||||
-a "(__fish_sdkman_installed_versions)"
|
||||
complete -c sdk -f -n '__fish_sdkman_command_has_enough_parameters 2 h home'
|
||||
# block
|
||||
1
.config/fish/conf.d/rustup.fish
Normal file
1
.config/fish/conf.d/rustup.fish
Normal file
@ -0,0 +1 @@
|
||||
source "$HOME/.cargo/env.fish"
|
||||
111
.config/fish/conf.d/sdk.fish
Normal file
111
.config/fish/conf.d/sdk.fish
Normal file
@ -0,0 +1,111 @@
|
||||
#!/usr/bin/fish
|
||||
|
||||
# Makes command and binaries from SDKMAN! available in fish.
|
||||
# Delegates to bash for the `sdk` command.
|
||||
|
||||
# Copyright (c) 2018-2023 Raphael Reitzig
|
||||
# MIT License (MIT)
|
||||
# https://github.com/reitzig/sdkman-for-fish
|
||||
|
||||
# Account for custom install locations
|
||||
if set -q __sdkman_custom_dir
|
||||
set -gx SDKMAN_DIR "$__sdkman_custom_dir"
|
||||
end
|
||||
# Guard: SDKMAN! needs to be installed
|
||||
if set -q SDKMAN_DIR; and not test -f "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||
echo "WARNING: SDKMAN! installation path set to $SDKMAN_DIR, but no installation found there"
|
||||
exit 0
|
||||
end
|
||||
|
||||
# Unless overridden, use the default location:
|
||||
if not set -q SDKMAN_DIR
|
||||
set -gx SDKMAN_DIR "$HOME/.sdkman"
|
||||
end
|
||||
|
||||
set __fish_sdkman_init "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||
|
||||
# Guard: SDKMAN! needs to be installed
|
||||
if not test -f "$__fish_sdkman_init"
|
||||
exit 0
|
||||
end
|
||||
|
||||
# Copied from https://github.com/jorgebucaran/fisher/blob/main/functions/fisher.fish to be consistent:
|
||||
set --query fisher_path || set --local fisher_path $__fish_config_dir
|
||||
set __fish_sdkman_noexport_init "$fisher_path/functions/__sdkman-noexport-init.sh"
|
||||
|
||||
# Hack for issue #19:
|
||||
# Create version of sdkman-init that doesn't export any environment variables.
|
||||
# Refresh if sdkman-init changed.
|
||||
if begin not test -f "$__fish_sdkman_noexport_init";
|
||||
or env test "$__fish_sdkman_init" -nt "$__fish_sdkman_noexport_init"
|
||||
end
|
||||
mkdir -p (dirname $__fish_sdkman_noexport_init)
|
||||
sed -E -e 's/^(\s*).*(export|to_path).*$/\1:/g' "$__fish_sdkman_init" \
|
||||
> "$__fish_sdkman_noexport_init"
|
||||
end
|
||||
|
||||
# Runs the given command in bash, capturing some side effects
|
||||
# and repeating them on the current fish shell.
|
||||
# Returns the same status code as the given command.
|
||||
function __fish_sdkman_run_in_bash
|
||||
# We need to leave stdin and stdout of sdk free for user interaction.
|
||||
# So, pipe relevant environment variables (which might have changed)
|
||||
# through a file.
|
||||
# But since now getting the exit code of sdk itself is a hassle,
|
||||
# pipe it as well.
|
||||
#
|
||||
# TODO: Can somebody get this to work without the overhead of a file?
|
||||
set pipe (mktemp)
|
||||
bash -c "$argv[1];
|
||||
echo -e \"\$?\" > $pipe;
|
||||
env | grep -e '^SDKMAN_\|^PATH' >> $pipe;
|
||||
env | grep -i -E \"^(`echo \${SDKMAN_CANDIDATES_CSV} | sed 's/,/|/g'`)_HOME\" >> $pipe;
|
||||
echo \"SDKMAN_OFFLINE_MODE=\${SDKMAN_OFFLINE_MODE}\" >> $pipe;
|
||||
echo \"SDKMAN_ENV=\${SDKMAN_ENV}\" >> $pipe" # it's not an environment variable!
|
||||
set bashDump (cat $pipe; rm $pipe)
|
||||
|
||||
set sdkStatus $bashDump[1]
|
||||
set bashEnv $bashDump[2..-1]
|
||||
|
||||
# If SDKMAN! succeeded, copy relevant environment variables
|
||||
# to the current shell (they might have changed)
|
||||
if [ $sdkStatus = 0 ]
|
||||
for line in $bashEnv
|
||||
set parts (string split "=" $line)
|
||||
set var $parts[1]
|
||||
set value (string join "=" $parts[2..-1])
|
||||
|
||||
switch "$var"
|
||||
case "PATH"
|
||||
# Special treatment: need fish list instead
|
||||
# of colon-separated list.
|
||||
set value (string split : "$value")
|
||||
end
|
||||
|
||||
if test -n value
|
||||
set -gx $var $value
|
||||
# Note: This makes SDKMAN_{OFFLINE_MODE,ENV} environment variables.
|
||||
# That gives it the behaviour we _want_!
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return $sdkStatus
|
||||
end
|
||||
|
||||
# If this is a subshell of a(n initialized) fish owned by the same user,
|
||||
# no initialization necessary.
|
||||
# Otherwise:
|
||||
if not set -q SDKMAN_CANDIDATES_DIR; or test (ls -ld "$SDKMAN_CANDIDATES_DIR" | awk '{print $3}') != (whoami)
|
||||
__fish_sdkman_run_in_bash "source $__fish_sdkman_init"
|
||||
end
|
||||
|
||||
# Set up auto_env
|
||||
if grep -q "^sdkman_auto_env=true" "$SDKMAN_DIR/etc/config"
|
||||
function __fish_sdkman_autoenv --on-variable PWD
|
||||
# Run the (modified) init script, which performs the checks and calls for us!
|
||||
__fish_sdkman_run_in_bash "source \"$__fish_sdkman_noexport_init\""
|
||||
|
||||
set -x SDKMAN_OLD_PWD "$PWD" # needed by the Bash implementation
|
||||
end
|
||||
end
|
||||
@ -1,2 +1,3 @@
|
||||
jorgebucaran/fisher
|
||||
patrickf1/fzf.fish
|
||||
reitzig/sdkman-for-fish@v2.1.0
|
||||
|
||||
@ -3,7 +3,8 @@
|
||||
SETUVAR __fish_initialized:3800
|
||||
SETUVAR _fisher_jorgebucaran_2F_fisher_files:\x7e/\x2econfig/fish/functions/fisher\x2efish\x1e\x7e/\x2econfig/fish/completions/fisher\x2efish
|
||||
SETUVAR _fisher_patrickf1_2F_fzf_2E_fish_files:\x7e/\x2econfig/fish/functions/_fzf_configure_bindings_help\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_extract_var_info\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_changed_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_preview_file\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_diff_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_report_file_type\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_directory\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_log\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_git_status\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_history\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_processes\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_search_variables\x2efish\x1e\x7e/\x2econfig/fish/functions/_fzf_wrapper\x2efish\x1e\x7e/\x2econfig/fish/functions/fzf_configure_bindings\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/fzf\x2efish\x1e\x7e/\x2econfig/fish/completions/fzf_configure_bindings\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1epatrickf1/fzf\x2efish
|
||||
SETUVAR _fisher_plugins:jorgebucaran/fisher\x1epatrickf1/fzf\x2efish\x1ereitzig/sdkman\x2dfor\x2dfish\x40v2\x2e1\x2e0
|
||||
SETUVAR _fisher_reitzig_2F_sdkman_2D_for_2D_fish_40_v2_2E_31_2E_30__files:\x7e/\x2econfig/fish/functions/sdk\x2efish\x1e\x7e/\x2econfig/fish/conf\x2ed/sdk\x2efish\x1e\x7e/\x2econfig/fish/completions/sdk\x2efish
|
||||
SETUVAR _fisher_upgraded_to_4_4:\x1d
|
||||
SETUVAR fish_color_autosuggestion:brblack
|
||||
SETUVAR fish_color_cancel:\x2dr
|
||||
@ -34,3 +35,4 @@ SETUVAR fish_pager_color_description:yellow\x1e\x2di
|
||||
SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
|
||||
SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
|
||||
SETUVAR fish_pager_color_selected_background:\x2dr
|
||||
SETUVAR fish_user_paths:/home/testing/\x2elocal/bin
|
||||
|
||||
175
.config/fish/functions/__sdkman-noexport-init.sh
Normal file
175
.config/fish/functions/__sdkman-noexport-init.sh
Normal file
@ -0,0 +1,175 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Copyright 2021 Marco Vermeulen
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
# set env vars if not set
|
||||
if [ -z "$SDKMAN_CANDIDATES_API" ]; then
|
||||
:
|
||||
fi
|
||||
|
||||
if [ -z "$SDKMAN_DIR" ]; then
|
||||
:
|
||||
fi
|
||||
|
||||
# Load the sdkman config if it exists.
|
||||
if [ -f "${SDKMAN_DIR}/etc/config" ]; then
|
||||
source "${SDKMAN_DIR}/etc/config"
|
||||
fi
|
||||
|
||||
# Read the platform file
|
||||
SDKMAN_PLATFORM="$(cat "${SDKMAN_DIR}/var/platform")"
|
||||
:
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
darwin=false
|
||||
solaris=false
|
||||
freebsd=false
|
||||
SDKMAN_KERNEL="$(uname -s)"
|
||||
case "${SDKMAN_KERNEL}" in
|
||||
CYGWIN*)
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin*)
|
||||
darwin=true
|
||||
;;
|
||||
SunOS*)
|
||||
solaris=true
|
||||
;;
|
||||
FreeBSD*)
|
||||
freebsd=true
|
||||
esac
|
||||
|
||||
# Determine shell
|
||||
zsh_shell=false
|
||||
bash_shell=false
|
||||
|
||||
if [[ -n "$ZSH_VERSION" ]]; then
|
||||
zsh_shell=true
|
||||
elif [[ -n "$BASH_VERSION" ]]; then
|
||||
bash_shell=true
|
||||
fi
|
||||
|
||||
# Source sdkman module scripts and extension files.
|
||||
#
|
||||
# Extension files are prefixed with 'sdkman-' and found in the ext/ folder.
|
||||
# Use this if extensions are written with the functional approach and want
|
||||
# to use functions in the main sdkman script. For more details, refer to
|
||||
# <https://github.com/sdkman/sdkman-extensions>.
|
||||
OLD_IFS="$IFS"
|
||||
IFS=$'\n'
|
||||
scripts=($(find "${SDKMAN_DIR}/src" "${SDKMAN_DIR}/ext" -type f -name 'sdkman-*.sh'))
|
||||
for f in "${scripts[@]}"; do
|
||||
source "$f"
|
||||
done
|
||||
IFS="$OLD_IFS"
|
||||
unset OLD_IFS scripts f
|
||||
|
||||
# Create upgrade delay file if it doesn't exist
|
||||
if [[ ! -f "${SDKMAN_DIR}/var/delay_upgrade" ]]; then
|
||||
touch "${SDKMAN_DIR}/var/delay_upgrade"
|
||||
fi
|
||||
|
||||
# set curl connect-timeout and max-time
|
||||
if [[ -z "$sdkman_curl_connect_timeout" ]]; then sdkman_curl_connect_timeout=7; fi
|
||||
if [[ -z "$sdkman_curl_max_time" ]]; then sdkman_curl_max_time=10; fi
|
||||
|
||||
# set curl retry
|
||||
if [[ -z "${sdkman_curl_retry}" ]]; then sdkman_curl_retry=0; fi
|
||||
|
||||
# set curl retry max time in seconds
|
||||
if [[ -z "${sdkman_curl_retry_max_time}" ]]; then sdkman_curl_retry_max_time=60; fi
|
||||
|
||||
# set curl to continue downloading automatically
|
||||
if [[ -z "${sdkman_curl_continue}" ]]; then sdkman_curl_continue=true; fi
|
||||
|
||||
# read list of candidates and set array
|
||||
SDKMAN_CANDIDATES_CACHE="${SDKMAN_DIR}/var/candidates"
|
||||
SDKMAN_CANDIDATES_CSV=$(<"$SDKMAN_CANDIDATES_CACHE")
|
||||
__sdkman_echo_debug "Setting candidates csv: $SDKMAN_CANDIDATES_CSV"
|
||||
if [[ "$zsh_shell" == 'true' ]]; then
|
||||
SDKMAN_CANDIDATES=(${(s:,:)SDKMAN_CANDIDATES_CSV})
|
||||
else
|
||||
IFS=',' read -a SDKMAN_CANDIDATES <<< "${SDKMAN_CANDIDATES_CSV}"
|
||||
fi
|
||||
|
||||
:
|
||||
|
||||
for candidate_name in "${SDKMAN_CANDIDATES[@]}"; do
|
||||
candidate_dir="${SDKMAN_CANDIDATES_DIR}/${candidate_name}/current"
|
||||
if [[ -h "$candidate_dir" || -d "${candidate_dir}" ]]; then
|
||||
:
|
||||
:
|
||||
fi
|
||||
done
|
||||
unset candidate_name candidate_dir
|
||||
:
|
||||
|
||||
# source completion scripts
|
||||
if [[ "$sdkman_auto_complete" == 'true' ]]; then
|
||||
if [[ "$zsh_shell" == 'true' ]]; then
|
||||
# initialize zsh completions (if not already done)
|
||||
if ! (( $+functions[compdef] )) ; then
|
||||
autoload -Uz compinit
|
||||
if [[ $ZSH_DISABLE_COMPFIX == 'true' ]]; then
|
||||
compinit -u -C
|
||||
else
|
||||
compinit
|
||||
fi
|
||||
fi
|
||||
autoload -U bashcompinit
|
||||
bashcompinit
|
||||
source "${SDKMAN_DIR}/contrib/completion/bash/sdk"
|
||||
__sdkman_echo_debug "ZSH completion script loaded..."
|
||||
elif [[ "$bash_shell" == 'true' ]]; then
|
||||
source "${SDKMAN_DIR}/contrib/completion/bash/sdk"
|
||||
__sdkman_echo_debug "Bash completion script loaded..."
|
||||
else
|
||||
__sdkman_echo_debug "No completion scripts found for $SHELL"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$sdkman_auto_env" == "true" ]]; then
|
||||
if [[ "$zsh_shell" == "true" ]]; then
|
||||
function sdkman_auto_env() {
|
||||
if [[ -n $SDKMAN_ENV ]] && [[ ! $PWD =~ ^$SDKMAN_ENV ]]; then
|
||||
sdk env clear
|
||||
fi
|
||||
if [[ -f .sdkmanrc ]]; then
|
||||
sdk env
|
||||
fi
|
||||
}
|
||||
|
||||
chpwd_functions+=(sdkman_auto_env)
|
||||
else
|
||||
function sdkman_auto_env() {
|
||||
if [[ -n $SDKMAN_ENV ]] && [[ ! $PWD =~ ^$SDKMAN_ENV ]]; then
|
||||
sdk env clear
|
||||
fi
|
||||
if [[ "$SDKMAN_OLD_PWD" != "$PWD" ]] && [[ -f ".sdkmanrc" ]]; then
|
||||
sdk env
|
||||
fi
|
||||
|
||||
:
|
||||
}
|
||||
|
||||
trimmed_prompt_command="${PROMPT_COMMAND%"${PROMPT_COMMAND##*[![:space:]]}"}"
|
||||
[[ -z "$trimmed_prompt_command" ]] && PROMPT_COMMAND="sdkman_auto_env" || PROMPT_COMMAND="${trimmed_prompt_command%\;};sdkman_auto_env"
|
||||
fi
|
||||
|
||||
sdkman_auto_env
|
||||
fi
|
||||
42
.config/fish/functions/sdk.fish
Normal file
42
.config/fish/functions/sdk.fish
Normal file
@ -0,0 +1,42 @@
|
||||
# Wrapper function for SDKMAN!
|
||||
|
||||
# Copyright (c) 2018-2023 Raphael Reitzig
|
||||
# MIT License (MIT)
|
||||
# https://github.com/reitzig/sdkman-for-fish
|
||||
|
||||
function sdk -d "Manage SDKs"
|
||||
# Guard: SDKMAN! needs to be installed
|
||||
if not test -f "$__fish_sdkman_init"
|
||||
# Propose to install SDKMAN!
|
||||
|
||||
function read_confirm
|
||||
while true
|
||||
read -l -P "$argv[1] [y/N] " confirm
|
||||
|
||||
switch $confirm
|
||||
case Y y
|
||||
return 0
|
||||
case '' N n
|
||||
return 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if read_confirm "You don't seem to have SDKMAN! installed. Install now?"
|
||||
if not which curl > /dev/null
|
||||
echo "curl required"
|
||||
return 1
|
||||
end
|
||||
if not which bash > /dev/null
|
||||
echo "bash required"
|
||||
return 1
|
||||
end
|
||||
|
||||
curl -s "https://get.sdkman.io" | bash | sed '/All done!/q'
|
||||
echo "Please open a new terminal/shell to load SDKMAN!"
|
||||
end
|
||||
else
|
||||
# Declare the _actual_ sdk command for fish
|
||||
__fish_sdkman_run_in_bash "source \"$__fish_sdkman_noexport_init\" && sdk $argv"
|
||||
end
|
||||
end
|
||||
@ -20,6 +20,9 @@
|
||||
"mini.surround": { "branch": "main", "commit": "aa5e245829dd12d8ff0c96ef11da28681d6049aa" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "1cb30b1bafe5a63a5c6ac20dc39f83487df38855" },
|
||||
"nvim-popcorn": { "branch": "master", "commit": "c8c64fdf9297a6e0fbfb6908dca590c6508e5e4c" },
|
||||
"nvim-spinetta": { "branch": "master", "commit": "f38af0e403b3991de0e07dc05c49266ea2134ec9" },
|
||||
"nvim-springtime": { "branch": "master", "commit": "598c472ad60bee6ae35bf1723e98ddf685a0cfdc" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
|
||||
|
||||
@ -3,6 +3,8 @@ vim.lsp.enable('clangd')
|
||||
vim.lsp.enable('pyright')
|
||||
vim.lsp.enable('lua_ls')
|
||||
vim.lsp.enable('jdtls')
|
||||
vim.lsp.enable('cmake')
|
||||
vim.lsp.enable('fish_lsp')
|
||||
|
||||
-- Virtual text
|
||||
vim.diagnostic.config({
|
||||
|
||||
@ -6,7 +6,7 @@ return {
|
||||
{
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
opts = {
|
||||
ensure_installed = { "lua_ls", "clangd","pyright", "jdtls"}
|
||||
ensure_installed = { "lua_ls", "clangd","pyright", "jdtls", "cmake", "fish_lsp"}
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -53,13 +53,21 @@ return {
|
||||
require("lspconfig").lua_ls.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
|
||||
require("lspconfig").clangd.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
require("lspconfig").pyright.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
require("lspconfig").cmake.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
require("lspconfig").jdtls.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
require("lspconfig").fish_lsp.setup({
|
||||
capabilities = capabilities
|
||||
})
|
||||
|
||||
end
|
||||
}
|
||||
|
||||
@ -1,5 +1,11 @@
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
||||
set-option -sa terminal-features ',xterm-256color:RGB'
|
||||
|
||||
set-option -ga terminal-features ",xterm-256color:usstyle"
|
||||
|
||||
# Set window starting
|
||||
set -g base-index 1
|
||||
|
||||
# Plugins
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
"modules-left":["river/tags"],
|
||||
"modules-center": ["river/window"],
|
||||
"modules-right":["mpd","wireplumber","cpu","temperature","memory","disk","network","battery","tray","clock"],
|
||||
"modules-right":["wireplumber","cpu","temperature","memory","disk","network","battery","tray","clock"],
|
||||
|
||||
// Left modules
|
||||
"river/tags": {
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
/* Elements */
|
||||
#tags,
|
||||
#window,
|
||||
#mpd,
|
||||
#wireplumber,
|
||||
#cpu,
|
||||
#memory,
|
||||
|
||||
@ -46,7 +46,9 @@ rules = [
|
||||
{ name = "*.zip", use = ["extractZip"]},
|
||||
{ name = "*.gz", use = ["extractTar"]},
|
||||
{ name = "*.png", use = ["setBackground"]},
|
||||
{ name = "*.gif", use = ["setBackground"]},
|
||||
{ name = "*.jpg", use = ["setBackground"]},
|
||||
{ name = "*.jpeg", use = ["setBackground"]},
|
||||
{ name = "*.webp", use = ["setBackground"]},
|
||||
{ name = "*.pdf", use = ["firefox"]}
|
||||
]
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@ -15,3 +15,12 @@
|
||||
.config/HTTPie/
|
||||
.config/nyxt/
|
||||
.config/Meltytech/Shotcut.conf
|
||||
.config/QtProject*
|
||||
.config/filezilla
|
||||
.config/MusicBrainz
|
||||
.config/nheko
|
||||
.config/qt6ct
|
||||
.config/ncmpcpp
|
||||
.config/mopidy
|
||||
.config/clangd
|
||||
.config/CrossCode
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user