Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions autoload/tpipeline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func tpipeline#initialize()
if !exists('g:tpipeline_fillcentre')
let g:tpipeline_fillcentre = 0
endif
if !exists('g:tpipeline_usepane')
let g:tpipeline_usepane = 0
endif
if !exists('g:tpipeline_autoembed')
let g:tpipeline_autoembed = 1
endif
Expand Down Expand Up @@ -120,19 +123,27 @@ func tpipeline#fork_job()
let s:restore_right = system("tmux display-message -p '#{status-right}'")
endif
let script = printf("while IFS='$\\n' read -r l; do echo \"$l\" > '%s'", s:tpipeline_filepath)
if g:tpipeline_usepane
" end early if file was truncated so as not to overwrite any
" titles of panes we may switch to
let script .= "; if [ -z \"$l\" ]; then continue; fi"
endif
if g:tpipeline_autoembed
for o in g:tpipeline_embedopts
let script = 'tmux set -g ' . o . '; ' . script
endfor
endif
if g:tpipeline_fillcentre
let script .= "; C=$(echo \"$l\" | grep -o 'bg=#[0-9a-f]\\{6\\}'| tail -1)"
if !g:tpipeline_usepane
let script .= "; tmux set -g status-style \"$C\""
endif
endif
if g:tpipeline_split
let script .= printf("; IFS='$\\n' read -r l; echo \"$l\" > '%s'", s:tpipeline_right_filepath)
let script .= printf("; IFS='$\\n' read -r r; echo \"$r\" > '%s'", s:tpipeline_right_filepath)
endif
if g:tpipeline_fillcentre
let script .= "; tmux set -g status-style \"$C\""
if g:tpipeline_usepane
let script .= "; tmux select-pane -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\""
endif
let script .= "; tmux refresh-client -S; done"

Expand Down
1 change: 1 addition & 0 deletions doc/tags
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ g:tpipeline_restore tpipeline.txt /*g:tpipeline_restore*
g:tpipeline_split tpipeline.txt /*g:tpipeline_split*
g:tpipeline_statusline tpipeline.txt /*g:tpipeline_statusline*
g:tpipeline_tabline tpipeline.txt /*g:tpipeline_tabline*
g:tpipeline_usepane tpipeline.txt /*g:tpipeline_usepane*
tpipeline tpipeline.txt /*tpipeline*
tpipeline#state#freeze() tpipeline.txt /*tpipeline#state#freeze()*
tpipeline#state#thaw() tpipeline.txt /*tpipeline#state#thaw()*
Expand Down
12 changes: 12 additions & 0 deletions doc/tpipeline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,18 @@ Configuration *tpipeline-configure*
it will restore the tmux statusline to its previous state
after quitting vim. This feature is disabled by default.

g:tpipeline_usepane *g:tpipeline_usepane*
By default |tpipeline| embeds your vim statusline into your
tmux status bar. Enabling this option will set the tmux
`pane_title` variable to your vim statusline, effectively
embedding the statusline into your active pane border provided
`pane-border-status` and `pane-border-format` are set
accordingly. For example:
>
set -g pane-border-status top
set -g pane-border-format '#{pane_title}'
<

------------------------------------------------------------------------------
Api *tpipeline-api*

Expand Down