New tmux related configuration

This commit is contained in:
Eduardo Cueto-Mendoza 2025-01-16 17:57:57 +00:00
parent da0b6f21d0
commit e11b80703e
Signed by: TastyPancakes
GPG Key ID: 941DF56C7242C3F1
7 changed files with 269 additions and 60 deletions

View File

@ -1,13 +1,14 @@
#echo Hi Hexley!
fish_vi_key_bindings
set ID (id -u)
## Start tmux
#if not set -q TMUX; and [ $ID != 0 ]
# Start tmux
if not set -q TMUX; and [ $ID != 0 ]
# echo "Setting tmux"
# set -g TMUX tmux new-session -d -s base
# eval $TMUX
# tmux attach-session -d -t base
#end
eval tmux
end
# PATH
# Homebrew
@ -45,11 +46,18 @@ if [ $ID != 0 ]
gpg-connect-agent updatestartuptty /bye > /dev/null
end
# bat
set -x BAT_THEME 'tokyonight_night'
# Editor
set -x EDITOR 'nvim'
# Manpager
set -x PAGER 'nvim +Man!'
#set -x PAGER 'nvim +Man!'
# fzf
set -x FZF_CTRL_T_OPTS "--preview 'bat -n --color=always --line-range :500 {}'"
set -x FZF_ALT_C_OPTS "--preview 'eza --tree --color=always {} | head 200'"
# Term for ssh
#export TERM='xterm-256color'
@ -73,13 +81,19 @@ set -x HOMEBREW_NO_ENV_HINTS 1
# convinience
alias doas='sudo'
# ls
alias ls='colorls'
# neovim
alias vi='nvim'
alias vim='nvim'
# cat
alias cat="bat"
# ls
alias ls="eza --color=always --long --git --icons=always --group"
# thefuck
thefuck --alias | source
# mutt
#alias mutt='neomutt'
@ -92,6 +106,15 @@ alias wget_f='wget -r -np -R "index.html*"'
# btop
alias top='btop'
# zoxide
alias cd="z"
# fzf
fzf --fish | source
# zoxide
zoxide init fish | source
# git signed
function git --wraps git
switch $argv[1]

View File

@ -0,0 +1,18 @@
return {
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
"TmuxNavigatorProcessList",
},
keys = {
{ "<c-h>", "<cmd><C-U>TmuxNavigateLeft<cr>" },
{ "<c-j>", "<cmd><C-U>TmuxNavigateDown<cr>" },
{ "<c-k>", "<cmd><C-U>TmuxNavigateUp<cr>" },
{ "<c-l>", "<cmd><C-U>TmuxNavigateRight<cr>" },
{ "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
},
}

1
.config/tmux/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
plugins/

33
.config/tmux/tmux.conf Executable file
View File

@ -0,0 +1,33 @@
# Set true color
set-option -sa terminal-overrides ",xterm*Tc"
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# Shift Alt vim keys to switch windows
bind -n M-H previous-window
bind -n M-L next-window
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tmux-yank'
run '~/.tmux/plugins/tpm/tpm'
# set vi-mode
set-window-option -g mode-keys vi
# keybindings
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
# split panes using v and f, and split panes in current directory
bind v split-window -h -c "#{pane_current_path}"
bind h split-window -v -c "#{pane_current_path}"
unbind '"'
unbind %

View File

