mirror of
https://github.com/m-housh/dotfiles.git
synced 2026-02-14 22:22:40 +00:00
Added termcolors script
This commit is contained in:
@@ -94,7 +94,7 @@ _install_nvim() {
|
|||||||
# link if in link mode
|
# link if in link mode
|
||||||
test "$link" -eq 0 && _link_nvim && exit "$?"
|
test "$link" -eq 0 && _link_nvim && exit "$?"
|
||||||
# else we don't know what to do
|
# else we don't know what to do
|
||||||
echo "Neither link or copy options were set. Use the --help option" >&2
|
echo "Neither link or copy options were set. Use the --help option for usage." >&2
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,14 +104,14 @@ main() {
|
|||||||
_parse_options "$@"
|
_parse_options "$@"
|
||||||
|
|
||||||
# check if remove is called first
|
# check if remove is called first
|
||||||
test $remove -eq 0 && _remove_nvim && exit "$?"
|
test "$remove" -eq 0 && _remove_nvim && exit "$?"
|
||||||
|
|
||||||
# then check if uninstall was called
|
# then check if uninstall was called
|
||||||
test $uninstall -eq 0 && _uninstall_nvim && exit "$?"
|
test "$uninstall" -eq 0 && _uninstall_nvim && exit "$?"
|
||||||
|
|
||||||
# else install the configuration files
|
# else install the configuration files
|
||||||
_install_nvim
|
_install_nvim
|
||||||
echo "Nvim will need to be started for vim plugins to download."
|
echo "Nvim will need to be started and call :PackerSync for plugins to be downloaded." >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
57
scripts/scripts/termcolors
Executable file
57
scripts/scripts/termcolors
Executable file
@@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Prints the terminal theme regular colors (and some other escapes). For
|
||||||
|
# "bright/bold" variation add 1; in front of the number. Useful for
|
||||||
|
# sampling and remembering the escapes when hardcoding them into scripts
|
||||||
|
# for portability. Keep in mind that the color names are those given for
|
||||||
|
# the original color terminal and obviously can vary widely. For color
|
||||||
|
# intensive output consider shortening the names to their first letter
|
||||||
|
# instead and don't forget to wrap them within ${}. Omits (and overrides
|
||||||
|
# any inherited) colors when not interactive/piped.
|
||||||
|
|
||||||
|
black=""
|
||||||
|
red=""
|
||||||
|
green=""
|
||||||
|
yellow=""
|
||||||
|
blue=""
|
||||||
|
magenta=""
|
||||||
|
cyan=""
|
||||||
|
white=""
|
||||||
|
blink=""
|
||||||
|
reset=""
|
||||||
|
|
||||||
|
if test -t 1; then
|
||||||
|
black="\e[30m"
|
||||||
|
red="\e[31m"
|
||||||
|
green="\e[32m"
|
||||||
|
yellow="\e[33m"
|
||||||
|
blue="\e[34m"
|
||||||
|
magenta="\e[35m"
|
||||||
|
cyan="\e[36m"
|
||||||
|
white="\e[37m"
|
||||||
|
blink="\e[5m"
|
||||||
|
reset="\e[0m"
|
||||||
|
fi
|
||||||
|
echo POSIX
|
||||||
|
printf "${black}black=\"\\\e[30m\"
|
||||||
|
${red}red=\"\\\e[31m\"
|
||||||
|
${green}green=\"\\\e[32m\"
|
||||||
|
${yellow}yellow=\"\\\e[33m\"
|
||||||
|
${blue}blue=\"\\\e[34m\"
|
||||||
|
${magenta}magenta=\"\\\e[35m\"
|
||||||
|
${cyan}cyan=\"\\\e[36m\"
|
||||||
|
${white}white=\"\\\e[37m\"
|
||||||
|
reset=\"\\\e[0m\"
|
||||||
|
"
|
||||||
|
echo
|
||||||
|
echo BASH:
|
||||||
|
printf "${black}black=$'\\\e[30m'
|
||||||
|
${red}red=$'\\\e[31m'
|
||||||
|
${green}green=$'\\\e[32m'
|
||||||
|
${yellow}yellow=$'\\\e[33m'
|
||||||
|
${blue}blue=$'\\\e[34m'
|
||||||
|
${magenta}magenta=$'\\\e[35m'
|
||||||
|
${cyan}cyan=$'\\\e[36m'
|
||||||
|
${white}white=$'\\\e[37m'
|
||||||
|
reset=$'\\\e[0m'
|
||||||
|
"
|
||||||
@@ -44,6 +44,16 @@ zle -N down-line-or-beginning-search
|
|||||||
# Colors
|
# Colors
|
||||||
autoload -Uz colors && colors
|
autoload -Uz colors && colors
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------ pager ------------------------------
|
||||||
|
export LESS_TERMCAP_mb="[35m" # magenta
|
||||||
|
export LESS_TERMCAP_md="[33m" # yellow
|
||||||
|
export LESS_TERMCAP_me=""
|
||||||
|
export LESS_TERMCAP_se=""
|
||||||
|
export LESS_TERMCAP_so="[34m" # blue
|
||||||
|
export LESS_TERMCAP_ue=""
|
||||||
|
export LESS_TERMCAP_so="[4m" # underline
|
||||||
|
|
||||||
#------------------------------ path ------------------------------
|
#------------------------------ path ------------------------------
|
||||||
|
|
||||||
path_append() {
|
path_append() {
|
||||||
@@ -168,6 +178,7 @@ alias gcm='git commit -m'
|
|||||||
alias gp='git push'
|
alias gp='git push'
|
||||||
alias gs='git status'
|
alias gs='git status'
|
||||||
alias vi='vim'
|
alias vi='vim'
|
||||||
|
alias nvim='unset VIMINIT && unset MYVIMRC && nvim'
|
||||||
|
|
||||||
#------------------------------ local configs ------------------------------
|
#------------------------------ local configs ------------------------------
|
||||||
_source_if "$ZDOTDIR/.zshrc-local"
|
_source_if "$ZDOTDIR/.zshrc-local"
|
||||||
|
|||||||
Reference in New Issue
Block a user