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

Update automatic tpm installation instructions to avoid linting error #234

Open
wants to merge 2 commits 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
4 changes: 2 additions & 2 deletions docs/automatic_tpm_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ One of the first things we do on a new machine is cloning our dotfiles. Not ever
If you want to install `tpm` and plugins automatically when tmux is started, put the following snippet in `.tmux.conf` before the final `run '~/.tmux/plugins/tpm/tpm'`:

```
if "test ! -d ~/.tmux/plugins/tpm" \
if-shell "test ! -d ~/.tmux/plugins/tpm" \
Copy link
Member

Choose a reason for hiding this comment

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

if without then is valid tmux conf syntax.
I think VS code lint is complaining because it thinks this snippet is shell script.

Can you change the language for this snippet to be tmux and see what happens?
Try adding tmux like this at the top:

```tmux

I'd prefer to keep the current shorter if version because it's more succinct.

Copy link
Author

@lobis lobis Nov 15, 2022

Choose a reason for hiding this comment

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

Personally I like the more verbose keyword as it's easy to look up for a newcomer like me. At first I didn't know what that if meant, didn't even know tmux had its own language. I guess using if-shell a user is more likely to find the correct documentation page using a search engine, but its a matter of opinion of course!

EDIT: I checked and VSCode by default does not detect the language of the .tmux.conf file, but does not give errors if you do use the full keywords such as shell-if. I guess because its not colliding with reserved keywords such as if.

After installing a VSCode extension for tmux, the language is correctly detected and no errors are thrown regardless of the if keyword.

"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
```

This useful tip was submitted by @acr4 and narfman0.
This useful tip was submitted by [@acr4](https://github.com/acr4) and [@narfman0](https://github.com/narfman0).