mirror of
https://github.com/keanuplayz/dotfiles.git
synced 2024-08-15 02:33:12 +00:00
initial commit
This commit is contained in:
parent
a51c62aa25
commit
b7a2066f41
7 changed files with 147 additions and 0 deletions
3
aliases.zsh
Normal file
3
aliases.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
alias find="noglob find"
|
14
exports.zsh
Normal file
14
exports.zsh
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
export LANG="en_US.UTF-8"
|
||||||
|
export LC_ALL="$LANG"
|
||||||
|
|
||||||
|
if [[ -n $SSH_CONNECTION ]]; then
|
||||||
|
export EDITOR="rmate"
|
||||||
|
else
|
||||||
|
export EDITOR="code"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export CLICOLOR=1
|
||||||
|
|
||||||
|
export SDKMAN_DIR="$HOME/.sdkman"
|
17
functions.zsh
Normal file
17
functions.zsh
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
is_linux() {
|
||||||
|
[[ $OSTYPE == linux* ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
is_macos() {
|
||||||
|
[[ $OSTYPE == darwin* ]]
|
||||||
|
}
|
||||||
|
|
||||||
|
command_exists() {
|
||||||
|
command -v "$1" >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
source_if_exists() {
|
||||||
|
[[ -f $1 ]] && source "$1"
|
||||||
|
}
|
48
oh-my-zsh.zsh
Normal file
48
oh-my-zsh.zsh
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
find_oh_my_zsh() {
|
||||||
|
for prefix in "$HOME/." "/usr/share/" "/usr/local/share/"; do
|
||||||
|
local zsh_dir="${prefix}oh-my-zsh"
|
||||||
|
if [[ -d "$zsh_dir" ]]; then
|
||||||
|
export ZSH="$zsh_dir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
configure_oh_my_zsh() {
|
||||||
|
# see https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
|
||||||
|
export ZSH_THEME="agnoster"
|
||||||
|
|
||||||
|
# use hyphen-insensitive completion (makes `_` and `-` interchangeable)
|
||||||
|
export HYPHEN_INSENSITIVE="true"
|
||||||
|
|
||||||
|
# enable command auto-correction
|
||||||
|
export ENABLE_CORRECTION="true"
|
||||||
|
|
||||||
|
# display red dots while waiting for completion
|
||||||
|
export COMPLETION_WAITING_DOTS="true"
|
||||||
|
|
||||||
|
# disable marking untracked files under VCS as dirty (this makes repository
|
||||||
|
# status check for large repositories faster)
|
||||||
|
export DISABLE_UNTRACKED_FILES_DIRTY="true"
|
||||||
|
|
||||||
|
# command execution time stamp shown in the history
|
||||||
|
export HIST_STAMPS="mm/dd/yyyy"
|
||||||
|
|
||||||
|
# https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins
|
||||||
|
plugins=(
|
||||||
|
git
|
||||||
|
common-aliases
|
||||||
|
extract
|
||||||
|
zsh-syntax-highlighting
|
||||||
|
)
|
||||||
|
|
||||||
|
if is_linux; then
|
||||||
|
plugins+=(command-not-found)
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
find_oh_my_zsh
|
||||||
|
configure_oh_my_zsh
|
||||||
|
source "$ZSH/oh-my-zsh.sh"
|
25
path.zsh
Normal file
25
path.zsh
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
prepend() { eval "export $1=\"$2:\$$1\""; }
|
||||||
|
append() { eval "export $1=\"\$$1:$2\""; }
|
||||||
|
|
||||||
|
# user binaries
|
||||||
|
append PATH "$HOME/bin"
|
||||||
|
append PATH "$HOME/.local/bin"
|
||||||
|
# global Yarn packages
|
||||||
|
append PATH "$HOME/.config/yarn/global/node_modules/.bin"
|
||||||
|
|
||||||
|
if is_macos; then
|
||||||
|
# GNU sed
|
||||||
|
prepend PATH "/usr/local/opt/gnu-tar/libexec/gnubin"
|
||||||
|
prepend MANPATH "/usr/local/opt/gnu-tar/libexec/gnuman"
|
||||||
|
# GNU tar
|
||||||
|
prepend PATH "/usr/local/opt/gnu-sed/libexec/gnubin"
|
||||||
|
prepend MANPATH "/usr/local/opt/gnu-sed/libexec/gnuman"
|
||||||
|
# GNU coreutils
|
||||||
|
prepend PATH "/usr/local/opt/coreutils/libexec/gnubin"
|
||||||
|
prepend MANPATH "/usr/local/opt/coreutils/libexec/gnuman"
|
||||||
|
# Haskell packages
|
||||||
|
append PATH "$HOME/Library/Haskell/bin"
|
||||||
|
fi
|
||||||
|
|
1
zlogin
Executable file
1
zlogin
Executable file
|
@ -0,0 +1 @@
|
||||||
|
#!/usr/bin/env bash
|
39
zshrc
Executable file
39
zshrc
Executable file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
find_dotfiles_dir() {
|
||||||
|
local readlink
|
||||||
|
# readlink=$(which greadlink || which readlink)
|
||||||
|
local script_path"=${(%):-%x}"
|
||||||
|
|
||||||
|
if [[ -n "$script_path" && -x "$readlink" ]]; then
|
||||||
|
script_path=$($readlink -f "$script_path")
|
||||||
|
DOTFILES_DIR=$(dirname "$script_path")
|
||||||
|
else
|
||||||
|
for prefix in "$HOME/" "$HOME/." "/usr/share/" "/usr/local/share/"; do
|
||||||
|
local dotfiles_dir="${prefix}dotfiles"
|
||||||
|
if [[ -d "$dotfiles_dir" ]]; then
|
||||||
|
DOTFILES_DIR="$dotfiles_dir"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -d $DOTFILES_DIR ]]; then
|
||||||
|
export DOTFILES_DIR
|
||||||
|
else
|
||||||
|
echo "dotfiles directory not found"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
find_dotfiles_dir
|
||||||
|
|
||||||
|
for script in "$DOTFILES_DIR"/{functions,path,exports,aliases,oh-my-zsh}.zsh; do
|
||||||
|
source "$script"
|
||||||
|
done
|
||||||
|
|
||||||
|
# rbenv
|
||||||
|
command_exists rbenv && eval "$(rbenv init -)"
|
||||||
|
# sdkman
|
||||||
|
source_if_exists "$SDKMAN_DIR/bin/sdkman-init.sh"
|
||||||
|
# Yarn completion
|
||||||
|
source_if_exists "/usr/local/lib/node_modules/yarn-completions/node_modules/tabtab/.completions/yarn.zsh"
|
Loading…
Reference in a new issue