summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikolaos Boutalas <nikolaos@boutalas.me>2023-08-07 11:48:39 +0300
committerNikolaos Boutalas <nikolaos@boutalas.me>2023-08-07 11:48:39 +0300
commitf270a5b31cd8289aeaf41720b601c2fbdf71a6da (patch)
treeae65a4cabde29f851565776a19e7ad82982e7ae8
parentab8638f541ceba0c7aeaa5a12be78e60b5da2684 (diff)
Add zsh task
-rw-r--r--local.yml1
-rw-r--r--tasks/zsh.yml47
2 files changed, 48 insertions, 0 deletions
diff --git a/local.yml b/local.yml
index 497adc5..b995386 100644
--- a/local.yml
+++ b/local.yml
@@ -1,4 +1,5 @@
- hosts: localhost
tasks:
- include: tasks/dependencies.yml
+ - include: tasks/zsh.yml
- include: tasks/dotfiles.yml
diff --git a/tasks/zsh.yml b/tasks/zsh.yml
new file mode 100644
index 0000000..e0a1251
--- /dev/null
+++ b/tasks/zsh.yml
@@ -0,0 +1,47 @@
+- name: Change default shell
+ become: true
+ shell: "chsh -s $(which zsh) {{ ansible_user_id }}"
+ tags:
+ - zsh
+
+- name: Create .zshenv
+ shell: "echo \"ZDOTDIR=~/.config/zsh\" > ~/.zshenv"
+ tags:
+ - zsh
+
+- name: Install Oh My Zsh
+ shell: zsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
+ tags:
+ - zsh
+
+- name: Install zsh-autosuggestions plugin
+ git:
+ repo: 'https://github.com/zsh-users/zsh-autosuggestions.git'
+ dest: "~/.config/zsh/ohmyzsh/plugins/zsh-autosuggestions"
+ tags:
+ - zsh
+
+- name: Install zsh-syntax-highlighting plugin
+ git:
+ repo: 'https://github.com/zsh-users/zsh-syntax-highlighting.git'
+ dest: "~/.config/zsh/ohmyzsh/plugins/zsh-syntax-highlighting"
+ tags:
+ - zsh
+
+- name: Enable ZSH plugins
+ lineinfile:
+ path: "~/.config/zsh/.zshrc"
+ regexp: '^plugins='
+ line: plugins=(git tmux zsh-autosuggestions zsh-syntax-highlighting)
+ tags:
+ - zsh
+
+- name: Enable tmux autostart
+ lineinfile:
+ path: "~/.config/zsh/.zshrc"
+ line: |
+ if [[ -z $TMUX ]]; then
+ tmux -u attach || exec tmux -u new-session && exit
+ fi
+ tags:
+ - zsh