mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
fish: rename tmux helper functions
This commit is contained in:
parent
d29efab025
commit
64d001455a
12 changed files with 24 additions and 24 deletions
|
|
@ -1,4 +1,4 @@
|
|||
function __tmux_attach_or_switch \
|
||||
function __tmux-attach-or-switch \
|
||||
--description "Attach (not in tmux) or switch (in tmux) to a session"
|
||||
### Arguments:
|
||||
set session_name $argv[1]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
function __tmux_maybe_create \
|
||||
function __tmux-maybe-create \
|
||||
--description "Create a tmux session with sensible defaults if it doesn't exist yet"
|
||||
### Arguments:
|
||||
set session_name $argv[1]
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
function __tmux_register_session \
|
||||
function __tmux-register-session \
|
||||
--description "Register the session, if it's not set yet"
|
||||
### Effects:
|
||||
set last /tmp/TMUX_LAST
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
function tmux_home \
|
||||
function tmux-home \
|
||||
--description "Take me back to ~"
|
||||
|
||||
set session_name home
|
||||
|
||||
if pgrep tmux 2>&1 >/dev/null
|
||||
__tmux_register_session
|
||||
__tmux-register-session
|
||||
end
|
||||
|
||||
if pgrep tmux 2>&1 >/dev/null; or ! tmux has -t=$session_name 2>/dev/null
|
||||
|
|
@ -14,6 +14,6 @@ function tmux_home \
|
|||
select-window -t "home":1
|
||||
end
|
||||
|
||||
__tmux_attach_or_switch $session_name
|
||||
__tmux-attach-or-switch $session_name
|
||||
|
||||
end
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
function tmux_last \
|
||||
function tmux-last \
|
||||
--description "Toggle the last tmux session"
|
||||
|
||||
set tmux_last /tmp/TMUX_LAST
|
||||
|
|
@ -9,8 +9,8 @@ function tmux_last \
|
|||
|
||||
set session_name (cat $tmux_last)
|
||||
|
||||
__tmux_register_session
|
||||
__tmux_maybe_create $session_name /tmp
|
||||
__tmux_attach_or_switch $session_name
|
||||
__tmux-register-session
|
||||
__tmux-maybe-create $session_name /tmp
|
||||
__tmux-attach-or-switch $session_name
|
||||
|
||||
end
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
function tmux_sessionizer \
|
||||
function tmux-sessionizer \
|
||||
--description "Manage tmux sessions in specific folders with fzf"
|
||||
|
||||
set selected \
|
||||
|
|
@ -46,8 +46,8 @@ function tmux_sessionizer \
|
|||
end
|
||||
|
||||
# effects
|
||||
__tmux_register_session $session_name
|
||||
__tmux_maybe_create $session_name $selected
|
||||
__tmux_attach_or_switch $session_name
|
||||
__tmux-register-session $session_name
|
||||
__tmux-maybe-create $session_name $selected
|
||||
__tmux-attach-or-switch $session_name
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue