Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new option for user defined tmux.conf.local #163

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/helpers/plugin_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,20 @@ _CACHED_TPM_PATH="$(_tpm_path)"
#
_get_user_tmux_conf() {
# Define the different possible locations.
#
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you appear to be using spaces in a file that uses tabs

# Allow user defined config file location
# Add the following to your config file
# set -g @tpm_conf_default_location '/path/to/tmux.conf.local'

user_location="$(tmux show-options -gqv @tpm_conf_default_location)"
xdg_location="$XDG_CONFIG_HOME/tmux/tmux.conf"
default_location="$HOME/.tmux.conf"

# Search for the correct configuration file by priority.
if [ -f "$xdg_location" ]; then
if [ -f "$user_location" ]; then
echo "$user_location"

elif [ -f "$xdg_location" ]; then
echo "$xdg_location"

else
Expand Down