This commit is contained in:
2024-04-05 11:49:45 +03:00
parent 8b22261cc0
commit 087c8e372e
2 changed files with 76 additions and 1 deletions

37
tmux/.tmux.conf Normal file
View File

@@ -0,0 +1,37 @@
# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
# available plugins: battery, cpu-usage, git, gpu-usage, ram-usage, tmux-ram-usage, network, network-bandwidth, network-ping, ssh-session, attached-clients, network-vpn, weather, time, mpc, spotify-tui, kubernetes-context, synchronize-panes
set -g @dracula-plugins "cpu-usage ram-usage"
# available colors: white, gray, dark_gray, light_purple, dark_purple, cyan, green, orange, red, pink, yellow
# set -g @dracula-[plugin-name]-colors "[background] [foreground]"
set -g @dracula-cpu-usage-colors "green dark_gray"
set -g @dracula-show-powerline true
# for left
set -g @dracula-show-left-sep 
# for right symbol (can set any symbol you like as separator)
set -g @dracula-show-right-sep 
set -g @dracula-show-flags true
# it can accept `hostname` (full hostname), `session`, `shortname` (short name), `smiley`, `window`, or any character.
set -g @dracula-show-left-icon session
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'

95
tmux/tmux.md Normal file
View File

@@ -0,0 +1,95 @@
# TMUX
## Установка
### tmux
```bash
apt-get install tmux
```
### TPM (Tmux Plugin Manager)
<https://github.com/tmux-plugins/tpm>
```bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
```
добавить в конфиг `~/.tmux.conf`
```bash
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
```
### Dracula Theme
<https://draculatheme.com/tmux>
***Конфиг*** *(пользовательский / системный)*
```bash
~/.tmux.conf
/etc/tmux.conf
```
***Включить поддержку мыши*** *(в конфиг добавить)*
```bash
set -g mouse on
```
***Запуск*** *(без параметров будет создана сессия `0`)*
```bash
tmux
```
новая сессия `session1`. Название отображается снизу-слева в квадратных скобках в статус строке. Далее идет перечисление окон. Текущее окно помечается звездочкой.
```bash
tmux new -s session1
```
***Окна***
`Ctrl+b с` - новое окно
`Ctrl+b w` - список окон. переключиться курсором вверх-вниз
`Ctrl+b &` - закрыть окно, нужно подтвердить `y`
`Ctrl+b {` - переместить активное окно влево по кругу
***Переключение***
`Ctrl+b n` - следующее окно
`Ctrl+b p` - предыдущее окно
`Ctrl+b 0` - переключиться на номер окна
***Деление окна***
`Ctrl+b "` - деление окна горизонтально или `tmux split-window -h`
`Ctrl+b %` - деление окна вертикально или `tmux split-window -v`
`Ctrl+b стрелки` - переход между панелей, либо режим мыши
`Ctrl+b+стрелки` - изменение размеров панелей или `Ctrl+b Ctrl+стрелки`. Или мышью - потянуть за край панели.
`Ctrl+b z` - zoom, выделить окно, повторное нажатие вернёт обратно
`Ctrl+b space` - смена разделения на предопределённые расположения
`Ctrl+d` - закрыть текущее окно
`Ctrl+b x` - закрытие окон, нужно подтвердить `y` или `exit`
***Сессии***
`Ctrl+b d` - отключение от сессии или `tmux detach`
`tmux ls` - список сессий
*Подключиться к работающей сессии*
`tmux attach` - подключение к сессии, либо к единственной, либо последней созданной
`tmux attach -t session1` - подключение к сессии session1
`Ctrl+b s` - выбрать сессию
`tmux kill-session -t session1` - завершение сессии
`tmux kill-server` - завершить все сессии
***
`tmux list-commands` - cписок поддерживаемых команд