Compare commits
4 Commits
fdaa327ab8
...
efd2771d8c
| Author | SHA1 | Date | |
|---|---|---|---|
| efd2771d8c | |||
| 94331531e2 | |||
| 5b1e7efcd2 | |||
| 730dd23967 |
@@ -1 +0,0 @@
|
||||
set -g status-style bg=colour12,fg=colour0
|
||||
@@ -70,8 +70,6 @@ set -g status-right '#(uptime | cut -f 4-5 -d " " | cut -f 1 -d ",") %a %l:%M:%S
|
||||
|
||||
set -g default-terminal "tmux-256color"
|
||||
|
||||
set-hook -g after-new-session 'if -F "#{==:#{session_name},ssh}" "source ${XDG_CONFIG_HOME}/tmux/hooks/tmux.ssh.conf" "source ${XDG_CONFIG_HOME}/tmux/hooks/tmux.regular.conf"'
|
||||
|
||||
# Vi copypaste mode
|
||||
if-shell "test '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -ge 4 \)'" 'bind-key -Tcopy-mode-vi v send -X begin-selection; bind-key -Tcopy-mode-vi y send -X copy-selection-and-cancel'
|
||||
if-shell '\( #{$TMUX_VERSION_MAJOR} -eq 2 -a #{$TMUX_VERSION_MINOR} -lt 4\) -o #{$TMUX_VERSION_MAJOR} -le 1' 'bind-key -t vi-copy v begin-selection; bind-key -t vi-copy y copy-selection'
|
||||
|
||||
@@ -11,9 +11,5 @@
|
||||
enable = true;
|
||||
extraConfig = builtins.readFile (dotsPath + "/.config/tmux/tmux.conf");
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".config/tmux/hooks/tmux.ssh.conf".source = dotsPath + "/.config/tmux/hooks/tmux.ssh.conf";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
current_zettel_path="$ZK_PATH/$(cat "$ZK_PATH/current-zettel.txt")"
|
||||
|
||||
if [ -n "$TMUX" ]; then
|
||||
if [ -n "${TMUX:-}" ]; then
|
||||
cd "$ZK_PATH" && $EDITOR "$current_zettel_path"
|
||||
else
|
||||
echo 'Not in tmux'
|
||||
@@ -10,13 +10,9 @@ else
|
||||
read -r -p 'Enter your choice: ' choice
|
||||
case $choice in
|
||||
1)
|
||||
# Check if a tmux session is running with a window named zk
|
||||
if tmux list-windows -F '#{window_name}' | grep -q zk; then
|
||||
# Attach to the session containing the 'zk' window
|
||||
session="$(tmux list-windows -F '#{window_name} #{session_name}' | grep zk | head -n 1 | awk '{ print $2 }')"
|
||||
tmux attach -t "$session"
|
||||
if tmux has-session -t zk 2>/dev/null; then
|
||||
tmux attach -t zk
|
||||
else
|
||||
# Create session with a window named 'zk' and start nvim
|
||||
tmux new-session -s zk -n zk -d
|
||||
tmux send-keys -t zk:zk "cd $ZK_PATH && $EDITOR $current_zettel_path" Enter
|
||||
tmux attach -t zk
|
||||
|
||||
Reference in New Issue
Block a user