@ -0,0 +1,185 @@
# vim:fileencoding=utf-8:foldmethod=marker
# : Manager {{{
[manager]
cwd = { fg = "#7aa2f7" } # Blue
# Hovered
hovered = { reversed = true }
preview_hovered = { underline = true }
# Find
find_keyword = { fg = "#f7768e", bold = true, italic = true, underline = true } # Red
find_position = { fg = "#bb9af7", bg = "reset", bold = true, italic = true } # Magenta
# Marker
marker_copied = { fg = "#9ece6a", bg = "#9ece6a" } # Green
marker_cut = { fg = "#e0af68", bg = "#f7768e" } # Red
marker_marked = { fg = "#7aa2f7", bg = "#7dcfff" } # Cyan
marker_selected = { fg = "#e0af68", bg = "#e0af68" } # Yellow
# Tab
tab_active = { bg = "#282C34", fg = "#7aa2f7" } # Darkened background, Blue text
tab_inactive = {}
tab_width = 1
# Count
count_copied = { fg = "#414868", bg = "#9ece6a" } # Darkened black on Green
count_cut = { fg = "#414868", bg = "#e0af68" } # Darkened black on Yellow
count_selected = { fg = "#414868", bg = "#7aa2f7" } # Darkened black on Blue
# Border
border_symbol = "│"
border_style = { fg = "#414868" } # Darkened black
# : }}}
# : Mode {{{
[mode]
normal_main = { fg = "#414868", bg = "#7aa2f7", bold = true } # Darkened black on Blue
normal_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# Select mode
select_main = { fg = "#414868", bg = "#9ece6a", bold = true } # Darkened black on Green
select_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# Unset mode
unset_main = { fg = "#414868", bg = "#bb9af7", bold = true } # Darkened black on Magenta
unset_alt = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# : }}}
# : Status bar {{{
[status]
separator_open = ""
separator_close = ""
separator_style = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
# Progress
progress_label = { fg = "#a9b1d6", bold = true } # White
progress_normal = { fg = "#7aa2f7", bg = "#414868" } # Blue on Darkened black
progress_error = { fg = "#f7768e", bg = "#414868" } # Red on Darkened black
# Permissions
perm_sep = { fg = "#7aa2f7" } # Blue
perm_type = { fg = "#9ece6a" } # Green
perm_read = { fg = "#e0af68" } # Yellow
perm_write = { fg = "#f7768e" } # Red
perm_exec = { fg = "#bb9af7" } # Magenta
# : }}}
# : Pick {{{
[pick]
border = { fg = "#7aa2f7" } # Blue
active = { fg = "#bb9af7", bold = true } # Magenta
inactive = {}
# : }}}
# : Input {{{
[input]
border = { fg = "#7aa2f7" } # Blue
title = {}
value = {}
selected = { reversed = true }
# : }}}
# : Completion {{{
[completion]
border = { fg = "#7aa2f7" } # Blue
# : }}}
# : Tasks {{{
[tasks]
border = { fg = "#7aa2f7" } # Blue
title = {}
hovered = { fg = "#bb9af7", underline = true } # Magenta
# : }}}
# : Which {{{
[which]
mask = { bg = "#414868" } # Darkened black
cand = { fg = "#9ece6a" } # Green
rest = { fg = "#a9b1d6" } # White
desc = { fg = "#bb9af7" } # Magenta
separator = "  "
separator_style = { fg = "#626880" } # Darkened gray
# : }}}
# : Help {{{
[help]
on = { fg = "#9ece6a" } # Green
run = { fg = "#bb9af7" } # Magenta
hovered = { reversed = true, bold = true }
footer = { fg = "#a9b1d6", bg = "#c6d0f5" } # White on Light gray
# : }}}
# : Notify {{{
[notify]
title_info = { fg = "#9ece6a" } # Green
title_warn = { fg = "#f7768e" } # Red
title_error = { fg = "#e0af68" } # Yellow
# : }}}
# : File-specific styles {{{
[filetype]
rules = [
# Images
{ mime = "image/*", fg = "#e0af68" }, # Yellow
# Media
{ mime = "video/*", fg = "#f7768e" }, # Red
{ mime = "audio/*", fg = "#f7768e" }, # Red
# Archives
{ mime = "application/zip", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-tar", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-bzip*", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-bzip2", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-7z-compressed", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-rar", fg = "#bb9af7" }, # Magenta
{ mime = "application/x-xz", fg = "#bb9af7" }, # Magenta
# Documents
{ mime = "application/doc", fg = "#9ece6a" }, # Green
{ mime = "application/pdf", fg = "#9ece6a" }, # Green
{ mime = "application/rtf", fg = "#9ece6a" }, # Green
{ mime = "application/vnd.*", fg = "#9ece6a" }, # Green
# Fallback
{ name = "*", fg = "#c6d0f5" }, # Light gray
{ name = "*/", fg = "#7aa2f7" } # Blue
]
# : }}}

View File

@ -9,3 +9,5 @@
\.gnupg/reader_0.status
\.ssh/known_hosts*
\.ssh/authorized_keys
README.md
LICENSE

View File

@ -1,53 +0,0 @@
# Neovim required
set-option -g focus-events on
set-option -a terminal-features 'alacritty:RGB'
#set -g default-terminal "screen-256color"
set-window-option -g mode-keys vi
# Copy as in vim
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using v and f
bind v split-window -h
bind f split-window -v
unbind '"'
unbind %
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf
# vi-like keybindings
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection
# zenburn theme
#setw -g clock-mode-colour colour117
#setw -g mode-attr bold
#setw -g mode-fg colour117
#setw -g mode-bg colour238
#set -g status-bg colour235
#set -g status-fg colour248
#setw -g window-status-current-fg colour223
#setw -g window-status-current-bg colour237
#setw -g window-status-current-attr bold
#set -g message-attr bold
#set -g message-fg colour117
#set -g message-bg colour235
# fancy status line: user@host, date, time
set-option -g status-right "#(whoami)@#(hostname -s) #[fg=colour187,bold]%a %Y-%m-%d %H:%M"
set -g status-right-length 50
set -g status-left-length 20