-
Couldn't load subscription status.
- Fork 361
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Sorry to pollute the issue queue with this but I wasn't sure where else to put it.
I wrote a couple of simple bash functions that make it easy to pull up and edit a cheat document in a new pane and close it from the command line when using tmux. Maybe it could be included in the documentation somewhere.
tmux_cheat_page() {
if [[ "$TERM" =~ 'screen' ]] && [[ -n "$CHEAT_EDITOR" ]]; then
pane=$(tmux showw -v @tmux_cheat_pane)
output=$(tmux list-panes -t ${pane} 2>&1)
if [[ $pane ]] && ! [[ -z "$pane" ]] && ! [[ $output =~ 'find pane' ]]; then
tmux -q respawn-pane -k -t $pane cheat -e $1
else
tmux split-window -vf cheat -e $1
pane=$(tmux display-message -p "#{pane_id}")
tmux setw @tmux_cheat_pane $pane
tmux select-pane -t {last}
fi
fi
}
tmux_cheat_page_close() {
pane=$(tmux showw -v @tmux_cheat_pane)
if [ $pane ]; then
tmux kill-pane -t $pane
fi
}
export -f tmux_cheat_page
export -f tmux_cheat_page_close
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation