Files
tmux/README.md
2025-10-28 20:14:32 +01:00

92 lines
3.8 KiB
Markdown

# TMUX - configuration
## Overview
This project contains a tmux-configuration, that allows loading different
plugins and layouts, that can be used to use tmux in conjunction with the helix
editor as an integrated development environment. It can be used to edit source
code, write texts with LaTeX and many other things. It requires the tmux plugin
manager to be installed, in order to provide all neccessary or desired
extensions.
## Prerequisites
Several packages must be available, in order to run the IDE in different
modes/layouts:
- [tmux](https://github.com/tmux/tmux/wiki): The terminal multiplexer itself
- [git](https://git-scm.com): The git version control system
- [tpm](https://github.com/tmux-plugins/tpm?tab=readme-ov-file): The tmux plugin
manager
- [lazygit](https://github.com/jesseduffield/lazygit): A simple text based UI
for using git
- [helix](https://helix-editor.com): A postmodern text editor. Replaces
vim/neovim.
- [xclip](https://github.com/astrand/xclip): A command line interface for the
system clipboard in X11/wayland
For some plugins, extra tools are required. These are optional, and only needed,
when the plugins are installed:
- [yq](https://github.com/mikefarah/yq): A commandline yaml parser. Required by
[tmux nerd font window name plugin](https://github.com/joshmedeski/tmux-nerd-font-window-name).
## Installation
Before any plugins can be loaded, it is neccesary to install the plugin-manager
itself. This has to be done manually, and can easily be done by using git:
```bash
git submodule add https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
```
Then, the `tmux.conf` file can be used. Make sure, when editing the file, that
the structure of the file is kept. It is mandatory, that the tpm command must
remain at the end of the file at all times for TPM to work properly!
After adding a plugin, press **Ctrl+\<prefix> I** to install the plugins.
## Basic usage
Independent from the layout you use, the basic usage is standard tmux operation.
You can use the tmux commands to split and control windows, and manage your
terminal window layoout. There are, however, some extra functions.
## Manage git
In order to manage your git repositories, without having to switch to a blank
terminal, press `Ctrl+<prefix> g`. This will open `lazygit` in a popup, that
overlays your current layoout. To close the window, all that is needed, is to
quit `lazygit` by pressing `q`.
## Open an ai chat window
To open a chat window to confer with your ai-bot in chatmode, you can easily
open a chatwindow to the left of your main window. To do so, press
`Ctrl+<prefix> a`. To close the window, press `Ctrl+d`.
## Building
Sometime you want to bulild your project. In this configuration a key-binding is
added to the F9 key. Pressing `Ctrl+<prefix> F9` will run a make-script that
tests (in order) for the following build-systems:
- [WAF](https://waf.io)
- [Cargo](https://doc.rust-lang.org/cargo/commands/cargo-build.html)
- [CMake](https://cmake.org/)
- [Automake](https://www.gnu.org/software/automake/)
The process will open a popup window, in which the build is performed. After the
build stops, the window will stay open until a key is pressed.
## Launch different editor layouts
The configuration comes with a script named `hxi`, which is installed into the
` ~/.local/bin` folder. When the script is started, it launches a new tmux
session with a randomised name. In this session, an editor is opened, with the
given parameters. Then the script looks for a file named `.tmux.layout`, which
needs to be an executeable script file. It then sources the file. and finally
attaches to the session, that was created. The sourced `.tmux.layout` file can
be used to create an individual layout for the project folder you're in,
creating new windows and panes, as needed.