tmux session fzf
This commit is contained in:
parent
3255b770d5
commit
d6db0e4b48
@ -190,5 +190,5 @@ bind -T copy-mode-vi WheelDownPane select-pane \; send-keys -X -N 2 scroll-down
|
||||
|
||||
|
||||
# Session managment
|
||||
bind a display-popup -w 80% -h 80% -EE -T ' Attach existing session ' '~/.local/bin/tmux_choose_session.sh'
|
||||
bind s display-popup -EE -w 30% -h 70% -T ' Start new session ' '~/.local/bin/tmux_start_session.sh'
|
||||
bind s display-popup -EE -w 80% -h 80% -T 'Attach existing session' '~/.local/bin/tmux_choose_session.sh'
|
||||
bind a display-popup -EE -w 80% -h 80% -T 'Start new session' '~/.local/bin/tmux_start_session.sh'
|
||||
@ -1,14 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
|
||||
readonly TMUX_SESSIONS="${HOME}/.tmux"
|
||||
export FZF_DEFAULT_OPTS="\
|
||||
--cycle \
|
||||
--pointer='' \
|
||||
--marker='+' \
|
||||
--color='pointer:green' \
|
||||
--bind \
|
||||
ctrl-/:toggle-preview,\
|
||||
ctrl-p:preview-up,\
|
||||
ctrl-n:preview-down,\
|
||||
ctrl-u:clear-query,\
|
||||
ctrl-q:toggle+down\
|
||||
"
|
||||
|
||||
declare -r TMUX_SESSIONS="${HOME}/.tmux"
|
||||
|
||||
declare sessions
|
||||
sessions="$(find "${TMUX_SESSIONS}/" -type f -executable)"
|
||||
readonly sessions
|
||||
|
||||
declare session_file
|
||||
session_file="$(echo "${sessions}" | xargs -n 1 basename | fzf +m)"
|
||||
session_file="$(echo "${sessions}" | xargs -n 1 basename | fzf +m --preview-window 70% --preview "cat '${TMUX_SESSIONS}/{1}'")"
|
||||
readonly session_file
|
||||
|
||||
if [[ -n "${session_file}" ]]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user