diff --git a/CHANGELOG.md b/CHANGELOG.md index 0021727..d65bb6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### master - refactor `shared_set_tpm_path_constant` function +- move all instructions to `docs/` dir ### v2.0.0, 2015-07-07 - enable overriding default key bindings diff --git a/README.md b/README.md index bc44f39..6a28c34 100644 --- a/README.md +++ b/README.md @@ -73,8 +73,9 @@ More advanced features and instructions, regular users probably do not need this: - [How to create a plugin](docs/how_to_create_plugin.md). It's easy. -- [Installing plugins via the command line](https://github.com/tmux-plugins/tpm/wiki/Installing-plugins-via-the-command-line-only) -- [Changing plugins install dir](https://github.com/tmux-plugins/tpm/wiki/Changing-plugins-install-dir) +- [Installing plugins via the command line](docs/installing_plugins_via_cmd_line.md) +- [Changing plugins install dir](docs/changing_plugins_install_dir.md) +- [Automatic TPM installation](docs/automatic_tpm_installation.md) ### Tests diff --git a/docs/automatic_tpm_installation.md b/docs/automatic_tpm_installation.md new file mode 100644 index 0000000..22ded34 --- /dev/null +++ b/docs/automatic_tpm_installation.md @@ -0,0 +1,12 @@ +# Automatic tpm installation + +One of the first things we do on a new machine is cloning our dotfiles. Not everything comes with them though, so for example `tpm` most likely won't be installed. + +If you wanna install `tpm` 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" \ + "run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm'" +``` + +This useful tip was submitted by @acr4. diff --git a/docs/changing_plugins_install_dir.md b/docs/changing_plugins_install_dir.md new file mode 100644 index 0000000..93af675 --- /dev/null +++ b/docs/changing_plugins_install_dir.md @@ -0,0 +1,14 @@ +# Changing plugins install dir + +By default, TPM installs plugins to `~/.tmux/plugins/`. + +You can change the install path by putting this in `.tmux.conf`: + + set-environment -g TMUX_PLUGIN_MANAGER_PATH '/some/other/path/' + +Tmux plugin manager initialization in `.tmux.conf` should also be updated: + + # initializes TMUX plugin manager in a new path + run /some/other/path/tpm/tpm + +Please make sure that the `run` line is at the very bottom of `.tmux.conf`. diff --git a/docs/installing_plugins_via_cmd_line.md b/docs/installing_plugins_via_cmd_line.md new file mode 100644 index 0000000..d2fdbf7 --- /dev/null +++ b/docs/installing_plugins_via_cmd_line.md @@ -0,0 +1,20 @@ +# Installing plugins via the command line only + +### From inside tmux + +When you have `tmux` running, plugins can be installed with the following command: + + ~/.tmux/plugins/tpm/scripts/install_plugins.sh + +This is the equivalent of pressing `prefix + I`. + +### From outside tmux + +To install the plugins when `tmux` is not even started (for example in a provisioning script): + + # start tmux and create a session but don't attach to it + tmux new-session -d + # install the plugins + tmux run "~/.tmux/plugins/tpm/scripts/install_plugins.sh" + # killing the session is not required + tmux kill-session