init
This commit is contained in:
commit
b3dba4542f
44 changed files with 1596 additions and 0 deletions
9
bin/zshrc/brew
Normal file
9
bin/zshrc/brew
Normal file
|
@ -0,0 +1,9 @@
|
|||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
ARCH=$(uname -m)
|
||||
|
||||
if [[ "$ARCH" == "arm64" ]]; then
|
||||
eval "$(/opt/homebrew/bin/brew shellenv)"
|
||||
elif [[ "$ARCH" == "x86_64" ]]; then
|
||||
eval "$(/usr/local/bin/brew shellenv)"
|
||||
fi
|
||||
fi
|
21
bin/zshrc/init
Normal file
21
bin/zshrc/init
Normal file
|
@ -0,0 +1,21 @@
|
|||
# sources that might alter the path
|
||||
. $DAT_ROOT/bin/zshrc/brew
|
||||
|
||||
export PATH="$DAT_ROOT/bin:$HOME/.local/bin:$PATH"
|
||||
|
||||
export RUBYLIB="$DAT_ROOT/lib"
|
||||
|
||||
export PASSWORD_STORE_DIR=$HOME/.local/secure-vault/passwords
|
||||
|
||||
path=("$GEM_HOME/bin" $path)
|
||||
|
||||
alias gf='git log --all --oneline | fzf'
|
||||
|
||||
function cdd {
|
||||
cd $DAT_ROOT
|
||||
}
|
||||
|
||||
. $DAT_ROOT/bin/zshrc/prompt
|
||||
. $DAT_ROOT/bin/zshrc/utils
|
||||
|
||||
bindkey '^e' edit-command-line
|
44
bin/zshrc/prompt
Normal file
44
bin/zshrc/prompt
Normal file
|
@ -0,0 +1,44 @@
|
|||
# Enable vcs_info
|
||||
autoload -Uz vcs_info
|
||||
autoload -Uz add-zsh-hook
|
||||
|
||||
# Colors
|
||||
GRAY="%F{245}"
|
||||
PURPLE="%F{141}"
|
||||
RED="%F{red}"
|
||||
RESET="%f"
|
||||
|
||||
zstyle ':vcs_info:git:*' formats '%b'
|
||||
zstyle ':vcs_info:*' enable git
|
||||
|
||||
git_precmd() {
|
||||
vcs_info
|
||||
if [[ -n "${vcs_info_msg_0_}" ]]; then
|
||||
GIT_PROMPT="${PURPLE}(${RED}${vcs_info_msg_0_}${PURPLE}) "
|
||||
else
|
||||
GIT_PROMPT=""
|
||||
fi
|
||||
|
||||
PROMPT="${GRAY}%n@%M ${RESET}%~ ${GIT_PROMPT}${PURPLE}➜ ${RESET}"
|
||||
}
|
||||
|
||||
add-zsh-hook precmd git_precmd
|
||||
|
||||
# Prompt
|
||||
# PROMPT='${GRAY}%n@%m ${RESET}%~ ${PURPLE}(${RED}${vcs_info_msg_0_}${PURPLE}) ➜ ${RESET}'
|
||||
#
|
||||
|
||||
# vcs_info
|
||||
# PROMPT='${GRAY}%n@%m ${RESET}%~ ${GIT_PROMPT}${PURPLE}➜ ${RESET}'
|
||||
# PROMPT="${GRAY}%n@%M ${RESET}%~ ${GIT_PROMPT}${PURPLE}➜ ${RESET}"
|
||||
|
||||
# Mac OS
|
||||
# export HOST="gurgul.pro"
|
||||
# sudo scutil --set HostName "Mac-mini"
|
||||
|
||||
# Linux
|
||||
# sudo hostnamectl set-hostname
|
||||
# hostnamectl
|
||||
|
||||
|
||||
|
16
bin/zshrc/utils
Normal file
16
bin/zshrc/utils
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
|
||||
export EDITOR='nvim'
|
||||
export GIT_EDITOR='nvim'
|
||||
# git config --global core.editor "nvim"
|
||||
|
||||
alias ddd='date +"%d-%m-%Y"'
|
||||
alias v='nvim'
|
||||
|
||||
# should be for linux only
|
||||
alias ip='ip -c'
|
||||
|
||||
alias hist='eval `history | fzf | cut -s -d " " -f4-`'
|
||||
|
||||
export LC_ALL=en_US.UTF-8
|
||||
export HISTSIZE=100000000
|
Loading…
Add table
Add a link
Reference in a new issue