tmuxrc/README.md

144 lines
4 KiB
Markdown
Raw Normal View History

2023-03-18 19:35:56 +01:00
# [tmuxrc][tmuxrc_repo]
![Tmux](https://img.shields.io/badge/tmux-v3.3-brightgreen)
![Fzf](https://img.shields.io/badge/fzf-v0.35-green)
2023-03-18 19:45:23 +01:00
**tmuxrc** is a collection of [RUNCOM][RUNCOM] & Plugins dedicated to the terminal multiplexer [Tmux][TMUX_repo].
2023-03-18 19:35:56 +01:00
- I use this configuration with my custom [bash environment][bashrc_repo] to always work in Tmux locally and in SSH sessions.
----
## Features
2023-03-18 19:45:23 +01:00
- Plugins (included as submodules):
- [tpm][tpm]: Plugin Manager.
- [tmux-prefix-highlight][tmux-prefix-highlight]: highlights when you press tmux prefix key.
- [tmux-menus][tmux-menus]: Popup menus.
- [extrakto][extrakto]: quickly select, copy/insert/complete text without a mouse.
- [tmux-sidebar][tmux-sidebar]: directory tree for the current path.
- Usage of tmux popups & fzf.
- Some defaults are now rewrittent as toggle modes, like sync or zoom.
- Simple color theme with true colors.
- Compatible with my environment config: [bashrc][bashrc_repo].
2023-03-18 19:35:56 +01:00
- Check more in the conf file ...
## Requirements
- [Tmux][TMUX_repo] 3.3+:
- libevent 2.x (apt or [build][libevent_repo])
- ncurses (apt or [build][ncurses_repo])
- [Gitmux][gitmux_repo]
- [Fzf][fzf_repo] 0.35+ for `fzf-tmux`
### Recommended
- bash 5+
- bash_completion
- My environment config: [bashrc][bashrc_repo]
## Installation
2023-03-18 19:45:23 +01:00
### [Tmux][TMUX_repo]
2023-03-18 19:35:56 +01:00
- With APT:
```bash
# chech version with apt
sudo apt show tmux 2> /dev/null | grep Version:
# if your apt repositories deliver at least 3.3, you can install it
sudo apt install tmux
```
- Or build & install:
```bash
mkdir -p $HOME/Builds && cd $HOME/Builds
wget https://github.com/tmux/tmux/releases/download/3.3a/tmux-3.3a.tar.gz
tar -zxf tmux-*.tar.gz
cd tmux-*/
./configure
2023-03-18 19:45:23 +01:00
make && sudo make install
2023-03-18 19:35:56 +01:00
```
2023-03-18 19:45:23 +01:00
### [Gitmux][gitmux_repo]
2023-03-18 19:35:56 +01:00
- Copy it manually to /usr/local/bin: https://github.com/arl/gitmux/releases
2023-03-18 19:45:23 +01:00
- Or you need `jq` to parse the latest release in cli:
2023-03-18 19:35:56 +01:00
```bash
# for linux_amd64
sudo apt install jq
_RELEASES=$(curl -s https://api.github.com/repos/arl/gitmux/releases/latest)
_URL=$(echo "$_RELEASES" | jq -r '.assets[] | select( .name | match("linux_amd64")) | .browser_download_url')
wget -c -nv "$_URL" -O - | sudo tar --no-same-owner -xzv -C /usr/local/bin gitmux
```
2023-03-18 19:45:23 +01:00
### [Fzf][fzf_repo]
2023-03-18 19:35:56 +01:00
- With APT:
```bash
# chech version with apt
sudo apt show fzf 2> /dev/null | grep Version:
# if your apt repositories deliver at least 0.35, you can install it
sudo apt install tmux
```
- Or build & install:
```bash
mkdir -p $HOME/Builds && cd $HOME/Builds
git clone --depth 1 https://github.com/junegunn/fzf.git
cd fzf
sudo ./install --all --no-bash --no-zsh --no-fish
sudo cp shell/completion.bash /etc/bash_completion.d/fzf
sudo cp bin/* /usr/local/bin/
```
2023-03-18 19:45:23 +01:00
### [tmuxrc][tmuxrc_repo]
2023-03-18 19:35:56 +01:00
```bash
# backup current files
mkdir -p $HOME/.backups
cp -r --backup=t {"$HOME"/.tmux/,"$HOME"/.tmux,"$HOME"/.config/tmux/} $HOME/.backups/
rm -Rf "$HOME"/.tmux/ "$HOME"/.tmux "$HOME"/.config/tmux/
2023-03-18 19:45:23 +01:00
# install
2023-03-18 19:35:56 +01:00
mkdir -p $HOME/.config
cd $HOME/.config
git clone --depth=1 --recurse-submodules https://git.tkapias.net/tkapias/tmuxrc
```
## Configuration
### SSH/Remote
2023-03-18 19:45:23 +01:00
If you install this configuration on a remote system, you will need another prefix than on the local tmux (ctrl+x).
2023-03-18 19:35:56 +01:00
2023-03-18 19:45:23 +01:00
You can change the prefix to ctrl+w on the remote system like this:
2023-03-18 19:35:56 +01:00
```bash
sed -i -e 's/C-x/C-w/g' -e 's/Ctrl-x/Ctrl-w/g' $HOME/.tmux.conf
```
----
[//]: # (LINKS)
[tmuxrc_repo]: https://git.tkapias.net/tkapias/tmuxrc
[TMUX_repo]: https://github.com/tmux/tmux
[bashrc_repo]: https://git.tkapias.net/tkapias/bashrc
[RUNCOM]: https://en.wikipedia.org/wiki/RUNCOM
[libevent_repo]: https://github.com/libevent/libevent/releases/latest
[ncurses_repo]: https://invisible-mirror.net/archives/ncurses/
[gitmux_repo]: https://github.com/arl/gitmux
2023-03-18 19:45:23 +01:00
[fzf_repo]: https://github.com/junegunn/fzf.git
2023-03-18 19:35:56 +01:00
[tpm]: https://github.com/tmux-plugins/tpm
[tmux-prefix-highlight]: https://github.com/tmux-plugins/tmux-prefix-highlight
[tmux-menus]: https://github.com/jaclu/tmux-menus
[extrakto]: https://github.com/laktak/extrakto
[tmux-sidebar]: https://github.com/tmux-plugins/tmux-sidebar