Skip to content
Open
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
16 changes: 12 additions & 4 deletions autoload/tbone.vim
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,18 @@ function! tbone#write_command(bang, line1, line2, count, ...) abort
return 'echoerr '.string('Target pane required')
endif

let keys = join(map(
\ getline(a:line1, a:line2),
\ 'substitute(v:val,"^\\s*","","")'),
\ "\r")
if a:bang
let keys = join(map(
\ getline(a:line1, a:line2),
\ 'v:val'),
\ "\r")
else
let keys = join(map(
\ getline(a:line1, a:line2),
\ 'substitute(v:val,"^\\s*","","")'),
\ "\r")
endif

if a:count > 0
let keys = get(g:, 'tbone_write_initialization', '').keys."\r"
endif
Expand Down
31 changes: 16 additions & 15 deletions doc/tbone.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,31 @@ COMMANDS *tbone*
These commands will be available if and only if tmux is in your PATH.

*tbone-:Tmux*
:Tmux [args] Invoke an arbitrary tmux command.
:Tmux [args] Invoke an arbitrary tmux command.

*tbone-:Tput*
:[line]Tput [buffer] Put the text from the given tmux buffer (default most
recent) after [line] (default current line).
:[line]Tput [buffer] Put the text from the given tmux buffer (default
most recent) after [line] (default current line).

*tbone-:Tyank*
:[range]Tyank [buffer] Yank [range] lines into the given tmux buffer (default
new).
:[range]Tyank [buffer] Yank [range] lines into the given tmux buffer
(default new).

*tbone-:Twrite*
:[range]Twrite [pane] Take the text indicated by [range], strip leading
whitespace, change newlines to carriage returns, and
stuff it into [pane] using `tmux send-keys` (default
previously specified).
:[range]Twrite[!] [pane] Take the text indicated by [range], strip leading
whitespace, change newlines to carriage returns,
and stuff it into [pane] using `tmux send-keys`.
To preserve leading whitespace, use a "!".
(default previously specified).

:Twrite [pane] With no range, sends the current line without a
trailing carriage return.
:Twrite [pane] With no range, sends the current line without a
trailing carriage return.

*tbone-:Tattach*
:Tattach {session} Force use of a particular tmux session. You only need
this if you started Vim outside of tmux.
:Tattach {session} Force use of a particular tmux session. You only
need this if you started Vim outside of tmux.

:Tattach Revert back to the default tmux session. You might
think of this as "detaching".
:Tattach Revert back to the default tmux session. You might
think of this as "detaching".

vim:tw=78:et:ft=help:norl: