3.8 KiB
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: The terminal multiplexer itself
- git: The git version control system
- tpm: The tmux plugin manager
- lazygit: A simple text based UI for using git
- helix: A postmodern text editor. Replaces vim/neovim.
- 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: A commandline yaml parser. Required by tmux nerd font window name plugin.
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:
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:
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.