diff --git a/common/bin/bp b/common/bin/bp new file mode 100755 index 0000000..d3c155e --- /dev/null +++ b/common/bin/bp @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +printf '\e[?2004h' +printf '\e[?2004l' +echo bp off + diff --git a/common/bin/tmux-edit-buffer b/common/bin/tmux-edit-buffer new file mode 100755 index 0000000..c24e6b9 --- /dev/null +++ b/common/bin/tmux-edit-buffer @@ -0,0 +1,4 @@ +#!/usr/bin/env sh + +f="$(tmux-save-buffer)" +tmux new-window "$EDITOR $f" diff --git a/common/bin/tmux-save-buffer b/common/bin/tmux-save-buffer index fd49508..45698c8 100755 --- a/common/bin/tmux-save-buffer +++ b/common/bin/tmux-save-buffer @@ -1,10 +1,9 @@ #!/usr/bin/env sh -sess="$1"; shift d="$(date +%Y-%m-%d_%H-%M-%S)" -f="${USER_LOGS_PATH}/${d}.${sess}.tmux-buffer.log" +f="${USER_LOGS_PATH}/${d}.tmux-buffer.log" mkdir -p "$(dirname "$f")" touch "$f" chmod 600 "$f" tmux capture-pane -pS -1000000000 > "$f" -echo "Saved pane output to $f" +echo "$f" diff --git a/common/fish/config.fish b/common/fish/config.fish index c149ec2..c041f22 100755 --- a/common/fish/config.fish +++ b/common/fish/config.fish @@ -71,4 +71,8 @@ if not set --query ZELLIJ && set --query FISH_START_ZELLIJ kill $fish_pid else if not set --query TMUX && set --query FISH_START_TMUX tmux att -t default || tmux new -s default +end + +if set --query TMUX + bp end \ No newline at end of file diff --git a/common/fish/functions.fish b/common/fish/functions.fish index 22193dc..afad43a 100644 --- a/common/fish/functions.fish +++ b/common/fish/functions.fish @@ -205,7 +205,7 @@ function __ssh_agent_start -d "start a new ssh agent" end if set --query KITTY_PID - # alias ssh "kitty +kitten ssh" + alias kssh "kitty +kitten ssh" end function fish_ssh_agent --description "Start ssh-agent if not started yet, or uses already started ssh-agent." diff --git a/common/kitty/kitty.conf b/common/kitty/kitty.conf index 4f4dc0c..f4a3d2e 100644 --- a/common/kitty/kitty.conf +++ b/common/kitty/kitty.conf @@ -38,23 +38,23 @@ map shift+insert paste_from_clipboard map ctrl+shift+v paste_from_selection map ctrl+shift+c copy_to_clipboard -map ctrl+shift+j launch --location=hsplit --cwd=current -map ctrl+shift+l launch --location=vsplit --cwd=current - # kill pane map ctrl+shift+q close_window # kill tab map ctrl+alt+shift+q close_tab -map ctrl+alt+shift+k move_window up -map ctrl+alt+shift+h move_window left -map ctrl+alt+shift+l move_window right -map ctrl+alt+shift+j move_window down - -map ctrl+h neighboring_window left -map ctrl+l neighboring_window right -map ctrl+k neighboring_window up -map ctrl+j neighboring_window down +# map ctrl+shift+j launch --location=hsplit --cwd=current +# map ctrl+shift+l launch --location=vsplit --cwd=current +# +# map ctrl+alt+shift+k move_window up +# map ctrl+alt+shift+h move_window left +# map ctrl+alt+shift+l move_window right +# map ctrl+alt+shift+j move_window down +# +# map ctrl+h neighboring_window left +# map ctrl+l neighboring_window right +# map ctrl+k neighboring_window up +# map ctrl+j neighboring_window down map ctrl+shift+n nth_window -1 map ctrl+shift+space>u kitten hints --type=url --program @ diff --git a/common/tmux/conf b/common/tmux/conf index 2586195..ed9b844 100644 --- a/common/tmux/conf +++ b/common/tmux/conf @@ -1,38 +1,38 @@ unbind C-b set -g prefix C-s -bind s send-prefix -bind v split-window -h -c "#{pane_current_path}" -bind b split-window -c "#{pane_current_path}" +set -g update-environment "WAYLAND_DISPLAY DISPLAY" -bind T source-file "$HOME/.tmux.conf" \; display-message "Reloaded $HOME/.tmux.conf" - -# dump buffer contents to file -bind O display-message "#(tmux-save-buffer '#S')" -# TODO: dump buffer to file and open in EDITOR? +bind R source-file "$HOME/.tmux.conf" \; display-message "Reloaded $HOME/.tmux.conf" +bind o display-message "Saved pane output to #(tmux-save-buffer '#S')" +bind O run "tmux-edit-buffer" bind D attach-session -t . -c '#{pane_current_path}' \; display-message "Set session path to #{pane_current_path}" -# toggle status bar -bind H set -s status +bind H set -s status # toggle status bar + +bind v split-window -h -c "#{pane_current_path}" +bind b split-window -c "#{pane_current_path}" +bind h split-window -c "#{pane_current_path}" -# pane navigation bind -n C-l select-pane -R bind -n C-k select-pane -U + bind -n C-j select-pane -D +# enabling a ^J hotkey causes breakage when pasting anything that start with a newline, since it triggers the hotkey and some weird interaction with bracketed paste causes the pane to enter a broken state + bind -n C-h select-pane -L +bind -n C-M-l split-window -h -c "#{pane_current_path}" +bind -n C-M-j split-window -v -c "#{pane_current_path}" + # tab creation bind -n C-t new-window -bind Tab next-window # tab nav is the default p and n binds # window switcher is the default w bind -# session switcher -bind s run "tmux split-window -l 12 'tmuxswitcher'" - -set -g update-environment "WAYLAND_DISPLAY DISPLAY" +bind s run "tmux split-window -l 12 'tmuxswitcher'" # session switcher set -g mouse on set -g escape-time 0 @@ -44,11 +44,10 @@ set -g activity-action none set -g mode-keys vi set -g history-limit 1000000 + set -g status on set -g status-position bottom set -g status-style "fg=colour8 bg=default" -# set -g status-bg default -# set -g status-fg colour8 set -g status-interval 5 set -g status-left-length 50 set -g window-status-style "fg=colour8 bg=default" @@ -59,12 +58,8 @@ set -g window-status-bell-style "fg=colour1 bg=default" set -g window-status-current-style "fg=colour4 bg=default" set -g window-status-current-format " #W " set -g status-left "#h:#S " -set -g status-right "" - # set -ag status-right "#(pwd | $XDG_CONFIG_HOME/lytedev-dotfiles/common/bin/glancepath) " - set -ag status-right "#(kubeline && printf ' ')" +set -g status-right "#(kubeline && printf ' ')" set -g status-left-length 1000 -# set -g status-right-length 280 - # set -ag status-right "#{pane_current_command}" set -g message-style "fg=colour7 bg=default" set -g pane-active-border-style fg=blue @@ -78,11 +73,11 @@ set -g window-status-current-format "#W" # present a menu of urls to open from the visible pane # TODO: fuzzy search this # bind u capture-pane \;\ -# save-buffer /tmp/tmux-buffer \;\ -# split-window -l 10 "urlscan /tmp/tmux-buffer" + # save-buffer /tmp/tmux-buffer \;\ + # split-window -l 10 "urlscan /tmp/tmux-buffer" -bind -T copy-mode-vi "y" send-keys -X copy-pipe-no-clear 'wl-copy' \; display-message 'Copied to clipboard!' -bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear 'wl-copy' \; display-message 'Copied to clipboard!' +bind -T copy-mode-vi "y" send-keys -X copy-pipe-no-clear 'clip' \; display-message 'Copied to clipboard!' +bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-no-clear 'clip' \; display-message 'Copied to clipboard!' bind K kill-pane bind C-S-k kill-window