remove oh-my-zsh
This commit is contained in:
9
roles/zsh/defaults/main.yaml
Normal file
9
roles/zsh/defaults/main.yaml
Normal file
@ -0,0 +1,9 @@
|
||||
zsh_plugins_dir: "{{ home_dir }}/.zsh/plugins"
|
||||
|
||||
zsh_plugins:
|
||||
- name: zsh_autosuggestions
|
||||
repo: https://github.com/zsh-users/zsh-autosuggestions.git
|
||||
version: v0.7.1
|
||||
- name: zsh-syntax-highlighting
|
||||
repo: https://github.com/zsh-users/zsh-syntax-highlighting.git
|
||||
version: 0.8.0
|
||||
@ -6,3 +6,13 @@ case ":$PATH:" in
|
||||
*) export PATH="$PNPM_HOME:$PATH" ;;
|
||||
esac
|
||||
# pnpm end
|
||||
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
if [[ -n "$MACHINE_TYPE" && -f "$HOME/dotfiles/zsh/hosts/$MACHINE_TYPE.zsh" ]]; then
|
||||
source "$HOME/dotfiles/zsh/hosts/$MACHINE_TYPE.zsh"
|
||||
fi
|
||||
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||
|
||||
@ -1,22 +1,43 @@
|
||||
# If you come from bash you might have to change your $PATH.
|
||||
# export PATH=$HOME/bin:$HOME/.local/bin:/usr/local/bin:$PATH
|
||||
HISTFILE="$HOME/.zsh_history"
|
||||
HISTSIZE=50000
|
||||
SAVEHOST=50000
|
||||
# setopt share_history # persist, and share live across open shells
|
||||
setopt inc_append_history # history of session appended to HISTFILE after session ends
|
||||
setopt extended_history # record timestamps
|
||||
setopt hist_ignore_dups # drop a command identical to the one before it
|
||||
setopt hist_ignore_space # don't record commands typed with a leading space
|
||||
setopt hist_verify # let you edit a !-expansion before it runs
|
||||
|
||||
# Path to your Oh My Zsh installation.
|
||||
export ZSH="$HOME/.oh-my-zsh"
|
||||
autoload -Uz compinit
|
||||
compinit
|
||||
|
||||
ZSH_THEME="bira"
|
||||
zstyle ':omz:update' mode reminder # just remind me to update when it's time
|
||||
COMPLETION_WAITING_DOTS="true"
|
||||
autoload -Uz vcs_info
|
||||
setopt prompt_subst
|
||||
|
||||
plugins=(
|
||||
git
|
||||
zsh-syntax-highlighting
|
||||
zsh-autosuggestions
|
||||
fzf-zsh-plugin
|
||||
)
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:git:*' formats ' %F{yellow}‹%b› %f'
|
||||
zstyle ':vcs_info:git:*' actionformats ' %F{yellow}‹%b|%a› %f'
|
||||
|
||||
source $ZSH/oh-my-zsh.sh
|
||||
zstyle ':vcs_info:git*+set-message:*' hooks git-dirty
|
||||
+vi-git-dirty() {
|
||||
if [[ -n $(git status --porcelain 2>/dev/null) ]]; then
|
||||
hook_com[branch]+='%F{red}●%F{yellow}'
|
||||
fi
|
||||
}
|
||||
|
||||
precmd() { vcs_info }
|
||||
|
||||
PROMPT='╭─%B%(!.%F{red}.%F{green})%n@%m%f %F{blue}%~%f%b${vcs_info_msg_0_}
|
||||
╰─%B%(!.#.$)%b '
|
||||
RPROMPT='%B%(?..%F{red}%? ↵%f)%b'
|
||||
|
||||
expand-or-complete-with-dots() {
|
||||
print -Pn '%F{red}…%f'
|
||||
zle expand-or-complete
|
||||
zle redisplay
|
||||
}
|
||||
zle -N expand-or-complete-with-dots
|
||||
bindkey '^I' expand-or-complete-with-dots
|
||||
|
||||
# Preferred editor for local and remote sessions
|
||||
if [[ -n $SSH_CONNECTION ]]; then
|
||||
@ -31,28 +52,11 @@ for zsh_file in "$DOTFILES_ZSH_DIR"/*.zsh; do
|
||||
[[ -r "$zsh_file" ]] && source "$zsh_file"
|
||||
done
|
||||
|
||||
|
||||
# TODO source all files with .zsh suffix
|
||||
# source ./aliases.zsh
|
||||
# source ./dev_env.zsh
|
||||
# source ./tools.zsh
|
||||
|
||||
# TODO
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
if [[ -n "$MACHINE_TYPE" && -f "$HOME/dotfiles/zsh/hosts/$MACHINE_TYPE.zsh" ]]; then
|
||||
source "$HOME/dotfiles/zsh/hosts/$MACHINE_TYPE.zsh"
|
||||
fi
|
||||
|
||||
|
||||
alias drun='docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined'
|
||||
|
||||
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gcr/ssh"
|
||||
ZSH_PLUGINS_DIR="$HOME/.zsh/plugins"
|
||||
source "$ZSH_PLUGINS_DIR/zsh_autosuggestions/zsh-autosuggestions.zsh"
|
||||
source "$ZSH_PLUGINS_DIR/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||
|
||||
bindkey '^H' backward-kill-word
|
||||
bindkey '^R' fzf-history-widget
|
||||
|
||||
eval "$(zoxide init zsh)"
|
||||
|
||||
|
||||
@ -1,16 +1,32 @@
|
||||
---
|
||||
- name: Install zsh
|
||||
- name: Install zsh and git
|
||||
package:
|
||||
name: zsh
|
||||
name:
|
||||
- zsh
|
||||
- git
|
||||
state: present
|
||||
become: yes
|
||||
become_user: root
|
||||
# become_user: root
|
||||
|
||||
- name: Install oh-my-zsh
|
||||
shell: |
|
||||
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
|
||||
args:
|
||||
creates: "{{ home_dir }}/.oh-my-zsh"
|
||||
- name: Ensure zsh plugin directory exists
|
||||
file:
|
||||
path: "{{ zsh_plugins_dir }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
|
||||
- name: Clone/checkout zsh plugins at pinned versions
|
||||
git:
|
||||
repo: "{{ item.repo }}"
|
||||
dest: "{{ zsh_plugins_dir }}/{{ item.name }}"
|
||||
version: "{{ item.version }}"
|
||||
update: true
|
||||
loop: "{{ zsh_plugins }}"
|
||||
|
||||
# - name: Install oh-my-zsh
|
||||
# shell: |
|
||||
# sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended
|
||||
# args:
|
||||
# creates: "{{ home_dir }}/.oh-my-zsh"
|
||||
|
||||
- name: Symlink .zshenv
|
||||
file:
|
||||
|
||||
Reference in New Issue
Block a user