Compare commits

...

7 Commits

Author SHA1 Message Date
Fabio Scotto di Santolo
5f39674092 Share desktop tmux config with WSL 2026-07-28 15:07:37 +02:00
Fabio Scotto di Santolo
23a062a2e4 Update tmux clipboard and terminal styling 2026-07-27 23:08:57 +02:00
Fabio Scotto di Santolo
fd9968f205 Add JetBrainsMono and Iosevka Nerd Fonts 2026-07-27 19:47:19 +02:00
Fabio Scotto di Santolo
a04b871068 Manage ikaros GNOME gsettings 2026-07-27 19:46:41 +02:00
Fabio Scotto di Santolo
cb2010b51e Added configuration for gitlab on workstation 2026-07-27 09:18:46 +02:00
Fabio Scotto di Santolo
f62a535335 Fix Vim FZF shortcuts 2026-07-22 20:35:23 +02:00
Fabio Scotto di Santolo
9ce213a620 Add fzf functions to Vim 2026-07-22 15:14:12 +02:00
20 changed files with 788 additions and 70 deletions

View File

@@ -33,6 +33,18 @@ common_packages:
- zip
- zoxide
vim_plugins_enabled: true
vim_plugin_distro_packages:
- fzf
- vim-fugitive
vim_plugin_source_plugins:
- name: fzf
repo: https://github.com/junegunn/fzf.git
version: v0.72.0
- name: fzf.vim
repo: https://github.com/junegunn/fzf.vim.git
version: 34a564c81f36047f50e593c1656f4580ff75ccca
common_dotfiles:
- name: .bashrc
src: .bashrc

View File

@@ -56,6 +56,7 @@ fedora_desktop_packages:
- terminus-fonts
- texlive
- tmux
- wl-clipboard
- ty
- uv
- valgrind
@@ -68,6 +69,8 @@ fedora_desktop_packages:
fedora_nerd_fonts_version: v3.3.0
fedora_nerd_fonts:
- Hack
- JetBrainsMono
- Iosevka
- UbuntuSans
- NerdFontsSymbolsOnly

View File

@@ -5,6 +5,19 @@ platform_package_manager: pkg
platform_service_manager: rc
ansible_python_interpreter: /usr/local/bin/python3
vim_plugin_distro_packages:
- fzf
vim_plugin_source_plugins:
- name: fzf
repo: https://github.com/junegunn/fzf.git
version: v0.72.0
- name: fzf.vim
repo: https://github.com/junegunn/fzf.vim.git
version: 34a564c81f36047f50e593c1656f4580ff75ccca
- name: vim-fugitive
repo: https://github.com/tpope/vim-fugitive.git
version: 3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0
effective_user_group: "{{ user_group }}"
effective_user_home: "/home/{{ effective_username }}"
user_home: "/home/{{ username }}"

View File

@@ -96,5 +96,7 @@ mint_flatpak_packages:
mint_nerd_fonts_version: v3.3.0
mint_nerd_fonts:
- Hack
- JetBrainsMono
- Iosevka
- UbuntuSans
- NerdFontsSymbolsOnly

View File

@@ -3,3 +3,16 @@ platform_profile: void
platform_family: void
platform_package_manager: xbps
platform_service_manager: runit
vim_plugin_distro_packages:
- fzf
vim_plugin_source_plugins:
- name: fzf
repo: https://github.com/junegunn/fzf.git
version: v0.72.0
- name: fzf.vim
repo: https://github.com/junegunn/fzf.vim.git
version: 34a564c81f36047f50e593c1656f4580ff75ccca
- name: vim-fugitive
repo: https://github.com/tpope/vim-fugitive.git
version: 3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0

View File

@@ -7,6 +7,7 @@ effective_user_group: "{{ server_user_group }}"
effective_user_home: "{{ server_user_home }}"
server_container_stack_dir: /opt/docker/server
ai_agents_enabled: false
vim_plugins_enabled: false
profile_packages:
- avahi-daemon

View File

@@ -28,3 +28,8 @@ workstation_dev_wsl_dotfiles:
- src: .tmux.conf
dest: .tmux.conf
mode: "0644"
source_dir: desktop
- src: .tmux/bin/
dest: .tmux/bin/
mode: preserve
source_dir: desktop

View File

