mirror of
https://github.com/morten-olsen/configs.git
synced 2026-02-08 00:46:24 +01:00
cleanup
This commit is contained in:
107
playbooks/roles/software_tmux/files/.tmux.conf
Normal file
107
playbooks/roles/software_tmux/files/.tmux.conf
Normal file
@@ -0,0 +1,107 @@
|
||||
set -g mouse on
|
||||
set -g default-terminal "screen-256color-bce"
|
||||
#set -g status-justify centre
|
||||
|
||||
#set -ga terminal-overrides ',xterm-256color:Tc'
|
||||
set -ag terminal-overrides ",xterm-256color:RGB"
|
||||
|
||||
|
||||
set -g base-index 1
|
||||
set -g renumber-windows on
|
||||
bind q lock-client
|
||||
|
||||
unbind '"'
|
||||
unbind %
|
||||
|
||||
bind h select-pane -L
|
||||
bind j select-pane -D
|
||||
bind k select-pane -U
|
||||
bind l select-pane -R
|
||||
|
||||
bind -r H resize-pane -L 10
|
||||
bind -r J resize-pane -D 10
|
||||
bind -r K resize-pane -U 10
|
||||
bind -r L resize-pane -R 10
|
||||
|
||||
bind o attach -c "#{pane_current_path}"
|
||||
|
||||
# don't rename windows automatically
|
||||
set-option -g allow-rename off
|
||||
|
||||
set -g @plugin 'tmux-plugins/tpm'
|
||||
|
||||
run -b '~/.tmux/plugins/tpm/tpm'
|
||||
if "test ! -d ~/.tmux/plugins/tpm" \
|
||||
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
|
||||
|
||||
# set -g @plugin "arcticicestudio/nord-tmux"
|
||||
# set -g @plugin 'dracula/tmux'
|
||||
# set -g @dracula-show-powerline true
|
||||
# set -g @plugin 'wfxr/tmux-power'
|
||||
set -g @plugin 'catppuccin/tmux'
|
||||
set -g @plugin 'tmux-plugins/tmux-yank'
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible'
|
||||
set -g @treemux-tree-nvim-init-file '~/.tmux/plugins/treemux/configs/treemux_init.lua'
|
||||
set -g @plugin 'kiyoon/treemux'
|
||||
|
||||
# open pane in vim
|
||||
bind-key / capture-pane -S -102400 -J \; new-window 'vim -c ":read !tmux save-buffer - ; tmux delete-buffer;" -c ":normal gg" -c ":set buftype=nofile" -c ":silent! ChompWhitespace"'
|
||||
|
||||
set -g @catppuccin_date_time "%Y-%m-%d %H:%M"
|
||||
set -g @catppuccin_window_tabs_enabled "on"
|
||||
|
||||
# clear history
|
||||
# bind k send-keys -R \; clear-history
|
||||
|
||||
# copy mode
|
||||
setw -g mode-keys vi
|
||||
bind Escape copy-mode
|
||||
unbind [
|
||||
unbind p
|
||||
bind p paste-buffer
|
||||
bind -Tcopy-mode-vi v send -X begin-selection
|
||||
bind -Tcopy-mode-vi y send -X copy-selection
|
||||
bind -Tcopy-mode-vi Escape send -X cancel
|
||||
|
||||
# panes
|
||||
bind - split-window -v -c "#{pane_current_path}"
|
||||
bind | split-window -h -c "#{pane_current_path}"
|
||||
bind C-z resize-pane -Z
|
||||
bind g swap-pane -U
|
||||
bind æ swap-pane -D
|
||||
|
||||
# panes
|
||||
#set -g window-active-style 'bg=colour236'
|
||||
#set -g window-style 'bg=black'
|
||||
|
||||
|
||||
# Smart pane switching with awareness of Vim splits.
|
||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||
bind-key -n 'C-h' if-shell "$is_vim" 'send-keys C-h' 'select-pane -L'
|
||||
bind-key -n 'C-j' if-shell "$is_vim" 'send-keys C-j' 'select-pane -D'
|
||||
bind-key -n 'C-k' if-shell "$is_vim" 'send-keys C-k' 'select-pane -U'
|
||||
bind-key -n 'C-l' if-shell "$is_vim" 'send-keys C-l' 'select-pane -R'
|
||||
|
||||
bind -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'resize-pane -L 1'
|
||||
bind -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'resize-pane -D 1'
|
||||
bind -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'resize-pane -U 1'
|
||||
bind -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'resize-pane -R 1'
|
||||
|
||||
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
|
||||
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\' 'select-pane -l'"
|
||||
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
|
||||
"bind-key -n 'C-\\' if-shell \"$is_vim\" 'send-keys C-\\\\' 'select-pane -l'"
|
||||
|
||||
|
||||
bind-key -T copy-mode-vi 'C-h' select-pane -L
|
||||
bind-key -T copy-mode-vi 'C-j' select-pane -D
|
||||
bind-key -T copy-mode-vi 'C-k' select-pane -U
|
||||
bind-key -T copy-mode-vi 'C-l' select-pane -R
|
||||
bind-key -T copy-mode-vi 'C-\' select-pane -l
|
||||
|
||||
# Utils
|
||||
bind -r g display-popup -d '#{pane_current_path}' -w80% -h80% -E lazygit
|
||||
|
||||
4
playbooks/roles/software_tmux/meta/main.yml
Normal file
4
playbooks/roles/software_tmux/meta/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
dependencies:
|
||||
- role: base_info
|
||||
- role: base_terminal
|
||||
39
playbooks/roles/software_tmux/tasks/main.yml
Normal file
39
playbooks/roles/software_tmux/tasks/main.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.file:
|
||||
mode: "{{ item.mode }}"
|
||||
path: "{{ home }}/{{ item.path }}"
|
||||
state: directory
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'directory'
|
||||
|
||||
- name: "Copy templates"
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path | regex_replace('\\.j2$', '') }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../templates
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
|
||||
- name: Copy config
|
||||
tags:
|
||||
- config
|
||||
ansible.builtin.copy:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ home }}/{{ item.path }}"
|
||||
mode: "{{ item.mode }}"
|
||||
with_community.general.filetree:
|
||||
- ../files
|
||||
loop_control:
|
||||
label: "{{ item.path }}"
|
||||
when: item.state == 'file'
|
||||
Reference in New Issue
Block a user