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

Use set -ga @plugin instead of manually parsing the conf?! #77

Closed
blueyed opened this issue May 1, 2016 · 7 comments
Closed

Use set -ga @plugin instead of manually parsing the conf?! #77

blueyed opened this issue May 1, 2016 · 7 comments

Comments

@blueyed
Copy link

blueyed commented May 1, 2016

I've wondered why set -g @plugin is used, which then needs to get parsed manually from the config (

tpm_plugins_list_helper() {
# lists plugins from @tpm_plugins option
echo "$(tmux start-server\; show-option -gqv "$tpm_plugins_variable_name")"
# read set -g @plugin "tmux-plugins/tmux-example-plugin" entries
_tmux_conf_contents "full" |
awk '/^ *set(-option)? +-g +@plugin/ { gsub(/'\''/,""); gsub(/'\"'/,""); print $4 }'
}
), and not just set -ga @plugin (or set -ga @plugins) so that the @plugin/@plugins var could be used as-is then.

(I am not using tpm myself, but came here via christoomey/vim-tmux-navigator#123).

@blueyed
Copy link
Author

blueyed commented May 1, 2016

Oh, that's possible with @tpm_plugins, right?

@ashb
Copy link

ashb commented May 3, 2016

This also break my set up -- I don't have a ~/.tmux.conf -- instead I have tmux aliased to tmux -f /Users/ash/etc/tmux/tmux.conf so tpm won't load any of my plugins.

@ashb
Copy link

ashb commented May 3, 2016

https://github.com/tmux-plugins/tpm/blob/master/docs/tpm_not_working.md and #57.

In summary: cos for when it works this syntax is nicer. And as for -ga: it doesn't seem to work on "custom" fields:

$ tmux set -g @plugin 'foo'; tmux show-option -g @plugin; tmux set -ga @plugin 'foo2'; tmux show-option -g @plugin;
@plugin "foo"
@plugin "foo2"

@bruno-
Copy link
Member

bruno- commented Aug 21, 2016

As @ashb said, tmux does not accept the -a flag for user options (the ones starting with @).

I've asked about this on a mailing list a while ago and tmux maintainers were not interested in adding this one 😞

@bruno- bruno- closed this as completed Aug 21, 2016
@bruno-
Copy link
Member

bruno- commented Aug 21, 2016

Btw yes, if tmux had this feature, we would not have to custom-parse .tmux.conf in order to have nicer syntax.

@augustobmoura
Copy link

augustobmoura commented May 15, 2020

BTW tmux added this feature a long time ago tmux/tmux#533 and the command returns it correctly now:

$ tmux set -g @plugin 'foo'; tmux show-option -g @plugin; tmux set -ga @plugin 'foo2'; tmux show-option -g @plugin;
@plugin "foo"
@plugin "foofoo2"

Anyway we getting this behind a flag? maybe set -g @tpm_use_append true and plugin setting like set -ga @plugin ':repo/plugin'?

My tmux script is splitted and is really difficult to get plugins working in different files

@FranklinYu
Copy link
Contributor

@augustobmoura See #85 for follow-up on this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants