Update dotfiles to work on osx and linux
This commit is contained in:
parent
a0a08b2a20
commit
3fbf4bfa61
50
.bashrc
50
.bashrc
@ -1,9 +1,8 @@
|
|||||||
# Navigation
|
# Navigation
|
||||||
#alias ls="ls --color=auto"
|
#alias ls="ls --color=auto"
|
||||||
alias ls="exa-0.8.0 --long --header --git --group"
|
alias ls="exa --long --header --git --group"
|
||||||
alias cat="bat-0.10.0 --theme=GitHub"
|
alias cat="bat --theme=GitHub"
|
||||||
alias tree="exa-0.8.0 --tree"
|
alias tree="exa --tree"
|
||||||
alias c="clear"
|
|
||||||
alias ..="cd ..;"
|
alias ..="cd ..;"
|
||||||
alias la="ls -lhA"
|
alias la="ls -lhA"
|
||||||
alias rmr="rm -r"
|
alias rmr="rm -r"
|
||||||
@ -15,7 +14,18 @@ alias rmr="rm -r"
|
|||||||
HISTSIZE=50000
|
HISTSIZE=50000
|
||||||
HISTFILESIZE=50000
|
HISTFILESIZE=50000
|
||||||
HISTCONTROL=ignoredups:ignorespace
|
HISTCONTROL=ignoredups:ignorespace
|
||||||
shopt -s histappend
|
|
||||||
|
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
||||||
|
# History
|
||||||
|
shopt -s histappend
|
||||||
|
|
||||||
|
for filename in ${HOME}/.ssh/*.pub; do
|
||||||
|
keyname="$(basename ${filename} .pub)"
|
||||||
|
eval $(keychain --nogui --eval --quiet ${keyname})
|
||||||
|
done
|
||||||
|
elif [[ "${OSTYPE}" == "darwin"* ]]; then
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
# Applications
|
# Applications
|
||||||
alias tmux="tmux -2"
|
alias tmux="tmux -2"
|
||||||
@ -28,11 +38,6 @@ export GPG_TTY=$(tty)
|
|||||||
# Golang
|
# Golang
|
||||||
export PATH=$PATH:/usr/local/go/bin:${HOME}/go/bin
|
export PATH=$PATH:/usr/local/go/bin:${HOME}/go/bin
|
||||||
|
|
||||||
# enable bash completion in interactive shells
|
|
||||||
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
|
||||||
. /etc/bash_completion
|
|
||||||
fi
|
|
||||||
|
|
||||||
export TERM="xterm-256color"
|
export TERM="xterm-256color"
|
||||||
export EDITOR=$(which vim)
|
export EDITOR=$(which vim)
|
||||||
|
|
||||||
@ -88,6 +93,12 @@ function fn() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# (f)ind (i)n (f)ile
|
||||||
|
# usage: fif "text to search"
|
||||||
|
function fif() {
|
||||||
|
rga $1 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
# Add color shortcuts
|
# Add color shortcuts
|
||||||
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
|
||||||
c_reset=`tput sgr0`
|
c_reset=`tput sgr0`
|
||||||
@ -143,17 +154,16 @@ to_md() {
|
|||||||
pandoc ${1} -t gfm | xclip -selection clipboard
|
pandoc ${1} -t gfm | xclip -selection clipboard
|
||||||
}
|
}
|
||||||
|
|
||||||
# Prompt
|
if [ "$BASH" != "" ]; then
|
||||||
PS1="\n╔ \w\$(git_prompt) \$(kubectl_context)\n╚ \h\$ "
|
# Prompt
|
||||||
|
PS1="\n╔ \w\$(git_prompt) \$(kubectl_context)\n╚ \h\$ "
|
||||||
|
|
||||||
for filename in ${HOME}/.ssh/*.pub; do
|
# enable bash completion in interactive shells
|
||||||
keyname="$(basename ${filename} .pub)"
|
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
|
||||||
eval $(keychain --nogui --eval --quiet ${keyname})
|
. /etc/bash_completion
|
||||||
done
|
fi
|
||||||
|
elif [ "$ZSH_NAME" != "" ]; then
|
||||||
|
|
||||||
# Starship Prompt
|
fi
|
||||||
# NOTE: This negates the above lines for PS1, kubectl_context, and git_prompt
|
|
||||||
eval "$(starship init bash)"
|
|
||||||
|
|
||||||
source /home/tgrosinger/.config/broot/launcher/bash/br
|
|
||||||
source <(navi widget bash)
|
source <(navi widget bash)
|
||||||
|
BIN
bin/bat-0.10.0
BIN
bin/bat-0.10.0
Binary file not shown.
BIN
bin/exa-0.8.0
BIN
bin/exa-0.8.0
Binary file not shown.
BIN
bin/linux/bat-0.13.0
Executable file
BIN
bin/linux/bat-0.13.0
Executable file
Binary file not shown.
BIN
bin/linux/exa-0.9.0
Executable file
BIN
bin/linux/exa-0.9.0
Executable file
Binary file not shown.
BIN
bin/linux/jq-1.6
Normal file
BIN
bin/linux/jq-1.6
Normal file
Binary file not shown.
BIN
bin/linux/navi-2.5.1
Executable file
BIN
bin/linux/navi-2.5.1
Executable file
Binary file not shown.
BIN
bin/osx/bat-0.13.0
Executable file
BIN
bin/osx/bat-0.13.0
Executable file
Binary file not shown.
BIN
bin/osx/exa-0.9.0
Executable file
BIN
bin/osx/exa-0.9.0
Executable file
Binary file not shown.
BIN
bin/osx/jq-1.6
Executable file
BIN
bin/osx/jq-1.6
Executable file
Binary file not shown.
BIN
bin/osx/navi-2.5.1
Executable file
BIN
bin/osx/navi-2.5.1
Executable file
Binary file not shown.
@ -1,90 +0,0 @@
|
|||||||
|
|
||||||
# This configuration file lets you define new commands
|
|
||||||
# or change the shortcut or triggering keys of built-in verbs.
|
|
||||||
# You can change the colors of broot too.
|
|
||||||
#
|
|
||||||
# Configuration documentation is available at https://dystroy.org/broot
|
|
||||||
#
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# user defined verbs:
|
|
||||||
|
|
||||||
# If $EDITOR isn't set on your computer, you should either set it using
|
|
||||||
# something similar to
|
|
||||||
# export EDITOR=/usr/bin/nvim
|
|
||||||
# or just replace it with your editor of choice in the 'execution'
|
|
||||||
# pattern.
|
|
||||||
# Example:
|
|
||||||
# execution = "/usr/bin/nvim {file}"
|
|
||||||
[[verbs]]
|
|
||||||
invocation = "edit"
|
|
||||||
key = "F2"
|
|
||||||
shortcut = "e"
|
|
||||||
execution = "/usr/bin/vim {file}"
|
|
||||||
|
|
||||||
[[verbs]]
|
|
||||||
key = "ctrl-c"
|
|
||||||
execution = ":quit"
|
|
||||||
|
|
||||||
[[verbs]]
|
|
||||||
invocation = "create {subpath}"
|
|
||||||
execution = "$EDITOR {directory}/{subpath}"
|
|
||||||
|
|
||||||
# If $PAGER isn't set on your computer, you should either set it
|
|
||||||
# or just replace it with your viewer of choice in the 'execution'
|
|
||||||
# pattern.
|
|
||||||
# Example:
|
|
||||||
# execution = "less {file}"
|
|
||||||
[[verbs]]
|
|
||||||
name = "view"
|
|
||||||
invocation = "view"
|
|
||||||
execution = "$PAGER {file}"
|
|
||||||
|
|
||||||
#####################
|
|
||||||
# Skin
|
|
||||||
|
|
||||||
# If you want to change the colors of broot,
|
|
||||||
# uncomment the following bloc and start messing
|
|
||||||
# with the various values
|
|
||||||
# Note that some of those colors might not correcly
|
|
||||||
# render on terminals with low capabilities
|
|
||||||
#
|
|
||||||
# [skin]
|
|
||||||
# default = "gray(20) gray(1)"
|
|
||||||
# tree = "rgb(89, 73, 101) none"
|
|
||||||
# file = "gray(21) none"
|
|
||||||
# directory = "rgb(255, 152, 0) none bold"
|
|
||||||
# exe = "rgb(17, 164, 181) none"
|
|
||||||
# link = "Magenta none"
|
|
||||||
# pruning = "rgb(89, 73, 101) none Italic"
|
|
||||||
# perm__ = "gray(5) None"
|
|
||||||
# perm_r = "ansi(94) None"
|
|
||||||
# perm_w = "ansi(132) None"
|
|
||||||
# perm_x = "ansi(65) None"
|
|
||||||
# owner = "gray(12) none"
|
|
||||||
# group = "gray(12) none"
|
|
||||||
# selected_line = "none gray(3)"
|
|
||||||
# char_match = "yellow none"
|
|
||||||
# file_error = "Red none"
|
|
||||||
# flag_label = "gray(16) none"
|
|
||||||
# flag_value = "rgb(255, 152, 0) none bold"
|
|
||||||
# input = "White none"
|
|
||||||
# status_error = "Red gray(2)"
|
|
||||||
# status_job = "ansi(220) gray(5)"
|
|
||||||
# status_normal = "gray(20) gray(3)"
|
|
||||||
# status_italic = "rgb(255, 152, 0) None"
|
|
||||||
# status_bold = "rgb(255, 152, 0) None bold"
|
|
||||||
# status_code = "ansi(229) gray(5)"
|
|
||||||
# status_ellipsis = "gray(19) gray(1)"
|
|
||||||
# scrollbar_track = "rgb(80, 50, 0) none"
|
|
||||||
# scrollbar_thumb = "rgb(255, 187, 0) none"
|
|
||||||
# help_paragraph = "gray(20) none"
|
|
||||||
# help_bold = "rgb(255, 187, 0) none bold"
|
|
||||||
# help_italic = "Magenta rgb(30, 30, 40) italic"
|
|
||||||
# help_code = "gray(21) gray(3)"
|
|
||||||
# help_headers = "rgb(255, 187, 0) none"
|
|
||||||
|
|
||||||
# You may find other skins on
|
|
||||||
# https://dystroy.org/broot/documentation/configuration/#colors
|
|
||||||
# for example a skin suitable for white backgrounds
|
|
||||||
|
|
52
install.sh
52
install.sh
@ -20,6 +20,16 @@ GIT_REPO_BASE="https://github.com/tgrosinger/dotfiles"
|
|||||||
GIT_REPO="${GIT_REPO_BASE}.git"
|
GIT_REPO="${GIT_REPO_BASE}.git"
|
||||||
REPO_TAR="${GIT_REPO_BASE}/archive/master.tar.gz"
|
REPO_TAR="${GIT_REPO_BASE}/archive/master.tar.gz"
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
||||||
|
BIN_DIR="bin/linux"
|
||||||
|
elif [[ "${OSTYPE}" == "darwin"* ]]; then
|
||||||
|
BIN_DIR="bin/osx"
|
||||||
|
else
|
||||||
|
echo "Unknown OS type"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Define functions
|
# Define functions
|
||||||
################################################################################
|
################################################################################
|
||||||
@ -29,6 +39,11 @@ function linkFile() {
|
|||||||
ln -fns ${REPO_DIR}/$1 $1;
|
ln -fns ${REPO_DIR}/$1 $1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Remove a file if it exists then create a symlink from the file in $HOME/bin to the one contained in ${REPO_DIR}
|
||||||
|
function linkBin() {
|
||||||
|
ln -fns ${REPO_DIR}/$1 $HOME/bin/$2;
|
||||||
|
}
|
||||||
|
|
||||||
# Create a directory named by first parameter. Delete directory first if it already exists.
|
# Create a directory named by first parameter. Delete directory first if it already exists.
|
||||||
function createDirectory() {
|
function createDirectory() {
|
||||||
if [ -d $1 ]; then rm -rf $1; fi
|
if [ -d $1 ]; then rm -rf $1; fi
|
||||||
@ -59,14 +74,15 @@ function performSetup() {
|
|||||||
|
|
||||||
echo "Linking shell configs..."
|
echo "Linking shell configs..."
|
||||||
linkFile ".bashrc"
|
linkFile ".bashrc"
|
||||||
|
ln -fns ${REPO_DIR}/.bashrc .zshrc
|
||||||
|
|
||||||
echo "Linking vim..."
|
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
|
||||||
linkFile ".vim"
|
echo "Linking vim..."
|
||||||
linkFile ".vimrc"
|
linkFile ".vim"
|
||||||
|
linkFile ".vimrc"
|
||||||
echo "Linking Broot..."
|
else
|
||||||
mkdir -p .config/broot
|
echo "Skipping vim, non-linux OS"
|
||||||
ln -fns broot.conf.toml .config/broot/conf.toml
|
fi
|
||||||
|
|
||||||
echo "Linking spacemacs..."
|
echo "Linking spacemacs..."
|
||||||
echo "(note: you must install spacemacs separately)"
|
echo "(note: you must install spacemacs separately)"
|
||||||
@ -89,17 +105,25 @@ function performSetup() {
|
|||||||
ln -fns ${REPO_DIR}/navi .local/share/navi
|
ln -fns ${REPO_DIR}/navi .local/share/navi
|
||||||
|
|
||||||
echo "Linking bin files"
|
echo "Linking bin files"
|
||||||
linkFile "bin/git-safedel"
|
linkBin "${BIN_DIR}/exa-0.9.0" "exa"
|
||||||
linkFile "bin/diff-highlight"
|
linkBin "${BIN_DIR}/bat-0.13.0" "bat"
|
||||||
linkFile "bin/exa-0.8.0"
|
linkBin "${BIN_DIR}/navi-2.5.1" "navi"
|
||||||
linkFile "bin/bat-0.10.0"
|
linkBin "${BIN_DIR}/jq-1.6" "jq"
|
||||||
linkFile "bin/diff-so-fancy"
|
|
||||||
linkFile "bin/broot"
|
echo "Linking scripts"
|
||||||
linkFile "bin/navi"
|
linkBin "scripts/diff-highlight" "diff-highlight"
|
||||||
|
linkBin "scripts/diff-so-fancy" "diff-so-fancy"
|
||||||
|
linkBin "scripts/git-metalint" "git-metalint"
|
||||||
|
linkBin "scripts/git-safedel" "git-safedel"
|
||||||
|
linkBin "scripts/git-top" "git-top"
|
||||||
|
|
||||||
echo "Installing tmux plugins"
|
echo "Installing tmux plugins"
|
||||||
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
|
||||||
|
|
||||||
|
if [[ "${OSTYPE}" == "darwin"* ]]; then
|
||||||
|
brew install rsync rga pandoc poppler tesseract tmux ledger
|
||||||
|
fi
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user