@@ -22,3 +22,256 @@ host_authorized_ssh_keys: "{{ vault_ikaros_authorized_ssh_keys | default([]) }}"
host_enabled_services:
- sshd
# Host-local GNOME preferences captured from ikaros' live session. Keep these
# here rather than in desktop_gnome so nymph remains unmanaged for GNOME
# settings until it has its own real-use tuning.
gnome_gsettings_settings:
- schema: org.gnome.GWeather4
key: temperature-unit
value: "'centigrade'"
- schema: org.gnome.Ptyxis
key: cursor-shape
value: "'block'"
- schema: org.gnome.Ptyxis
key: default-columns
value: "uint32 140"
- schema: org.gnome.Ptyxis
key: default-profile-uuid
value: "'caa3c49ba73a208b4c4b64b56a5cd0af'"
- schema: org.gnome.Ptyxis
key: default-rows
value: "uint32 35"
- schema: org.gnome.Ptyxis
key: font-name
value: "'JetBrainsMono Nerd Font 14'"
- schema: org.gnome.Ptyxis
key: new-tab-position
value: "'last'"
- schema: org.gnome.Ptyxis
key: profile-uuids
value: "['caa3c49ba73a208b4c4b64b56a5cd0af']"
- schema: org.gnome.Ptyxis
key: restore-session
value: "false"
- schema: org.gnome.Ptyxis
key: restore-window-size
value: "false"
- schema: org.gnome.Ptyxis
key: use-system-font
value: "false"
- schema: org.gnome.Ptyxis.Profile
path: /org/gnome/Ptyxis/Profiles/caa3c49ba73a208b4c4b64b56a5cd0af/
key: bold-is-bright
value: "true"
- schema: org.gnome.Ptyxis.Profile
path: /org/gnome/Ptyxis/Profiles/caa3c49ba73a208b4c4b64b56a5cd0af/
key: label
value: "'Default'"
- schema: org.gnome.Ptyxis.Profile
path: /org/gnome/Ptyxis/Profiles/caa3c49ba73a208b4c4b64b56a5cd0af/
key: palette
value: "'linux'"
- schema: org.gnome.Ptyxis.Profile
path: /org/gnome/Ptyxis/Profiles/caa3c49ba73a208b4c4b64b56a5cd0af/
key: scroll-on-output
value: "true"
- schema: org.gnome.TextEditor
key: highlight-current-line
value: "true"
- schema: org.gnome.TextEditor
key: indent-style
value: "'space'"
- schema: org.gnome.TextEditor
key: indent-width
value: "-1"
- schema: org.gnome.TextEditor
key: right-margin-position
value: "uint32 120"
- schema: org.gnome.TextEditor
key: show-line-numbers
value: "true"
- schema: org.gnome.TextEditor
key: show-right-margin
value: "true"
- schema: org.gnome.TextEditor
key: tab-width
value: "uint32 4"
- schema: org.gnome.desktop.background
key: picture-options
value: "'zoom'"
- schema: org.gnome.desktop.background
key: picture-uri
value: "'file:///usr/share/backgrounds/gnome/morphogenesis-l.svg'"
- schema: org.gnome.desktop.background
key: picture-uri-dark
value: "'file:///usr/share/backgrounds/gnome/morphogenesis-d.svg'"
- schema: org.gnome.desktop.datetime
key: automatic-timezone
value: "true"
- schema: org.gnome.desktop.input-sources
key: sources
value: "[('xkb', 'us+alt-intl')]"
- schema: org.gnome.desktop.interface
key: accent-color
value: "'blue'"
- schema: org.gnome.desktop.interface
key: color-scheme
value: "'prefer-dark'"
- schema: org.gnome.desktop.peripherals.touchpad
key: two-finger-scrolling-enabled
value: "true"
- schema: org.gnome.desktop.privacy
key: remove-old-temp-files
value: "true"
- schema: org.gnome.desktop.privacy
key: remove-old-trash-files
value: "true"
- schema: org.gnome.desktop.privacy
key: report-technical-problems
value: "false"
- schema: org.gnome.desktop.screensaver
key: picture-options
value: "'zoom'"
- schema: org.gnome.desktop.screensaver
key: picture-uri
value: "'file:///usr/share/backgrounds/gnome/morphogenesis-l.svg'"
- schema: org.gnome.desktop.search-providers
key: sort-order
value: "['org.gnome.Settings.desktop', 'org.gnome.Contacts.desktop', 'org.gnome.Nautilus.desktop']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-1
value: "['<Super>1']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-2
value: "['<Super>2']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-3
value: "['<Super>3']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-4
value: "['<Super>4']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-5
value: "['<Super>5']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-6
value: "['<Super>6']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-7
value: "['<Super>7']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-8
value: "['<Super>8']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-9
value: "['<Super>9']"
- schema: org.gnome.desktop.wm.keybindings
key: switch-to-workspace-10
value: "['<Super>0']"
- schema: org.gnome.meld
key: highlight-current-line
value: "true"
- schema: org.gnome.meld
key: highlight-syntax
value: "true"
- schema: org.gnome.meld
key: indent-width
value: "4"
- schema: org.gnome.meld
key: insert-spaces-instead-of-tabs
value: "true"
- schema: org.gnome.meld
key: prefer-dark-theme
value: "true"
- schema: org.gnome.meld
key: show-line-numbers
value: "true"
- schema: org.gnome.meld
key: style-scheme
value: "'meld-dark'"
- schema: org.gnome.meld
key: wrap-mode
value: "'none'"
- schema: org.gnome.nautilus.list-view
key: default-zoom-level
value: "'large'"
- schema: org.gnome.nautilus.list-view
key: use-tree-view
value: "false"
- schema: org.gnome.nautilus.preferences
key: default-folder-viewer
value: "'list-view'"
- schema: org.gnome.nautilus.preferences
key: show-create-link
value: "true"
- schema: org.gnome.nautilus.preferences
key: show-delete-permanently
value: "true"
- schema: org.gnome.settings-daemon.plugins.color
key: night-light-enabled
value: "true"
- schema: org.gnome.settings-daemon.plugins.media-keys
key: custom-keybindings
value: "['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']"
- schema: org.gnome.settings-daemon.plugins.media-keys.custom-keybinding
path: /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/
key: binding
value: "'<Super>Return'"
- schema: org.gnome.settings-daemon.plugins.media-keys.custom-keybinding
path: /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/
key: command
value: "'ptyxis'"
- schema: org.gnome.settings-daemon.plugins.media-keys.custom-keybinding
path: /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/
key: name
value: "'Launch Terminal'"
- schema: org.gnome.shell
key: app-picker-layout
value: >-
[{'org.fedoraproject.MediaWriter.desktop': <{'position': <0>}>, 'org.gnome.Contacts.desktop': <{'position': <1>}>, 'org.gnome.Weather.desktop': <{'position': <2>}>, 'org.gnome.clocks.desktop': <{'position': <3>}>, 'org.gnome.Maps.desktop': <{'position': <4>}>, 'org.gnome.SimpleScan.desktop': <{'position': <5>}>, 'org.gnome.Settings.desktop': <{'position': <6>}>, 'org.gnome.Boxes.desktop': <{'position': <7>}>, 'org.gnome.Showtime.desktop': <{'position': <8>}>, 'org.gnome.Snapshot.desktop': <{'position': <9>}>, 'org.gnome.Characters.desktop': <{'position': <10>}>, 'Utilities': <{'position': <11>}>, 'System': <{'position': <12>}>, 'org.gnome.Tour.desktop': <{'position': <13>}>, 'org.gnome.Yelp.desktop': <{'position': <14>}>, 'htop.desktop': <{'position': <15>}>, 'libreoffice-writer.desktop': <{'position': <16>}>, 'libreoffice-calc.desktop': <{'position': <17>}>, 'libreoffice-impress.desktop': <{'position': <18>}>, 'libreoffice-draw.desktop': <{'position': <19>}>, 'libreoffice-math.desktop': <{'position': <20>}>, 'libreoffice-base.desktop': <{'position': <21>}>, 'org.gnome.Meld.desktop': <{'position': <22>}>, 'mpv.desktop': <{'position': <23>}>}, {'com.github.jeromerobert.pdfarranger.desktop': <{'position': <0>}>, 'org.remmina.Remmina.desktop': <{'position': <1>}>, 'ch.protonmail.protonmail-bridge.desktop': <{'position': <2>}>, 'org.gnome.TextEditor.desktop': <{'position': <3>}>, 'org.gnome.Software.desktop': <{'position': <4>}>, 'org.gnome.Calculator.desktop': <{'position': <5>}>, 'org.gnome.Calendar.desktop': <{'position': <6>}>, 'com.mattjakeman.ExtensionManager.desktop': <{'position': <7>}>, 'be.alexandervanhee.gradia.desktop': <{'position': <8>}>, 'syncthing-start.desktop': <{'position': <9>}>, 'syncthing-ui.desktop': <{'position': <10>}>}]
- schema: org.gnome.shell
key: disabled-extensions
value: >-
['window-list@gnome-shell-extensions.gcampax.github.com', 'background-logo@fedorahosted.org', 'apps-menu@gnome-shell-extensions.gcampax.github.com', 'places-menu@gnome-shell-extensions.gcampax.github.com', 'maximize-new-windows@VitalyOstanin']
- schema: org.gnome.shell
key: enabled-extensions
value: >-
['status-icons@gnome-shell-extensions.gcampax.github.com', 'gnome-ui-tune@itstime.tech', 'appindicatorsupport@rgcjonas.gmail.com', 'bluetooth-battery-monitor@v8v88v8v88.com', 'clipboard-indicator@tudmotu.com', 'status-area-horizontal-spacing@mathematical.coffee.gmail.com', 'MaximizeWindowIntoNewWorkspace@kyleross.com']
- schema: org.gnome.shell
key: favorite-apps
value: >-
['org.gnome.Nautilus.desktop', 'org.mozilla.firefox.desktop', 'com.spotify.Client.desktop', 'org.mozilla.thunderbird.desktop', 'org.telegram.desktop.desktop', 'org.gnome.Ptyxis.desktop', 'virt-manager.desktop']
- schema: org.gnome.shell
key: remember-mount-password
value: "true"
- schema: org.gnome.shell.keybindings
key: switch-to-application-1
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-2
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-3
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-4
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-5
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-6
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-7
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-8
value: "@as []"
- schema: org.gnome.shell.keybindings
key: switch-to-application-9
value: "@as []"
- schema: org.gnome.system.location
key: enabled
value: "true"

View File

@@ -50,6 +50,53 @@
loop_control:
label: "{{ item.dest }}"
- name: Install distro packages for Vim plugins
tags: [packages, vim, fzf]
ansible.builtin.package:
name: "{{ vim_plugin_distro_packages | default([]) }}"
state: present
when:
- vim_plugins_enabled | default(false)
- (vim_plugin_distro_packages | default([])) | length > 0
- name: Ensure git package is installed for source Vim plugins
tags: [packages, vim, fzf]
ansible.builtin.package:
name: git
state: present
when:
- vim_plugins_enabled | default(false)
- (vim_plugin_source_plugins | default([])) | length > 0
- name: Ensure Vim plugin pack directory exists
tags: [dotfiles, dotfiles:common, vim, fzf]
ansible.builtin.file:
path: "{{ effective_user_home }}/.vim/pack/plugins/opt"
state: directory
owner: "{{ effective_username }}"
group: "{{ effective_user_group }}"
mode: "0755"
when:
- vim_plugins_enabled | default(false)
- (vim_plugin_source_plugins | default([])) | length > 0
- name: Install source Vim plugins
tags: [dotfiles, dotfiles:common, vim, fzf]
ansible.builtin.git:
repo: "{{ item.repo }}"
dest: "{{ effective_user_home }}/.vim/pack/plugins/opt/{{ item.name }}"
version: "{{ item.version }}"
update: false
become_user: "{{ effective_username }}"
environment:
HOME: "{{ effective_user_home }}"
loop: "{{ vim_plugin_source_plugins | default([]) }}"
loop_control:
label: "{{ item.name }}"
when:
- vim_plugins_enabled | default(false)
- (vim_plugin_source_plugins | default([])) | length > 0
- name: Ensure AI config directories exist
tags: [dotfiles, dotfiles:common]
ansible.builtin.file:

View File

@@ -352,6 +352,7 @@
- tmux-autoreload
- tmux-resurrect
- tmux-continuum
- tmux-yank
- name: Check whether tmux plugin directories are git checkouts
tags: [dotfiles, dotfiles:desktop, tmux]

View File

@@ -81,6 +81,58 @@
group: "{{ user_group }}"
mode: "0644"
- name: Gather GNOME desktop user account data
tags: [gnome]
ansible.builtin.getent:
database: passwd
key: "{{ username }}"
when: (gnome_gsettings_settings | default([])) | length > 0
- name: Set GNOME desktop session environment
tags: [gnome]
ansible.builtin.set_fact:
gnome_user_uid: "{{ ansible_facts.getent_passwd[username][1] }}"
gnome_gsettings_environment:
HOME: "{{ user_home }}"
XDG_RUNTIME_DIR: "/run/user/{{ ansible_facts.getent_passwd[username][1] }}"
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ ansible_facts.getent_passwd[username][1] }}/bus"
when: (gnome_gsettings_settings | default([])) | length > 0
- name: Read current GNOME managed settings
tags: [gnome]
ansible.builtin.command:
argv:
- gsettings
- get
- "{{ item.schema }}{{ ':' ~ item.path if item.path is defined else '' }}"
- "{{ item.key }}"
become_user: "{{ username }}"
environment: "{{ gnome_gsettings_environment }}"
loop: "{{ gnome_gsettings_settings | default([]) }}"
loop_control:
label: >-
{{ item.schema }}{{ ':' ~ item.path if item.path is defined else '' }} {{ item.key }}
register: gnome_gsettings_current
changed_when: false
- name: Apply GNOME managed settings
tags: [gnome]
ansible.builtin.command:
argv:
- gsettings
- set
- "{{ item.item.schema }}{{ ':' ~ item.item.path if item.item.path is defined else '' }}"
- "{{ item.item.key }}"
- "{{ item.item.value }}"
become_user: "{{ username }}"
environment: "{{ gnome_gsettings_environment }}"
loop: "{{ gnome_gsettings_current.results | default([]) }}"
loop_control:
label: >-
{{ item.item.schema }}{{ ':' ~ item.item.path if item.item.path is defined else '' }} {{ item.item.key }}
changed_when: true
when: item.stdout | trim != item.item.value
- name: Check whether SSH host ed25519 key exists on GNOME desktop
tags: [services, gnome]
ansible.builtin.stat:

View File

@@ -1,8 +1,21 @@
---
- name: Ensure WSL tmux directories exist
tags: [dotfiles, dotfiles:workstation, tmux, wsl]
ansible.builtin.file:
path: "{{ user_home }}/{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- .tmux
- .tmux/bin
- .tmux/plugins
- name: Copy workstation WSL dotfiles
tags: [dotfiles, dotfiles:workstation, wsl]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/workstation_dev_wsl/{{ item.src }}"
src: "{{ playbook_dir }}/../dotfiles/{{ item.source_dir | default('workstation_dev_wsl') }}/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"

View File

@@ -92,6 +92,10 @@
sslBackend = gnutls
sslCAInfo = ~/.local/share/certs/ecaas.datacenter.comune.roma.crt
[http "https://gitlab.datacenter.comune.roma"]
sslBackend = gnutls
sslCAInfo = ~/.local/share/certs/datacenter.comune.roma.crt
[credential]
helper = store

View File

@@ -227,10 +227,31 @@ bind '"\e[5C": forward-word'
bind '"\e[5D": backward-word'
# =========================
# fzf history on Ctrl-r
# fzf: Ptyxis Linux Minimal
# =========================
if command -v fzf >/dev/null 2>&1; then
FZF_PTYXIS_LINUX_OPTS="
--layout=reverse
--border=rounded
--height=40%
--info=inline
--prompt=' '
--pointer=''
--marker='✓'
--separator='─'
--scrollbar='│'
--color=bg:#000000,bg+:#000000,gutter:#000000
--color=fg:#d7d7d7,fg+:#ffffff,hl:#55ff55,hl+:#55ff55
--color=prompt:#55ff55,pointer:#5555ff,marker:#ffff55,spinner:#5555ff
--color=info:#808080,header:#808080,border:#303030
"
export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS:+$FZF_DEFAULT_OPTS }$FZF_PTYXIS_LINUX_OPTS"
# =========================
# fzf history on Ctrl-r
# =========================
__fzf_history() {
local selected history_data
@@ -252,7 +273,7 @@ if command -v fzf >/dev/null 2>&1; then
)"
fi
selected="$(printf '%s\n' "$history_data" | fzf --height 40% --layout=reverse --border --prompt='history> ')" || return
selected="$(printf '%s\n' "$history_data" | fzf --prompt='history> ')" || return
READLINE_LINE=$selected
READLINE_POINT=${#READLINE_LINE}

View File

@@ -89,7 +89,7 @@ nnoremap <silent> <leader>h :set hlsearch!<CR>
" ----------------------------------------------------------
set updatetime=250
set timeoutlen=400
set timeoutlen=800
set ttimeoutlen=10
set shortmess+=c
@@ -149,6 +149,139 @@ endif
nnoremap <silent> <leader>g :silent grep! <C-R><C-W> .<CR>:copen<CR>
nnoremap <leader>/ :silent grep!<Space>
" ----------------------------------------------------------
" Optional plugins
" ----------------------------------------------------------
" Plugins are installed out-of-band by Ansible when available. Keep this
" vimrc usable as a standalone onefile: load optional packages only when they
" exist and keep builtin fallbacks for the mappings below.
let s:fzf_min_version = [0, 54, 0]
function! s:PackAdd(package) abort
silent! execute "packadd " . a:package
endfunction
function! s:PackAddForCommand(package, command) abort
if exists(":" . a:command) == 2
return 1
endif
call s:PackAdd(a:package)
return exists(":" . a:command) == 2
endfunction
function! s:PackAddByRuntimeFile(runtime_file, command) abort
if exists(":" . a:command) == 2
return 1
endif
" Distro packages and source installs do not always use the same Vim package
" directory name. Look for a package containing the expected runtime file and
" load it by its actual directory name.
for l:packpath in split(&packpath, ",")
let l:packages = glob(l:packpath . "/pack/*/opt/*", 0, 1)
\ + glob(l:packpath . "/pack/*/start/*", 0, 1)
for l:package_dir in l:packages
if filereadable(l:package_dir . "/" . a:runtime_file)
call s:PackAdd(fnamemodify(l:package_dir, ":t"))
if exists(":" . a:command) == 2
return 1
endif
endif
endfor
endfor
return 0
endfunction
let s:has_fzf = s:PackAddForCommand("fzf", "FZF")
\ || s:PackAddByRuntimeFile("plugin/fzf.vim", "FZF")
let s:has_fzf_vim = s:has_fzf
\ && (s:PackAddForCommand("fzf.vim", "Files")
\ || s:PackAddByRuntimeFile("autoload/fzf/vim.vim", "Files"))
let s:has_vim_fugitive = s:PackAddForCommand("vim-fugitive", "Git")
\ || s:PackAddByRuntimeFile("autoload/fugitive.vim", "Git")
function! s:FzfExecutable() abort
if executable("fzf")
return "fzf"
endif
return ""
endfunction
function! s:FzfVersionOk() abort
let l:fzf = s:FzfExecutable()
if empty(l:fzf)
return 0
endif
let l:version = matchstr(get(systemlist(l:fzf . " --version"), 0, ""), '^\d\+\.\d\+\.\d\+')
if empty(l:version)
return 0
endif
let l:parts = map(split(l:version, '\.'), 'str2nr(v:val)')
return l:parts[0] > s:fzf_min_version[0]
\ || (l:parts[0] == s:fzf_min_version[0] && l:parts[1] > s:fzf_min_version[1])
\ || (l:parts[0] == s:fzf_min_version[0] && l:parts[1] == s:fzf_min_version[1]
\ && l:parts[2] >= s:fzf_min_version[2])
endfunction
if s:has_fzf_vim && s:FzfVersionOk()
let g:fzf_layout = {"down": "40%"}
let g:fzf_colors = {
\ "fg": ["fg", "Normal"],
\ "bg": ["bg", "Normal"],
\ "hl": ["fg", "Search"],
\ "fg+": ["fg", "Normal"],
\ "bg+": ["bg", "Normal"],
\ "hl+": ["fg", "Search"],
\ "info": ["fg", "Comment"],
\ "prompt": ["fg", "String"],
\ "pointer": ["fg", "Statement"],
\ "marker": ["fg", "WarningMsg"],
\ "spinner": ["fg", "Statement"],
\ "header": ["fg", "Comment"],
\ }
let g:fzf_vim = get(g:, "fzf_vim", {})
let g:fzf_vim.preview_window = ["right,50%", "ctrl-/"]
endif
function! s:FzfCommand(command) abort
if s:has_fzf_vim && s:FzfVersionOk() && exists(":" . a:command) == 2
execute a:command
elseif a:command ==# "Files" || a:command ==# "GFiles" || a:command ==# "GitFiles"
edit .
elseif a:command ==# "Buffers"
ls
elseif a:command ==# "Rg"
silent grep! <cword> .
copen
endif
endfunction
function! s:GitStatus() abort
if s:has_vim_fugitive && exists(":Git") == 2
Git
elseif executable("git")
botright new
setlocal buftype=nofile bufhidden=wipe noswapfile nobuflisted
silent read !git status --short --branch
1delete _
file git-status
else
echohl WarningMsg | echom "git executable not found" | echohl None
endif
endfunction
nnoremap <silent> <leader>ff :call <SID>FzfCommand("Files")<CR>
nnoremap <silent> <leader>fg :call <SID>FzfCommand("GFiles")<CR>
nnoremap <silent> <leader>fb :call <SID>FzfCommand("Buffers")<CR>
nnoremap <silent> <leader>fr :call <SID>FzfCommand("Rg")<CR>
nnoremap <silent> <leader>gs :call <SID>GitStatus()<CR>
" ----------------------------------------------------------
" Quickfix / location list
" ----------------------------------------------------------

View File

@@ -0,0 +1,102 @@
# Vim shortcuts
Configurazione sorgente: `.vimrc`.
- Leader: `Space`
- Local leader: `\\`
- Le shortcut sotto sono pensate per normal mode, salvo dove indicato.
- `timeoutlen` è impostato a `800 ms`: premi le sequenze con leader senza aspettare troppo.
## Base
| Shortcut | Azione |
|---|---|
| `Space l` | Toggle caratteri invisibili / whitespace |
| `Space h` | Toggle evidenziazione ricerca |
| `Space w` | Salva file corrente |
| `Space q` | Chiudi finestra corrente |
| `Space x` | Salva e chiudi |
| `Space z` | Toggle fold sotto il cursore |
## Ricerca
| Shortcut | Azione |
|---|---|
| `Space g` | Cerca la parola sotto il cursore nel progetto e apre quickfix |
| `Space /` | Avvia `:grep!` manuale |
## FZF / file / Git
Queste shortcut usano `fzf.vim` quando disponibile; altrimenti cadono su fallback portabili.
| Shortcut | Azione |
|---|---|
| `Space ff` | `:Files`, fallback `:edit .` |
| `Space fg` | `:GFiles`, fallback `:edit .` |
| `Space fb` | `:Buffers`, fallback `:ls` |
| `Space fr` | `:Rg`, fallback `:grep! <cword> .` + quickfix |
| `Space gs` | `:Git` con vim-fugitive, fallback buffer con `git status` |
## Quickfix e location list
| Shortcut | Azione |
|---|---|
| `]q` | Prossimo elemento quickfix |
| `[q` | Precedente elemento quickfix |
| `Space qo` | Apri quickfix |
| `Space qc` | Chiudi quickfix |
| `]l` | Prossimo elemento location list |
| `[l` | Precedente elemento location list |
| `Space lo` | Apri location list |
| `Space lc` | Chiudi location list |
## Finestre
| Shortcut | Azione |
|---|---|
| `Ctrl h` | Vai alla finestra a sinistra |
| `Ctrl j` | Vai alla finestra sotto |
| `Ctrl k` | Vai alla finestra sopra |
| `Ctrl l` | Vai alla finestra a destra |
## Diff
| Shortcut | Azione |
|---|---|
| `Space df` | Attiva diff su tutte le finestre |
| `Space do` | Disattiva diff su tutte le finestre |
## Tags e preview
| Shortcut | Azione |
|---|---|
| `Space t` | Vai al tag della parola sotto il cursore |
| `Space pt` | Apri il tag in preview window |
| `Space po` | Apri preview window |
| `Space pc` | Chiudi preview window |
| `K` | Apri la man page della parola sotto il cursore |
## Cscope
Disponibili solo se Vim ha supporto `cscope`.
| Shortcut | Azione |
|---|---|
| `Space cs` | Cerca simbolo |
| `Space cg` | Cerca definizione |
| `Space cd` | Cerca funzioni chiamate dal simbolo |
| `Space cc` | Cerca chiamanti |
| `Space ct` | Cerca testo |
| `Space ce` | Cerca egrep |
| `Space ci` | Cerca include |
Nota: `Space cf` è riservato a ClangFormat, quindi non usarlo per cscope file search.
## Format, build e run
| Shortcut | Modo | Azione |
|---|---|---|
| `Space cf` | normal | Esegue `clang-format` sul file |
| `Space cf` | visual | Esegue `clang-format` sulla selezione |
| `Space m` | normal | Build smart: `ninja`, `cmake --build build`, `make -C <root>` o `make` |
| `Space r` | normal | Salva ed esegue il file corrente; supporta C, Python e shell |

View File

@@ -1,18 +1,46 @@
#=== BEHAVIOR ===#
unbind C-b
set -g prefix C-x
bind-key C-x send-prefix
set -g renumber-window on
set -g base-index 1
setw -g pane-base-index 1
set -g mouse on
set -g history-limit 50000
set -s escape-time 0
set -g focus-events on
set -g detach-on-destroy off
bind-key c new-window -c '#{pane_current_path}'
bind-key | split-window -h -c '#{pane_current_path}'
bind-key - split-window -v -c '#{pane_current_path}'
bind-key \" split-window -v -c '#{pane_current_path}'
bind-key % split-window -h -c '#{pane_current_path}'
bind-key r source-file ~/.tmux.conf \; display-message 'tmux configuration reloaded'
bind-key y setw synchronize-panes \; display-message 'synchronize-panes #{?pane_synchronized,on,off}'
bind-key -n M-Left select-pane -L
bind-key -n M-Right select-pane -R
bind-key -n M-Up select-pane -U
bind-key -n M-Down select-pane -D
bind-key -n M-H resize-pane -L 5
bind-key -n M-J resize-pane -D 5
bind-key -n M-K resize-pane -U 5
bind-key -n M-L resize-pane -R 5
# Session popup: Enter switches, Ctrl-k kills, Ctrl-n creates.
bind-key S display-popup -E -w 80% -h 80% "~/.tmux/bin/session-popup '#{pane_current_path}'"
bind-key S display-popup -E -x "#{popup_centre_x}" -y "#{popup_centre_y}" -w 95% -h 95% "~/.tmux/bin/session-popup '#{pane_current_path}'"
#=== COPY MODE ===#
setw -g mode-keys vi
set -g set-clipboard on
set -g @yank_action 'copy-pipe-and-cancel'
set -g @override_copy_command '~/.tmux/bin/copy-to-clipboard'
bind-key -T copy-mode-vi v send -X begin-selection
bind-key -T copy-mode-vi C-v send -X rectangle-toggle
bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel '~/.tmux/bin/copy-to-clipboard'
#=== TERMINAL ===#
@@ -29,55 +57,55 @@ set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'b0o/tmux-autoreload'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
#=== THEME: Yaru Blue Dark ===#
#=== THEME: Ptyxis Linux Minimal ===#
set -g @yaru_bg "#2b2b2e"
set -g @yaru_bg_light "#3b3b3e"
set -g @yaru_fg "#e0e0e0"
set -g @yaru_fg_dim "#9a9a9a"
set -g @yaru_blue "#4a90d9"
set -g @yaru_blue_b "#6daeea"
set -g @yaru_orange "#e95420"
set -g @yaru_sep "#4a4a52"
set -g @yaru_red "#c7162b"
set -g @yaru_green "#4caf50"
set -g @linux_bg "#000000"
set -g @linux_fg "#d7d7d7"
set -g @linux_dim "#808080"
set -g @linux_sep "#303030"
set -g @linux_blue "#5555ff"
set -g @linux_green "#55ff55"
set -g @linux_yellow "#ffff55"
set -g @linux_red "#ff5555"
set -g status-position top
set -g status-style "bg=#{@yaru_bg}"
set -g status-left-length 120
set -g status-position bottom
set -g status-style "bg=#{@linux_bg},fg=#{@linux_dim}"
set -g status-left-length 100
set -g status-right-length 80
set -g status-interval 5
set -g status-left ""
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_blue},bold] #S "
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]"
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_fg_dim}] #{pane_current_command} "
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]"
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_blue_b}] #{=/-40/...:#{s|$USER|~|:#{b:pane_current_path}}} "
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]#{?window_zoomed_flag,│,}"
set -ga status-left "#[bg=#{@yaru_bg},fg=#{@yaru_orange}]#{?window_zoomed_flag, zoom ,}"
set -ga status-left "#[fg=#{@linux_green},bold] #S "
set -ga status-left "#[fg=#{@linux_sep}]·"
set -ga status-left "#[fg=#{@linux_dim}] #{pane_current_command} "
set -ga status-left "#[fg=#{@linux_sep}]·"
set -ga status-left "#[fg=#{@linux_fg}] #{=/-36/...:#{s|$USER|~|:#{b:pane_current_path}}} "
set -g status-right ""
set -ga status-right "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]│"
set -ga status-right "#[bg=#{@yaru_bg},fg=#{@yaru_blue_b}] #H"
set -ga status-right "#[fg=#{@linux_yellow}]#{?pane_synchronized, sync ,}"
set -ga status-right "#[fg=#{@linux_blue}]#{?window_zoomed_flag, zoom ,}"
set -ga status-right "#[fg=#{@linux_sep}]·"
set -ga status-right "#[fg=#{@linux_dim}] #H "
setw -g pane-border-status off
setw -g pane-active-border-style "fg=#{@yaru_blue}"
setw -g pane-border-style "fg=#{@yaru_sep}"
setw -g pane-active-border-style "fg=#{@linux_blue}"
setw -g pane-border-style "fg=#{@linux_sep}"
setw -g pane-border-lines single
set -g message-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
set -g message-command-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
set -g mode-style "bg=#{@yaru_orange},fg=#{@yaru_bg},bold"
set -g message-style "bg=#{@linux_blue},fg=#{@linux_bg},bold"
set -g message-command-style "bg=#{@linux_blue},fg=#{@linux_bg},bold"
set -g mode-style "bg=#{@linux_yellow},fg=#{@linux_bg},bold"
set -g window-status-format " #I:#{?#{!=:#{window_name},Window},#W,} "
set -g window-status-style "bg=#{@yaru_bg},fg=#{@yaru_fg_dim}"
set -g window-status-last-style "bg=#{@yaru_bg},fg=#{@yaru_fg}"
set -g window-status-activity-style "bg=#{@yaru_bg},fg=#{@yaru_orange}"
set -g window-status-bell-style "bg=#{@yaru_bg},fg=#{@yaru_red},bold"
set -gF window-status-separator "#[bg=#{@yaru_bg},fg=#{@yaru_sep}]"
set -g window-status-current-format " #I:#{?#{!=:#{window_name},Window},#W,} "
set -g window-status-current-style "bg=#{@yaru_blue},fg=#{@yaru_bg},bold"
set -g window-status-format " #I:#W "
set -g window-status-style "bg=#{@linux_bg},fg=#{@linux_dim}"
set -g window-status-last-style "bg=#{@linux_bg},fg=#{@linux_fg}"
set -g window-status-activity-style "bg=#{@linux_bg},fg=#{@linux_yellow}"
set -g window-status-bell-style "bg=#{@linux_bg},fg=#{@linux_red},bold"
set -gF window-status-separator "#[fg=#{@linux_sep}]·"
set -g window-status-current-format " #I:#W "
set -g window-status-current-style "bg=#{@linux_bg},fg=#{@linux_green},bold"
#=== SESSION RESTORE ===#

View File

@@ -0,0 +1,26 @@
#!/bin/sh
set -eu
if command -v wl-copy >/dev/null 2>&1 && [ -n "${WAYLAND_DISPLAY:-}" ]; then
exec wl-copy
fi
if command -v xclip >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
exec xclip -selection clipboard -in
fi
if command -v xsel >/dev/null 2>&1 && [ -n "${DISPLAY:-}" ]; then
exec xsel --clipboard --input
fi
if command -v clip.exe >/dev/null 2>&1; then
exec clip.exe
fi
if command -v pbcopy >/dev/null 2>&1; then
exec pbcopy
fi
cat >/dev/null
exit 1

View File

@@ -4,6 +4,24 @@ set -eu
default_dir=${1:-$HOME}
# tmux popups are launched by the tmux server and may not inherit ~/.bashrc.
# Keep fzf visually aligned with the shared Ptyxis Linux Minimal style.
FZF_PTYXIS_LINUX_OPTS="
--layout=reverse
--border=rounded
--info=inline
--prompt=' '
--pointer=''
--marker='✓'
--separator='─'
--scrollbar='│'
--color=bg:#000000,bg+:#000000,gutter:#000000
--color=fg:#d7d7d7,fg+:#ffffff,hl:#55ff55,hl+:#55ff55
--color=prompt:#55ff55,pointer:#5555ff,marker:#ffff55,spinner:#5555ff
--color=info:#808080,header:#808080,border:#303030
"
export FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS:+$FZF_DEFAULT_OPTS }$FZF_PTYXIS_LINUX_OPTS"
new_session() {
printf 'New session name: '
IFS= read -r session_name
@@ -22,9 +40,7 @@ while :; do
selection=$(
tmux list-sessions -F '#{session_name}' |
fzf \
--layout=reverse \
--height=100% \
--border \
--prompt='sessions> ' \
--header='Enter switch Ctrl-n new Ctrl-k kill' \
--preview 'tmux list-windows -t {} -F "#{window_index}: #{window_name}#{?window_active, [active],}"' \

View File

@@ -1,27 +0,0 @@
# Prefix and Emacs-style key handling
unbind C-b
set -g prefix C-x
bind C-x send-prefix
set -g status-keys emacs
setw -g mode-keys emacs
# General behavior
set -g mouse on
set -g base-index 1
setw -g pane-base-index 1
set -g renumber-windows on
set -g history-limit 10000
set -s escape-time 0
set -g focus-events on
# Keep the current directory when creating windows and panes
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -v -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# Reload the configuration with C-x r
bind r source-file ~/.tmux.conf \; display-message "tmux configuration reloaded"
# Terminal capabilities
set -g default-terminal "tmux-256color"
set -as terminal-features ",xterm-256color:RGB"