Skip to content

Instantly share code, notes, and snippets.

@TAKAyukiatkwsk
Created August 19, 2017 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TAKAyukiatkwsk/629bcdd3e27954afadc1eabda3b208d9 to your computer and use it in GitHub Desktop.
Save TAKAyukiatkwsk/629bcdd3e27954afadc1eabda3b208d9 to your computer and use it in GitHub Desktop.
tmux-plugin-list-sample
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
tmux bind-key T run-shell "$CURRENT_DIR/scripts/tmux_list_plugins.sh"
#!/usr/bin/env bash
# fetching the directory where plugins are installed
plugin_path="$(tmux show-env -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)"
# listing installed plugins
plugins=$(ls -1 "$plugin_path")
for plugin in $plugins; do
head=$(cd "$plugin_path/$plugin"; git log --oneline | head -n 1)
printf "%- 30s%s\n" "$plugin" "$head"
done
@TAKAyukiatkwsk
Copy link
Author

実際は以下のような構成になります。

.
├── my_plugin.tmux
└── scripts
    └── tmux_list_plugins.sh

1 directory, 2 files

@TAKAyukiatkwsk
Copy link
Author

このチュートリアルに少し手を加えたものです。
tpm/how_to_create_plugin.md at master · tmux-plugins/tpm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment