Add shared bat dotfiles and cache refresh task

This commit is contained in:
Fabio Scotto di Santolo
2026-03-17 09:52:01 +01:00
parent 3337e99991
commit 4f0101cdc6
7 changed files with 8240 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ user_shell: /bin/bash
common_packages: common_packages:
- bash-completion - bash-completion
- bat
- git - git
- wget - wget
- unzip - unzip
@@ -23,3 +24,7 @@ common_dotfiles:
src: .bash_profile src: .bash_profile
dest: .bash_profile dest: .bash_profile
mode: "0644" mode: "0644"
- name: bat config
src: .config/bat/.config/bat/
dest: .config/bat/
mode: preserve

View File

@@ -1,4 +1,9 @@
--- ---
- name: Ensure bat package is installed
ansible.builtin.package:
name: bat
state: present
- name: Copy common dotfiles - name: Copy common dotfiles
ansible.builtin.copy: ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}" src: "{{ playbook_dir }}/../dotfiles/common/{{ item.src }}"
@@ -9,3 +14,11 @@
loop: "{{ common_dotfiles | default([]) }}" loop: "{{ common_dotfiles | default([]) }}"
loop_control: loop_control:
label: "{{ item.dest }}" label: "{{ item.dest }}"
- name: Refresh bat cache
ansible.builtin.command:
cmd: "{{ 'batcat' if ansible_facts.os_family == 'Debian' else 'bat' }} cache --build"
become_user: "{{ username }}"
environment:
HOME: "{{ user_home }}"
changed_when: false

View File

@@ -0,0 +1,30 @@
# This is `bat`s configuration file. Each line either contains a comment or
# a command-line option that you want to pass to `bat` by default. You can
# run `bat --help` to get a list of all possible configuration options.
# Specify desired highlighting theme (e.g. "TwoDark"). Run `bat --list-themes`
# for a list of all available themes
# Theme
--theme="Coldark-Dark"
# Style
--style="header,changes,numbers"
# Enable this to use italic text on the terminal. This is not supported on all
# terminal emulators (like tmux, by default):
--italic-text=always
# Uncomment the following line to disable automatic paging:
--paging=auto
# Uncomment the following line if you are using less version >= 551 and want to
# enable mouse scrolling support in `bat` when running inside tmux. This might
# disable text selection, unless you press shift.
--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
# Syntax mappings: map a certain filename pattern to a language.
# Example 1: use the C++ syntax for Arduino .ino files
# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
--map-syntax "*.ino:C++"
--map-syntax ".ignore:Git Ignore"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff