trimmed some stuff and reorganized the dotfiles
This commit is contained in:
parent
3f5e822fb3
commit
5024639019
28 changed files with 375 additions and 174 deletions
11
.gitmodules
vendored
11
.gitmodules
vendored
|
@ -1,5 +1,5 @@
|
||||||
[submodule "dotbot"]
|
[submodule "dotbot"]
|
||||||
path = dotbot
|
path = lib/dotbot
|
||||||
url = https://github.com/anishathalye/dotbot
|
url = https://github.com/anishathalye/dotbot
|
||||||
[submodule "lib/highlighting"]
|
[submodule "lib/highlighting"]
|
||||||
path = lib/highlighting
|
path = lib/highlighting
|
||||||
|
@ -13,15 +13,6 @@
|
||||||
[submodule "lib/ohmyzsh"]
|
[submodule "lib/ohmyzsh"]
|
||||||
path = lib/ohmyzsh
|
path = lib/ohmyzsh
|
||||||
url = https://github.com/robbyrussell/oh-my-zsh
|
url = https://github.com/robbyrussell/oh-my-zsh
|
||||||
[submodule "lib/k"]
|
|
||||||
path = lib/k
|
|
||||||
url = https://github.com/rimraf/k
|
|
||||||
[submodule "lib/fzf"]
|
[submodule "lib/fzf"]
|
||||||
path = lib/fzf
|
path = lib/fzf
|
||||||
url = https://github.com/junegunn/fzf.git
|
url = https://github.com/junegunn/fzf.git
|
||||||
[submodule "lib/util"]
|
|
||||||
path = lib/util
|
|
||||||
url = https://github.com/skx/sysadmin-util
|
|
||||||
[submodule "lib/dasht"]
|
|
||||||
path = lib/dasht
|
|
||||||
url = https://github.com/sunaku/dasht
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
eeleater, 22.02.2017, Cleaned up a bit
|
|
||||||
|
|
||||||
eeleater, 06.10.2015, Stuff (look at commits)
|
|
||||||
|
|
||||||
eeleater, 22.09.2015, removed Ansible Completion (again...)
|
|
||||||
|
|
||||||
eeleater, 22.09.2015, up to now:
|
|
||||||
- Stuff
|
|
|
@ -1 +0,0 @@
|
||||||
Me
|
|
9
LICENSE
9
LICENSE
|
@ -1,9 +0,0 @@
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright © 2015 eeleater
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
318
bin/revolver
Normal file
318
bin/revolver
Normal file
|
@ -0,0 +1,318 @@
|
||||||
|
#!/usr/bin/env zsh
|
||||||
|
|
||||||
|
local -A _revolver_spinners
|
||||||
|
_revolver_spinners=(
|
||||||
|
'dots' '0.08 ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏'
|
||||||
|
'dots2' '0.08 ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷'
|
||||||
|
'dots3' '0.08 ⠋ ⠙ ⠚ ⠞ ⠖ ⠦ ⠴ ⠲ ⠳ ⠓'
|
||||||
|
'dots4' '0.08 ⠄ ⠆ ⠇ ⠋ ⠙ ⠸ ⠰ ⠠ ⠰ ⠸ ⠙ ⠋ ⠇ ⠆'
|
||||||
|
'dots5' '0.08 ⠋ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋'
|
||||||
|
'dots6' '0.08 ⠁ ⠉ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠤ ⠄ ⠄ ⠤ ⠴ ⠲ ⠒ ⠂ ⠂ ⠒ ⠚ ⠙ ⠉ ⠁'
|
||||||
|
'dots7' '0.08 ⠈ ⠉ ⠋ ⠓ ⠒ ⠐ ⠐ ⠒ ⠖ ⠦ ⠤ ⠠ ⠠ ⠤ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋ ⠉ ⠈'
|
||||||
|
'dots8' '0.08 ⠁ ⠁ ⠉ ⠙ ⠚ ⠒ ⠂ ⠂ ⠒ ⠲ ⠴ ⠤ ⠄ ⠄ ⠤ ⠠ ⠠ ⠤ ⠦ ⠖ ⠒ ⠐ ⠐ ⠒ ⠓ ⠋ ⠉ ⠈ ⠈'
|
||||||
|
'dots9' '0.08 ⢹ ⢺ ⢼ ⣸ ⣇ ⡧ ⡗ ⡏'
|
||||||
|
'dots10' '0.08 ⢄ ⢂ ⢁ ⡁ ⡈ ⡐ ⡠'
|
||||||
|
'dots11' '0.1 ⠁ ⠂ ⠄ ⡀ ⢀ ⠠ ⠐ ⠈'
|
||||||
|
'dots12' '0.08 "⢀⠀" "⡀⠀" "⠄⠀" "⢂⠀" "⡂⠀" "⠅⠀" "⢃⠀" "⡃⠀" "⠍⠀" "⢋⠀" "⡋⠀" "⠍⠁" "⢋⠁" "⡋⠁" "⠍⠉" "⠋⠉" "⠋⠉" "⠉⠙" "⠉⠙" "⠉⠩" "⠈⢙" "⠈⡙" "⢈⠩" "⡀⢙" "⠄⡙" "⢂⠩" "⡂⢘" "⠅⡘" "⢃⠨" "⡃⢐" "⠍⡐" "⢋⠠" "⡋⢀" "⠍⡁" "⢋⠁" "⡋⠁" "⠍⠉" "⠋⠉" "⠋⠉" "⠉⠙" "⠉⠙" "⠉⠩" "⠈⢙" "⠈⡙" "⠈⠩" "⠀⢙" "⠀⡙" "⠀⠩" "⠀⢘" "⠀⡘" "⠀⠨" "⠀⢐" "⠀⡐" "⠀⠠" "⠀⢀" "⠀⡀"'
|
||||||
|
'line' '0.13 - \\ | /'
|
||||||
|
'line2' '0.1 ⠂ - – — – -'
|
||||||
|
'pipe' '0.1 ┤ ┘ ┴ └ ├ ┌ ┬ ┐'
|
||||||
|
'simpleDots' '0.4 ". " ".. " "..." " "'
|
||||||
|
'simpleDotsScrolling' '0.2 ". " ".. " "..." " .." " ." " "'
|
||||||
|
'star' '0.07 ✶ ✸ ✹ ✺ ✹ ✷'
|
||||||
|
'star2' '0.08 + x *'
|
||||||
|
'flip' "0.07 _ _ _ - \` \` ' ´ - _ _ _"
|
||||||
|
'hamburger' '0.1 ☱ ☲ ☴'
|
||||||
|
'growVertical' '0.12 ▁ ▃ ▄ ▅ ▆ ▇ ▆ ▅ ▄ ▃'
|
||||||
|
'growHorizontal' '0.12 ▏ ▎ ▍ ▌ ▋ ▊ ▉ ▊ ▋ ▌ ▍ ▎'
|
||||||
|
'balloon' '0.14 " " "." "o" "O" "@" "*" " "'
|
||||||
|
'balloon2' '0.12 . o O ° O o .'
|
||||||
|
'noise' '▓ ▒ ░'
|
||||||
|
'bounce' '0.1 ⠁ ⠂ ⠄ ⠂'
|
||||||
|
'boxBounce' '0.12 ▖ ▘ ▝ ▗'
|
||||||
|
'boxBounce2' '0.1 ▌ ▀ ▐ ▄'
|
||||||
|
'triangle' '0.05 ◢ ◣ ◤ ◥'
|
||||||
|
'arc' '0.1 ◜ ◠ ◝ ◞ ◡ ◟'
|
||||||
|
'circle' '0.12 ◡ ⊙ ◠'
|
||||||
|
'squareCorners' '0.18 ◰ ◳ ◲ ◱'
|
||||||
|
'circleQuarters' '0.12 ◴ ◷ ◶ ◵'
|
||||||
|
'circleHalves' '0.05 ◐ ◓ ◑ ◒'
|
||||||
|
'squish' '0.1 ╫ ╪'
|
||||||
|
'toggle' '0.25 ⊶ ⊷'
|
||||||
|
'toggle2' '0.08 ▫ ▪'
|
||||||
|
'toggle3' '0.12 □ ■'
|
||||||
|
'toggle4' '0.1 ■ □ ▪ ▫'
|
||||||
|
'toggle5' '0.1 ▮ ▯'
|
||||||
|
'toggle6' '0.3 ဝ ၀'
|
||||||
|
'toggle7' '0.08 ⦾ ⦿'
|
||||||
|
'toggle8' '0.1 ◍ ◌'
|
||||||
|
'toggle9' '0.1 ◉ ◎'
|
||||||
|
'toggle10' '0.1 ㊂ ㊀ ㊁'
|
||||||
|
'toggle11' '0.05 ⧇ ⧆'
|
||||||
|
'toggle12' '0.12 ☗ ☖'
|
||||||
|
'toggle13' '0.08 = * -'
|
||||||
|
'arrow' '0.1 ← ↖ ↑ ↗ → ↘ ↓ ↙'
|
||||||
|
'arrow2' '0.12 ▹▹▹▹▹ ▸▹▹▹▹ ▹▸▹▹▹ ▹▹▸▹▹ ▹▹▹▸▹ ▹▹▹▹▸'
|
||||||
|
'bouncingBar' '0.08 "[ ]" "[ =]" "[ ==]" "[ ===]" "[====]" "[=== ]" "[== ]" "[= ]"'
|
||||||
|
'bouncingBall' '0.08 "( ● )" "( ● )" "( ● )" "( ● )" "( ●)" "( ● )" "( ● )" "( ● )" "( ● )" "(● )"'
|
||||||
|
'pong' '0.08 "▐⠂ ▌" "▐⠈ ▌" "▐ ⠂ ▌" "▐ ⠠ ▌" "▐ ⡀ ▌" "▐ ⠠ ▌" "▐ ⠂ ▌" "▐ ⠈ ▌" "▐ ⠂ ▌" "▐ ⠠ ▌" "▐ ⡀ ▌" "▐ ⠠ ▌" "▐ ⠂ ▌" "▐ ⠈ ▌" "▐ ⠂▌" "▐ ⠠▌" "▐ ⡀▌" "▐ ⠠ ▌" "▐ ⠂ ▌" "▐ ⠈ ▌" "▐ ⠂ ▌" "▐ ⠠ ▌" "▐ ⡀ ▌" "▐ ⠠ ▌" "▐ ⠂ ▌" "▐ ⠈ ▌" "▐ ⠂ ▌" "▐ ⠠ ▌" "▐ ⡀ ▌" "▐⠠ ▌"'
|
||||||
|
'shark' '0.12 "▐|\\____________▌" "▐_|\\___________▌" "▐__|\\__________▌" "▐___|\\_________▌" "▐____|\\________▌" "▐_____|\\_______▌" "▐______|\\______▌" "▐_______|\\_____▌" "▐________|\\____▌" "▐_________|\\___▌" "▐__________|\\__▌" "▐___________|\\_▌" "▐____________|\\▌" "▐____________/|▌" "▐___________/|_▌" "▐__________/|__▌" "▐_________/|___▌" "▐________/|____▌" "▐_______/|_____▌" "▐______/|______▌" "▐_____/|_______▌" "▐____/|________▌" "▐___/|_________▌" "▐__/|__________▌" "▐_/|___________▌" "▐/|____________▌"'
|
||||||
|
)
|
||||||
|
|
||||||
|
###
|
||||||
|
# Output usage information and exit
|
||||||
|
###
|
||||||
|
function _revolver_usage() {
|
||||||
|
echo "\033[0;33mUsage:\033[0;m"
|
||||||
|
echo " revolver [options] <command> <message>"
|
||||||
|
echo
|
||||||
|
echo "\033[0;33mOptions:\033[0;m"
|
||||||
|
echo " -h, --help Output help text and exit"
|
||||||
|
echo " -v, --version Output version information and exit"
|
||||||
|
echo " -s, --style Set the spinner style"
|
||||||
|
echo
|
||||||
|
echo "\033[0;33mCommands:\033[0;m"
|
||||||
|
echo " start <message> Start the spinner"
|
||||||
|
echo " update <message> Update the message"
|
||||||
|
echo " stop Stop the spinner"
|
||||||
|
echo " demo Display an demo of each style"
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# The main revolver process, which contains the loop
|
||||||
|
###
|
||||||
|
function _revolver_process() {
|
||||||
|
local dir statefile state msg pid="$1" spinner_index=0
|
||||||
|
|
||||||
|
# Find the directory and load the statefile
|
||||||
|
dir=${REVOLVER_DIR:-"${ZDOTDIR:-$HOME}/.revolver"}
|
||||||
|
statefile="$dir/$pid"
|
||||||
|
|
||||||
|
# The frames that, when animated, will make up
|
||||||
|
# our spinning indicator
|
||||||
|
frames=(${(@z)_revolver_spinners[$style]})
|
||||||
|
interval=${(@z)frames[1]}
|
||||||
|
shift frames
|
||||||
|
|
||||||
|
# Create a never-ending loop
|
||||||
|
while [[ 1 -eq 1 ]]; do
|
||||||
|
# If the statefile has been removed, exit the script
|
||||||
|
# to prevent it from being orphaned
|
||||||
|
if [[ ! -f $statefile ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check for the existence of the parent process
|
||||||
|
$(kill -s 0 $pid 2&>/dev/null)
|
||||||
|
|
||||||
|
# If process doesn't exist, exit the script
|
||||||
|
# to prevent it from being orphaned
|
||||||
|
if [[ $? -ne 0 ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Load the current state, and parse it to get
|
||||||
|
# the message to be displayed
|
||||||
|
state=($(cat $statefile))
|
||||||
|
|
||||||
|
msg="${(@)state:1}"
|
||||||
|
|
||||||
|
# Output the current spinner frame, and add a
|
||||||
|
# slight delay before the next one
|
||||||
|
_revolver_spin
|
||||||
|
sleep ${interval:-"0.1"}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Output the spinner itself, along with a message
|
||||||
|
###
|
||||||
|
function _revolver_spin() {
|
||||||
|
local dir statefile state pid frame
|
||||||
|
|
||||||
|
# ZSH arrays start at 1, so we need to bump the index if it's 0
|
||||||
|
if [[ $spinner_index -eq 0 ]]; then
|
||||||
|
spinner_index+=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Calculate the screen width
|
||||||
|
lim=$(tput cols)
|
||||||
|
|
||||||
|
# Clear the line and move the cursor to the start
|
||||||
|
printf ' %.0s' {1..$lim}
|
||||||
|
echo -n "\r"
|
||||||
|
|
||||||
|
# Echo the current frame and message, and overwrite
|
||||||
|
# the rest of the line with white space
|
||||||
|
msg="\033[0;38;5;242m${msg}\033[0;m"
|
||||||
|
frame="${${(@z)frames}[$spinner_index]//\"}"
|
||||||
|
printf '%*.*b' ${#msg} $lim "$frame $msg$(printf '%0.1s' " "{1..$lim})"
|
||||||
|
|
||||||
|
# Return to the beginning of the line
|
||||||
|
echo -n "\r"
|
||||||
|
|
||||||
|
# Set the spinner index to the next frame
|
||||||
|
spinner_index=$(( $(( $spinner_index + 1 )) % $(( ${#frames} + 1 )) ))
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Stop the current spinner process
|
||||||
|
###
|
||||||
|
function _revolver_stop() {
|
||||||
|
local dir statefile state pid
|
||||||
|
|
||||||
|
# Find the directory and load the statefile
|
||||||
|
dir=${REVOLVER_DIR:-"${ZDOTDIR:-$HOME}/.revolver"}
|
||||||
|
statefile="$dir/$PPID"
|
||||||
|
|
||||||
|
# If the statefile does not exist, raise an error.
|
||||||
|
# The spinner process itself performs the same check
|
||||||
|
# and kills itself, so it should never be orphaned
|
||||||
|
if [[ ! -f $statefile ]]; then
|
||||||
|
echo '\033[0;31mRevolver process could not be found\033[0;m'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the current state, and parse it to find the PID
|
||||||
|
# of the spinner process
|
||||||
|
state=($(cat $statefile))
|
||||||
|
pid="$state[1]"
|
||||||
|
|
||||||
|
# Clear the line and move the cursor to the start
|
||||||
|
printf ' %.0s' {1..$(tput cols)}
|
||||||
|
echo -n "\r"
|
||||||
|
|
||||||
|
# If a PID has been found, kill the process
|
||||||
|
[[ ! -z $pid ]] && kill "$pid" > /dev/null
|
||||||
|
unset pid
|
||||||
|
|
||||||
|
# Remove the statefile
|
||||||
|
rm $statefile
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Update the message being displayed
|
||||||
|
function _revolver_update() {
|
||||||
|
local dir statefile state pid msg="$1"
|
||||||
|
|
||||||
|
# Find the directory and load the statefile
|
||||||
|
dir=${REVOLVER_DIR:-"${ZDOTDIR:-$HOME}/.revolver"}
|
||||||
|
statefile="$dir/$PPID"
|
||||||
|
|
||||||
|
# If the statefile does not exist, raise an error.
|
||||||
|
# The spinner process itself performs the same check
|
||||||
|
# and kills itself, so it should never be orphaned
|
||||||
|
if [[ ! -f $statefile ]]; then
|
||||||
|
echo '\033[0;31mRevolver process could not be found\033[0;m'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Get the current state, and parse it to find the PID
|
||||||
|
# of the spinner process
|
||||||
|
state=($(cat $statefile))
|
||||||
|
pid="$state[1]"
|
||||||
|
|
||||||
|
# Clear the line and move the cursor to the start
|
||||||
|
printf ' %.0s' {1..$(tput cols)}
|
||||||
|
echo -n "\r"
|
||||||
|
|
||||||
|
# Echo the new message to the statefile, to be
|
||||||
|
# picked up by the spinner process
|
||||||
|
echo "$pid $msg" >! $statefile
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Create a new spinner with the specified message
|
||||||
|
###
|
||||||
|
function _revolver_start() {
|
||||||
|
local dir statefile msg="$1"
|
||||||
|
|
||||||
|
# Find the directory and create it if it doesn't exist
|
||||||
|
dir=${REVOLVER_DIR:-"${ZDOTDIR:-$HOME}/.revolver"}
|
||||||
|
if [[ ! -d $dir ]]; then
|
||||||
|
mkdir -p $dir
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Create the filename for the statefile
|
||||||
|
statefile="$dir/$PPID"
|
||||||
|
|
||||||
|
touch $statefile
|
||||||
|
if [[ ! -f $statefile ]]; then
|
||||||
|
echo '\033[0;31mRevolver process could not create state file\033[0;m'
|
||||||
|
echo "Check that the directory $dir is writable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start the spinner process in the background
|
||||||
|
_revolver_process $PPID &!
|
||||||
|
|
||||||
|
# Save the current state to the statefile
|
||||||
|
echo "$! $msg" >! $statefile
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Demonstrate each of the included spinner styles
|
||||||
|
###
|
||||||
|
function _revolver_demo() {
|
||||||
|
for style in "${(@k)_revolver_spinners[@]}"; do
|
||||||
|
revolver --style $style start $style
|
||||||
|
sleep 2
|
||||||
|
revolver stop
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
###
|
||||||
|
# Handle command input
|
||||||
|
###
|
||||||
|
function _revolver() {
|
||||||
|
# Get the context from the first parameter
|
||||||
|
local help version style ctx="$1"
|
||||||
|
|
||||||
|
# Parse CLI options
|
||||||
|
zparseopts -D \
|
||||||
|
h=help -help=help \
|
||||||
|
v=version -version=version \
|
||||||
|
s:=style -style:=style
|
||||||
|
|
||||||
|
# Output usage information and exit
|
||||||
|
if [[ -n $help ]]; then
|
||||||
|
_revolver_usage
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Output version information and exit
|
||||||
|
if [[ -n $version ]]; then
|
||||||
|
echo '0.2.0'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $style ]]; then
|
||||||
|
style='dots'
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -n $style ]]; then
|
||||||
|
shift style
|
||||||
|
ctx="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z $_revolver_spinners[$style] ]]; then
|
||||||
|
echo $(color red "Spinner '$style' is not recognised")
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $ctx in
|
||||||
|
start|update|stop|demo)
|
||||||
|
# Check if a valid command is passed,
|
||||||
|
# and if so, run it
|
||||||
|
_revolver_${ctx} "${(@)@:2}"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# If the context is not recognised,
|
||||||
|
# throw an error and exit
|
||||||
|
echo "Command $ctx is not recognised"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
_revolver "$@"
|
|
@ -4,6 +4,6 @@
|
||||||
~/.fzf: lib/fzf
|
~/.fzf: lib/fzf
|
||||||
~/.nano: lib/nano/syntax
|
~/.nano: lib/nano/syntax
|
||||||
~/.nanorc: lib/nano/syntax/nanorc
|
~/.nanorc: lib/nano/syntax/nanorc
|
||||||
~/.gitconfig: git/gitconfig
|
~/.gitconfig: config/git/gitconfig
|
||||||
~/.zshrc: zsh/zshrc
|
~/.zshrc: config/zsh/zshrc
|
||||||
~/.ssh/config: sshconfig
|
~/.ssh/config: config/ssh/sshconfig
|
33
config/zsh/zshrc
Normal file
33
config/zsh/zshrc
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# Exports
|
||||||
|
export DOTFILES="${HOME}/dotfiles"
|
||||||
|
export DOTFILES_CONFIG="${DOTFILES}/config"
|
||||||
|
export LIB="${DOTFILES}/lib"
|
||||||
|
export ZSH="${LIB}/ohmyzsh"
|
||||||
|
export PATH="${HOME}/dotfiles/bin:/opt/android-sdk/build-tools/26.0.0/:${PATH}"
|
||||||
|
export EDITOR='nano'
|
||||||
|
export TERM=linux
|
||||||
|
fpath=(${LIB}/completions/src $fpath)
|
||||||
|
|
||||||
|
# Settings
|
||||||
|
ZSH_THEME="mortalscumbag"
|
||||||
|
DISABLE_AUTO_UPDATE="true"
|
||||||
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
||||||
|
|
||||||
|
# Plugins
|
||||||
|
plugins=(git vagrant docker systemd tmux command-not-found extract)
|
||||||
|
case $(uname -n) in
|
||||||
|
"megumi") plugins+=(archlinux) ;;
|
||||||
|
"sayaka") plugins+=(archlinux) ;;
|
||||||
|
"git") plugins+=(debian) ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Fix MobaXterm Home/End key with ZSH
|
||||||
|
bindkey '^[[H' beginning-of-line
|
||||||
|
bindkey '^[[F' end-of-line
|
||||||
|
|
||||||
|
# Source the needed parts
|
||||||
|
source ${ZSH}/oh-my-zsh.sh # Oh My ZSH
|
||||||
|
source ${LIB}/highlighting/zsh-syntax-highlighting.zsh # Syntax Highlighting
|
||||||
|
for file in ${DOTFILES_CONFIG}/zsh/zshrc.d/*.zsh; do source $file; done # Other Files
|
||||||
|
source ${HOME}/.fzf.zsh # FZF
|
||||||
|
eval `dircolors ${DOTFILES_CONFIG}/dir/dircolors` # Dircolors
|
19
config/zsh/zshrc.d/aliases.zsh
Normal file
19
config/zsh/zshrc.d/aliases.zsh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Interactive
|
||||||
|
alias rm='rm -i'
|
||||||
|
alias cp='cp -i'
|
||||||
|
alias mv='mv -i'
|
||||||
|
|
||||||
|
# Listing
|
||||||
|
alias l='ls -lh' #size,show type,human readable
|
||||||
|
alias la='ls -lAh' #long list,show almost all,show type,human readable
|
||||||
|
alias lr='ls -tRh' #sorted by date,recursive,show type,human readable
|
||||||
|
alias lt='ls -lth' #long list,sorted by date,show type,human readable
|
||||||
|
|
||||||
|
# The Fuck
|
||||||
|
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
|
||||||
|
|
||||||
|
# PClear
|
||||||
|
clearall () { clear; printf '\033[3J' }
|
||||||
|
|
||||||
|
# Make Dir and enter it
|
||||||
|
mkcd() { mkdir $1 &>/dev/null; [ -e $1 ] && cd $1 }
|
8
install
8
install
|
@ -1,14 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
CONFIG="install.conf.yaml"
|
|
||||||
DOTBOT_DIR="dotbot"
|
|
||||||
|
|
||||||
DOTBOT_BIN="bin/dotbot"
|
|
||||||
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
cd "${BASEDIR}"
|
cd "${BASEDIR}"
|
||||||
git submodule update --init --recursive "${DOTBOT_DIR}"
|
git submodule update --init --recursive "${DOTBOT_DIR}"
|
||||||
|
|
||||||
"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" -c "${CONFIG}" "${@}"
|
"${BASEDIR}/lib/dotbot/bin/dotbot" -d "${BASEDIR}" -c config/dotbot/dotbot.yaml "${@}"
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit 7ea915837f7ca3227fe6ca8e8420e1ec2ae638e0
|
|
1
lib/k
1
lib/k
|
@ -1 +0,0 @@
|
||||||
Subproject commit 1fa7c039d40684d39cb225599bda4a86a62e765d
|
|
1
lib/util
1
lib/util
|
@ -1 +0,0 @@
|
||||||
Subproject commit 2d69cda49b1f15b3026f2de0b7178f63b37b8b33
|
|
|
@ -1,28 +0,0 @@
|
||||||
# CD
|
|
||||||
alias ..='cd ../'
|
|
||||||
alias ...='cd ../../'
|
|
||||||
alias ....='cd ../../../'
|
|
||||||
alias .....='cd ../../../../'
|
|
||||||
|
|
||||||
# Go up [n] directories
|
|
||||||
function up()
|
|
||||||
{
|
|
||||||
local cdir="$(pwd)"
|
|
||||||
if [[ "${1}" == "" ]]; then
|
|
||||||
cdir="$(dirname "${cdir}")"
|
|
||||||
elif ! [[ "${1}" =~ ^[0-9]+$ ]]; then
|
|
||||||
echo "Error: argument must be a number"
|
|
||||||
elif ! [[ "${1}" -gt "0" ]]; then
|
|
||||||
echo "Error: argument must be positive"
|
|
||||||
else
|
|
||||||
for i in {1..${1}}; do
|
|
||||||
local ncdir="$(dirname "${cdir}")"
|
|
||||||
if [[ "${cdir}" == "${ncdir}" ]]; then
|
|
||||||
break
|
|
||||||
else
|
|
||||||
cdir="${ncdir}"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
cd "${cdir}"
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Du/Find
|
|
||||||
alias dud='du -d 1 -h'
|
|
||||||
alias duf='du -sh *'
|
|
||||||
alias fd='find . -type d -name'
|
|
||||||
alias ff='find . -type f -name'
|
|
|
@ -1,4 +0,0 @@
|
||||||
# Grep
|
|
||||||
alias grep='grep --color'
|
|
||||||
alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS}'
|
|
||||||
alias psg='ps aux | grep -v grep | grep'
|
|
|
@ -1,5 +0,0 @@
|
||||||
# Interactive
|
|
||||||
alias rm='rm -i'
|
|
||||||
alias cp='cp -i'
|
|
||||||
alias mv='mv -i'
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Listing
|
|
||||||
alias l='ls -lFh' #size,show type,human readable
|
|
||||||
alias la='ls -lAFh' #long list,show almost all,show type,human readable
|
|
||||||
alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable
|
|
||||||
alias lt='ls -ltFh' #long list,sorted by date,show type,human readable
|
|
||||||
alias ll='ls -l' #long list
|
|
||||||
alias ldot='ls -ld .*'
|
|
||||||
alias lS='ls -1FSsh'
|
|
||||||
alias lart='ls -1Fcart'
|
|
||||||
alias lrt='ls -1Fcrt'
|
|
|
@ -1,20 +0,0 @@
|
||||||
# Command Line Foo
|
|
||||||
alias clf='clf --color'
|
|
||||||
|
|
||||||
# The Fuck
|
|
||||||
TF_ALIAS=fuck alias fuck='eval $(thefuck $(fc -ln -1 | tail -n 1)); fc -R'
|
|
||||||
|
|
||||||
# PClear
|
|
||||||
pclear () {
|
|
||||||
clear
|
|
||||||
printf '\033[3J'
|
|
||||||
}
|
|
||||||
|
|
||||||
# Termbin
|
|
||||||
alias tb='nc termbin.com 9999'
|
|
||||||
|
|
||||||
# Make Dir and enter it
|
|
||||||
mkcd() {
|
|
||||||
mkdir $1 >/dev/null 2>&1
|
|
||||||
[ -e $1 ] && cd $1
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Stuff
|
|
||||||
alias h='history'
|
|
||||||
alias hgrep="fc -El 0 | grep"
|
|
||||||
alias j='jobs'
|
|
||||||
alias p='ps -f'
|
|
||||||
alias sortnr='sort -n -r'
|
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
# Tail
|
|
||||||
alias t='tail -f'
|
|
52
zsh/zshrc
52
zsh/zshrc
|
@ -1,52 +0,0 @@
|
||||||
# Exports
|
|
||||||
export ZSH=${HOME}/dotfiles/lib/ohmyzsh
|
|
||||||
ZSH_THEME="mortalscumbag"
|
|
||||||
DISABLE_AUTO_UPDATE="true"
|
|
||||||
export GOPATH=${HOME}/go
|
|
||||||
export PATH="${GOPATH}/bin:${HOME}/.gem/ruby/2.3.0/bin:${HOME}/dotfiles/lib/util:${HOME}/dotfiles/lib/bin:${HOME}/dotfiles/lib/dasht/bin:${PATH}:/opt/android-sdk/build-tools/26.0.0/"
|
|
||||||
export DASHT_DOCSETS_DIR=$HOME/.local/share/Zeal/Zeal/docsets
|
|
||||||
export EDITOR='nano'
|
|
||||||
export TERM=linux
|
|
||||||
|
|
||||||
# Plugins
|
|
||||||
plugins=(gem bundler git vagrant docker python ansible)
|
|
||||||
plugins+=(systemd systemadmin tmux command-not-found extract)
|
|
||||||
case $(uname -n) in
|
|
||||||
"megumi")
|
|
||||||
plugins+=(archlinux)
|
|
||||||
;;
|
|
||||||
"sayaka")
|
|
||||||
plugins+=(archlinux)
|
|
||||||
;;
|
|
||||||
"git")
|
|
||||||
plugins+=(debian)
|
|
||||||
;;
|
|
||||||
"test")
|
|
||||||
plugins+=(debian)
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# OMZ
|
|
||||||
source ${ZSH}/oh-my-zsh.sh
|
|
||||||
|
|
||||||
# Fix MobaXterm Home/End key with ZSH
|
|
||||||
bindkey '^[[H' beginning-of-line
|
|
||||||
bindkey '^[[F' end-of-line
|
|
||||||
|
|
||||||
# Syntax Highlighting
|
|
||||||
source ${HOME}/dotfiles/lib/highlighting/zsh-syntax-highlighting.zsh
|
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets)
|
|
||||||
|
|
||||||
# Aliases
|
|
||||||
for file in ${HOME}/dotfiles/zsh/aliases.d/*.zsh; do
|
|
||||||
source $file
|
|
||||||
done
|
|
||||||
|
|
||||||
# FZF
|
|
||||||
[ -f ${HOME}/.fzf.zsh ] && source ${HOME}/.fzf.zsh
|
|
||||||
|
|
||||||
# Dircolors
|
|
||||||
eval `dircolors ${HOME}/dotfiles/zsh/dircolors`
|
|
||||||
|
|
||||||
# Completions Path
|
|
||||||
fpath=(${HOME}/dotfiles/lib/completions/src $fpath)
|
|
Loading…
Add table
Reference in a new issue