Skip to content

Commit

Permalink
Customize tmux
Browse files Browse the repository at this point in the history
- Preserve PWD in new pane/window
- Pressing leander C-Space key second time switch to the previous pane/window
  • Loading branch information
a-b authored and sethboyles committed Feb 27, 2024
1 parent 69f2a32 commit b164711
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions set-up-new-machine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,25 @@ pushd ~/workspace/tmuxfiles
./install
popd

cat <<EOT >> $HOME/.tmux.conf.local
unbind-key C-Space
unbind-key Enter
# TODO: if the current tab runs SSH with nested tmux, second C-Space send conrol key to the nested tmux
bind-key C-Space run "tmux last-pane || tmux last-window || tmux display 'No last pane or window'"
bind-key Enter run "tmux last-window || tmux last-pane || tmux display 'No last window or pane'"
set -g base-index 1
setw -g pane-base-index 1
set -sg escape-time 10
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"
set-environment -g 'SSH_AUTH_SOCK' ~/.ssh/ssh_auth_sock
EOT

# install nvim
if ! command -v nvim &> /dev/null; then
wget https://github.com/neovim/neovim/releases/download/stable/nvim.appimage
Expand Down

0 comments on commit b164711

Please sign in to comment.