1
0

Compare commits

...

6 Commits

13 changed files with 52 additions and 6 deletions

View File

@@ -1,8 +1,9 @@
{{- $email := promptStringOnce . "email" "What's your email?" }}
{{- $git_name := promptStringOnce . "git_name" "What's your Git name?" }}
{{- $email := promptStringOnce . "email" "What's your email" }}
{{- $git_name := promptStringOnce . "git_name" "What's your Git name" }}
{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell?" true }}
{{- $git := promptBoolOnce . "features.git" "Do you want to install Git?" true }}
{{- $shell := promptBoolOnce . "features.shell" "Do you want to install the Fish shell" true }}
{{- $git := promptBoolOnce . "features.git" "Do you want to install Git" true }}
{{- $editor := promptBoolOnce . "features.editor" "Do you want to install Neovim" true }}
[data]
email = {{ $email | quote }}
@@ -11,3 +12,4 @@ git_name = {{ $git_name | quote }}
[data.features]
shell = {{ $shell }}
git = {{ $git }}
editor = {{ $editor }}

View File

@@ -1,6 +1,12 @@
{{- if not .features.shell }}
.config/fish
.config/starship.toml
{{- end }}
{{- if not .features.git }}
.config/git
{{- end }}
{{- if not .features.editor }}
.config/nvim
{{- end }}

View File

@@ -24,8 +24,12 @@ trap 'echo -e "\n\033[1;31mError: Script \"$SCRIPT_PATH\" failed at line $LINENO
# </init>
# <core>
# Ask for confirmation before running the script
while true; do
read -p "Do you want to run the setup script? [Y/n]: " -n 1 -r REPLY
# Clear the input buffer and add a newline
while read -t 0.001 TMP; do continue; done
echo
# Convert to lowercase and default to 'y' if empty

View File

@@ -0,0 +1,7 @@
abbr --add --position command l ls -lAh
{{- if .features.editor }}
# Alias `vi` and `vim` to Neovim
abbr --add --position command vim nvim
abbr --add --position command vi nvim
{{- end }}

View File

@@ -0,0 +1,4 @@
{{- if .features.editor }}
# Set Neovim to be the default editor
set --export EDITOR nvim
{{- end }}

View File

@@ -0,0 +1,2 @@
# Add `~/.local/bin` to PATH
set fish_user_paths {{ joinPath .chezmoi.homeDir ".local/bin" }}

View File

@@ -0,0 +1,5 @@
# Disable the default Fish greeting message
set fish_greeting ""
# Initialize Starship
starship init fish | source

View File

@@ -0,0 +1,6 @@
-- Enable relative line numbers
vim.opt.number = true
vim.opt.relativenumber = true
-- Highlight the current line
vim.opt.cursorline = true

View File

@@ -27,3 +27,5 @@
when: features.shell == true
- role: git
when: features.git == true
- role: editor
when: features.editor == true

View File

@@ -0,0 +1,5 @@
- name: Install Neovim on Arch
become: true
ansible.builtin.pacman:
name: neovim
when: chezmoi.osRelease.id == "arch"

View File

@@ -1,7 +1,10 @@
- name: Install Fish shell on Arch
- name: Install Fish shell and Starship on Arch
become: true
ansible.builtin.pacman:
name: fish
name:
- fish
- starship
- ttf-nerd-fonts-symbols # Required for Starship
when: chezmoi.osRelease.id == "arch"
- name: Find Fish shell binary