Skip to content

Commit

Permalink
pass -c ":set syntax=tmux" when opening $EDITOR with <prefix>+e, reso…
Browse files Browse the repository at this point in the history
…lves gpakosz#667
  • Loading branch information
gpakosz committed Nov 28, 2023
1 parent b787748 commit 42adc35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .tmux.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ setw -q -g utf8 on
set -g history-limit 5000 # boost history

# edit configuration
bind e new-window -n "#{TMUX_CONF_LOCAL}" -e "EDITOR=$EDITOR" sh -c '${EDITOR:-vim} "$TMUX_CONF_LOCAL" && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'
bind e new-window -n "#{TMUX_CONF_LOCAL}" -e "EDITOR=$EDITOR" sh -c 'case "${EDITOR:-vim}" in *vim) ${EDITOR:-vim} -c ":set syntax=tmux" "$TMUX_CONF_LOCAL";; *) "$EDITOR" "$TMUX_CONF_LOCAL";; esac && "$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF" \; display "$TMUX_CONF_LOCAL sourced"'

# reload configuration
bind r run '"$TMUX_PROGRAM" ${TMUX_SOCKET:+-S "$TMUX_SOCKET"} source "$TMUX_CONF"' \; display "#{TMUX_CONF} sourced"
Expand Down

0 comments on commit 42adc35

Please sign in to comment.