Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
196004e993
4 changed files with 36 additions and 2 deletions
|
@ -120,7 +120,8 @@ lspconfig.rust_analyzer.setup {
|
|||
enable = true,
|
||||
},
|
||||
},
|
||||
checkOnSave = {
|
||||
checkOnSave = true,
|
||||
check = {
|
||||
command = 'clippy',
|
||||
extraArgs = {
|
||||
"--",
|
||||
|
|
31
zsh/func/bool
Normal file
31
zsh/func/bool
Normal file
|
@ -0,0 +1,31 @@
|
|||
# Eryn Wells <eryn@erynwells.me>
|
||||
# vim: set ft=zsh:
|
||||
|
||||
function bool {
|
||||
if [[ "$1" =~ '^-?[0-9]+$' ]]; then
|
||||
if (( $1 == 0 )); then
|
||||
echo "no"
|
||||
return 1
|
||||
else
|
||||
echo "yes"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
|
||||
local lowercase_value=${(L)1}
|
||||
|
||||
if [[ "$lowercase_value" == "yes" || "$lowercase_value" == "true" ]]; then
|
||||
echo "yes"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$lowercase_value" == "no" || "$lowercase_value" == "false" ]]; then
|
||||
echo "no"
|
||||
return 1
|
||||
fi
|
||||
|
||||
echo "no"
|
||||
return 1
|
||||
}
|
||||
|
||||
bool "$@"
|
|
@ -20,7 +20,8 @@ Arguments
|
|||
---------
|
||||
|
||||
%B-e%b | %B--export%b | %B--no-export%b
|
||||
Export the variable after modification.
|
||||
Export the variable after modification. The default is to export if the
|
||||
variable is modified.
|
||||
|
||||
%B-f%b | %B--force%b
|
||||
Unconditionally add the path, even if it doesn't exist.
|
||||
|
|
1
zshrc
1
zshrc
|
@ -21,6 +21,7 @@ fi
|
|||
|
||||
do_init_functions zsh_init_rc_functions
|
||||
|
||||
autoload -Uz bool
|
||||
autoload -Uz g
|
||||
autoload -Uz nethack
|
||||
autoload -Uz pw
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue