diff --git a/autoload/tbone.vim b/autoload/tbone.vim index 0545125..ecef058 100644 --- a/autoload/tbone.vim +++ b/autoload/tbone.vim @@ -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 diff --git a/doc/tbone.txt b/doc/tbone.txt index b2514d3..eb99604 100644 --- a/doc/tbone.txt +++ b/doc/tbone.txt @@ -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: