Skip to content

Instantly share code, notes, and snippets.

@ogavrisevs
Last active October 17, 2022 09:03
Show Gist options
  • Save ogavrisevs/4342ffc52e310fbf5bfa50adeb4c600e to your computer and use it in GitHub Desktop.
Save ogavrisevs/4342ffc52e310fbf5bfa50adeb4c600e to your computer and use it in GitHub Desktop.
.tmux.conf
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add;
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
echo "SSH_ENV : $SSH_ENV"
echo "SSH_AGENT_PID : $SSH_AGENT_PID"
echo "SSH_AUTH_SOCK : $SSH_AUTH_SOCK"
# remap prefix to Control + a
unbind C-b
set -g prefix C-a
bind C-a send-prefix
#set-option -ga terminal-overrides ",xterm-256color:Tc"
#set-option -g status-position top
# vi for copy -> tmux list-keys -T copy-mode-vi
setw -g mode-keys vi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment