From e2ed89ddd17c06baee18534a1c416ee14d79f501 Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 28 Dec 2022 10:28:37 +0100 Subject: [PATCH] install oh-my-zsh --- README.md | 2 -- roles/system/tasks/main.yml | 4 ++++ roles/zsh/files/.zshrc | 47 ++++++++----------------------------- roles/zsh/tasks/main.yml | 16 +++++++++++-- 4 files changed, 28 insertions(+), 41 deletions(-) diff --git a/README.md b/README.md index beaa436..6cb2175 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,7 @@ ## TODO - Telegram (maybe only possible to download) -- Oh my zsh? - Cool neovim setup -- fuzzy find - thunderbird config - some kind of tag setup with: bootstrap, update etc diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index 91d3f72..82052e9 100644 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -31,3 +31,7 @@ copy: src: "{{ role_path }}/files/keepassxc.ini" dest: ~/.config/keepassxc/keepassxc.ini +- name: Create repos directory + file: + path: ~/repos + state: directory diff --git a/roles/zsh/files/.zshrc b/roles/zsh/files/.zshrc index 8bca8d8..d7f8d71 100644 --- a/roles/zsh/files/.zshrc +++ b/roles/zsh/files/.zshrc @@ -1,40 +1,13 @@ -# Set up the prompt +export ZSH=$HOME/.oh-my-zsh -autoload -Uz promptinit -promptinit -prompt adam1 +plugins=(git asdf colored-man-pages colorize command-not-found copyfile copypath docker extract docker-compose fancy-ctrl-z fzf ripgrep) -setopt histignorealldups sharehistory +export ZSH_THEME="strug" +export ZSH_COLORIZE_TOOL=pygmentize +export FZF_BASE=~/repos/fzf +export FZF_DEFAULT_COMMAND='ag' -# Use emacs keybindings even if our EDITOR is set to vi -bindkey -e - -# Keep 1000 lines of history within the shell and save it to ~/.zsh_history: -HISTSIZE=1000 -SAVEHIST=1000 -HISTFILE=~/.zsh_history - -# Use modern completion system -autoload -Uz compinit -compinit - -zstyle ':completion:*' auto-description 'specify: %d' -zstyle ':completion:*' completer _expand _complete _correct _approximate -zstyle ':completion:*' format 'Completing %d' -zstyle ':completion:*' group-name '' -zstyle ':completion:*' menu select=2 -eval "$(dircolors -b)" -zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS} -zstyle ':completion:*' list-colors '' -zstyle ':completion:*' list-prompt %SAt %p: Hit TAB for more, or the character to insert%s -zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=* l:|=*' -zstyle ':completion:*' menu select=long -zstyle ':completion:*' select-prompt %SScrolling active: current selection at %p%s -zstyle ':completion:*' use-compctl false -zstyle ':completion:*' verbose true - -zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' -zstyle ':completion:*:kill:*' command 'ps -u $USER -o pid,%cpu,tty,cputime,cmd' +source $ZSH/oh-my-zsh.sh # Git aliases alias gp='git push' @@ -47,10 +20,10 @@ alias gb='git branch' alias ga='git add' alias gl='git log' -# asdf -. $HOME/.asdf/asdf.sh - # For neovim PATH=$PATH:/usr/local alias vi='nvim' alias vim='nvim' + +zstyle ':completion:*:*:docker:*' option-stacking yes +zstyle ':completion:*:*:docker-*:*' option-stacking yes diff --git a/roles/zsh/tasks/main.yml b/roles/zsh/tasks/main.yml index 2da4a25..ecae16b 100644 --- a/roles/zsh/tasks/main.yml +++ b/roles/zsh/tasks/main.yml @@ -1,7 +1,19 @@ -- name: Install zsh +- name: Install apt packages become: true apt: - name: zsh + pkg: + - zsh + - fzf + - silversearcher-ag +- name: Install pygments + pip: + name: + - pygments +- name: Clone oh-my-zsh + git: + repo: https://github.com/ohmyzsh/ohmyzsh.git + depth: 1 + dest: ~/.oh-my-zsh - name: Set default shell to zsh become: true user: