Switch to zellij
This commit is contained in:
parent
e5896223ea
commit
b2f5c0e61e
|
@ -1,3 +1,38 @@
|
||||||
|
# set zellij tab title
|
||||||
|
function current_dir() {
|
||||||
|
local current_dir=$PWD
|
||||||
|
if [[ $current_dir == $HOME ]]; then
|
||||||
|
current_dir="~"
|
||||||
|
else
|
||||||
|
current_dir=${current_dir##*/}
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo $current_dir
|
||||||
|
}
|
||||||
|
|
||||||
|
function change_tab_title() {
|
||||||
|
local title=$1
|
||||||
|
command nohup zellij action rename-tab $title >/dev/null 2>&1
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_tab_to_working_dir() {
|
||||||
|
local result=$?
|
||||||
|
local title=$(current_dir)
|
||||||
|
|
||||||
|
change_tab_title $title
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_tab_to_command_line() {
|
||||||
|
local cmdline=$1
|
||||||
|
change_tab_title $cmdline
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -n $ZELLIJ ]]; then
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
add-zsh-hook precmd set_tab_to_working_dir
|
||||||
|
add-zsh-hook preexec set_tab_to_command_line
|
||||||
|
fi
|
||||||
|
|
||||||
# load Cargo
|
# load Cargo
|
||||||
if [ -f "$HOME/.cargo/env" ]; then
|
if [ -f "$HOME/.cargo/env" ]; then
|
||||||
. "$HOME/.cargo/env"
|
. "$HOME/.cargo/env"
|
||||||
|
|
|
@ -11,10 +11,10 @@ in
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./eza.nix
|
./eza.nix
|
||||||
./jq.nix
|
./jq.nix
|
||||||
./tmux.nix
|
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
./fzf.nix
|
./fzf.nix
|
||||||
|
./zellij.nix
|
||||||
./packages-min.nix
|
./packages-min.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
home.sessionVariables = {
|
||||||
|
ZELLIJ_AUTO_EXIT = "true";
|
||||||
|
};
|
||||||
|
|
||||||
programs.zellij= {
|
programs.zellij= {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableZshIntegration = true;
|
||||||
|
|
Loading…
Reference in New Issue