dotfiles/.tmux
Oliver Davies e8d3e1b5a2 Don't load Telescope by default
Sometimes I want to use Harpoon files or a different Telescope picker.
2024-01-07 22:01:51 +00:00

24 lines
542 B
Bash
Executable file

#!/usr/bin/env bash
set -o errexit
set -o nounset
session_name="${1:-dotfiles}"
session_path="${2:-$(pwd)}"
if tmux has-session -t="${session_name}" 2> /dev/null; then
tmux attach -t "${session_name}"
exit
fi
tmux new-session -d -s "${session_name}" -n vim -c "${session_path}"
# 1. Main window: Vim
tmux send-keys -t "${session_name}:vim" "nvim" Enter
# 2. General shell use.
tmux new-window -t "${session_name}" -c "${session_path}"
tmux switch-client -t "${session_name}:vim.left" ||
tmux attach -t "${session_name}:vim.left"