Tmux: Difference between revisions
imported>Crodjer No edit summary |
Dangerflask (talk | contribs) →Global configuration: Add trailing ; to code blocks |
||
| (4 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
[https://github.com/tmux/tmux/wiki tmux] is a "terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. ''tmux'' may be detached from a screen and continue running in the background, then later reattached." | |||
== Global configuration == | == Global configuration == | ||
{{nixos:package|tmux}} can be configured globally from <code>/etc/nixos/configuration.nix</code>. | |||
As an example: | As an example: | ||
| Line 14: | Line 14: | ||
... | ... | ||
''; | ''; | ||
} | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Note that <code>extraConfig</code> writes directly to <code>/etc/tmux.conf</code> | Note that <code>extraConfig</code> writes directly to <code>/etc/tmux.conf</code> | ||
=== Using Plugins === | === Using Plugins === | ||
Tmux plugins can be also configured using <code>programs.tmux.plugins</code>. They can be found as NixOS packages: [https://search.nixos.org/packages? | |||
Tmux plugins can be also configured using <code>programs.tmux.plugins</code>. They can be found as NixOS packages: [https://search.nixos.org/packages?type=packages&query=tmuxPlugins tmuxPlugins]. Each of the tmux plugin is run via <code>run-shell</code> automatically. | |||
Some plugins need to be run after having had some custom configuration done>, but extraConfig gets executed after. For example <code>tmuxPlugins.cpu</code> needs the status line be declared before the plugin is run. For that scenario, <code>run-shell</code> can be added within <code>extraConfig</code>: | Some plugins need to be run after having had some custom configuration done>, but extraConfig gets executed after. For example <code>tmuxPlugins.cpu</code> needs the status line be declared before the plugin is run. For that scenario, <code>run-shell</code> can be added within <code>extraConfig</code>: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
| Line 32: | Line 33: | ||
run-shell ${pkgs.tmuxPlugins.cpu}/share/tmux-plugins/cpu/cpu.tmux | run-shell ${pkgs.tmuxPlugins.cpu}/share/tmux-plugins/cpu/cpu.tmux | ||
''; | ''; | ||
} | }; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 43: | Line 44: | ||
* [https://wiki.archlinux.org/index.php/Tmux Arch Wiki page on tmux] | * [https://wiki.archlinux.org/index.php/Tmux Arch Wiki page on tmux] | ||
* [https://github.com/tmux/tmux tmux repository] | * [https://github.com/tmux/tmux tmux repository] | ||
[[Category:CLI Applications]] | |||