fix: crates
This commit is contained in:
parent
ea70650c45
commit
eb3e637462
15 changed files with 487 additions and 14 deletions
14
crates/zsh/crate.toml
Normal file
14
crates/zsh/crate.toml
Normal file
|
@ -0,0 +1,14 @@
|
|||
[crate]
|
||||
name = "zsh"
|
||||
description = "install & configure zsh"
|
||||
|
||||
[[packages]]
|
||||
name = "zsh"
|
||||
|
||||
[[actions.command]]
|
||||
command = "sh ./setup-omzsh.sh"
|
||||
description = "oh-my-zsh setup"
|
||||
|
||||
[[actions.link]]
|
||||
src = "./zshrc"
|
||||
dest = "~/.zshrc"
|
10
crates/zsh/setup-omzsh.sh
Normal file
10
crates/zsh/setup-omzsh.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
if [ ! -d "$HOME/.oh-my-zsh" ]; then
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
|
||||
|
||||
PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||
[ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-autosuggestions $PL_DIR
|
||||
PL_DIR=${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||
[ -d "$PL_DIR" ] || git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $PL_DIR
|
||||
fi
|
||||
|
||||
[ -f "$HOME/.zshrc" ] && unlink $HOME/.zshrc
|
44
crates/zsh/zshrc
Normal file
44
crates/zsh/zshrc
Normal file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/zsh
|
||||
|
||||
# Raine's .zshrc
|
||||
|
||||
if [ "$PROFILEINC" = "1" ]; then
|
||||
. ~/.profile
|
||||
fi
|
||||
|
||||
export EDITOR=vim
|
||||
export GPG_TTY=$(tty)
|
||||
export PATH="$PATH:$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$HOME/.local/bin"
|
||||
|
||||
# oh-my-zsh init
|
||||
if [ -f "$HOME/.oh-my-zsh/oh-my-zsh.sh" ]; then
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
ZSH_THEME="afowler"
|
||||
plugins=(git docker docker-compose node zsh-autosuggestions zsh-syntax-highlighting zsh-cargo-completion)
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
else
|
||||
echo "oh-my-zsh not detected :("
|
||||
PS1="$(whoami)@${HOSTNAME:-$(hostname)} $ "
|
||||
fi
|
||||
|
||||
update_dotfiles() {
|
||||
cd $HOME/.dotfiles
|
||||
git pull
|
||||
cd - &> /dev/null
|
||||
}
|
||||
|
||||
container() {
|
||||
docker run \
|
||||
-ti \
|
||||
--rm \
|
||||
--name tmp-$(id -u)-$(openssl rand -hex 8) \
|
||||
--network ${CONTAINER_NETWORK:-internal} \
|
||||
alpine \
|
||||
ash
|
||||
}
|
||||
|
||||
[ -f "$HOME/.config/i3/shortcuts-i3.sh" ] && . ~/.config/i3/shortcuts-i3.sh
|
||||
|
||||
alias q="exit"
|
||||
alias vim="nvim"
|
||||
alias vi="nvim"
|
Loading…
Add table
Add a link
Reference in a new issue