From aaccb7af1e2f3318a56d235b1daf882f92fcc518 Mon Sep 17 00:00:00 2001 From: Encephala Date: Thu, 20 Jun 2024 18:50:49 +0200 Subject: [PATCH] Install diff-so-fancy --- roles/provision/files/git/dotgitconfig | 3 +++ roles/provision/tasks/dotfiles.yml | 16 ++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/roles/provision/files/git/dotgitconfig b/roles/provision/files/git/dotgitconfig index 3805825..506dd61 100644 --- a/roles/provision/files/git/dotgitconfig +++ b/roles/provision/files/git/dotgitconfig @@ -5,3 +5,6 @@ defaultBranch = main [core] editor = vim + pager = "diff-so-fancy | less --tabs=4 -RF" +[interactive] + diffFilter = "diff-so-fancy --patch" diff --git a/roles/provision/tasks/dotfiles.yml b/roles/provision/tasks/dotfiles.yml index 0ce9c60..3804808 100644 --- a/roles/provision/tasks/dotfiles.yml +++ b/roles/provision/tasks/dotfiles.yml @@ -40,7 +40,9 @@ - name: Install ohmyzsh ansible.builtin.shell: # Yoinked from https://github.com/ThePrimeagen/ansible/blob/master/tasks/zsh-setup.yml - cmd: curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > /tmp/oh-my-installer && chmod +x /tmp/oh-my-installer && /tmp/oh-my-installer + cmd: "curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh > /tmp/oh-my-installer\ + && chmod +x /tmp/oh-my-installer\ + && /tmp/oh-my-installer" creates: "{{ home }}/.oh-my-zsh" # Theme is configured in .zshrc @@ -49,13 +51,12 @@ ansible.builtin.git: repo: https://github.com/Encephala/alien.git dest: "{{ home }}/.alien" - accept_hostkey: true depth: 1 - name: Check user's shell ansible.builtin.command: grep "^jonathan.*zsh.*" /etc/passwd register: user_shell - changed_when: no + changed_when: false failed_when: user_shell.stderr != "" - name: Change shell to zsh @@ -76,7 +77,7 @@ - name: Install rust with Rustup ansible.builtin.shell: - cmd: curl https://sh.rustup.rs -sSf | sh -s -- -y + cmd: set -o pipefail curl https://sh.rustup.rs -sSf | sh -s -- -y creates: "{{ home }}/.cargo" - name: Install zoxide @@ -87,6 +88,13 @@ environment: PATH: "{{ home }}/.cargo/bin:{{ lookup('ansible.builtin.env', 'PATH') }}" +- name: Install diff-so-fancy + ansible.builtin.git: + repo: https://github.com/so-fancy/diff-so-fancy.git + dest: "{{ home }}/.oh-my-zsh/custom/plugins/diff-so-fancy" + depth: 1 + + - name: Copy .gitconfig ansible.builtin.copy: src: git/dotgitconfig