85 Commits

Author SHA1 Message Date
Navid Sassan
d218407991 fixed 2021-09-21 17:45:49 +02:00
Chris Toomey
c762cdf21d Send lines one at a time
Previously the VtrSendLinesToRunner command was implemented by joining
the lines together with `\r` newline characters and then sending them
via a single batch `tmux send-keys` call. This caused some REPLs (pry
most notably) to display all the lines at once, and occasionally
mis-handle the sent text.

With this change, each line is now sent via a distinct `tmux send-keys`
call, better approximating a user interacting with the REPL.
2021-06-12 01:38:49 +02:00
navid.sassan
1f3d65e326 added VtrSetCommand function 2020-08-14 15:21:39 +02:00
navid.sassan
9d91062d79 attach pane when there is none instead of error 2020-08-14 15:21:01 +02:00
Tom Meagher
1e8b1d5f7c fix: restore AttachToPane call 2020-05-30 14:44:24 -04:00
Tom
3a0f173620
feat: VtrSendCtrlC and VtrSendKeysRaw (#98)
Co-authored-by: Chris Toomey <chris@ctoomey.com>
2020-05-30 12:45:44 -04:00
Marcus Stollsteimer
e28aa7799a Update docs to match existing key mappings 2020-01-19 14:54:00 -05:00
Gabe Dunn
38d923977c Focus Runner w/o Zooming - Bang Style (#94)
Add bang param on VtrFocusRunner to not zoom the focused pane
2019-10-13 11:27:58 -04:00
Michael Anhari
436b17e62d Update documentation around VtrSendCommandToRunner
Fixes #80.

Updates the helpfile and README to include information about the bang
version of `VtrSendCommandToRunner`.
2019-06-25 14:52:43 -04:00
Michael Anhari
186643da4c Fix typo in docs (#89)
Fixes typo in `VtrStripLeadningWhitespace`.
2019-06-19 08:56:01 -04:00
Chris Toomey
31f2a8aaa7 Allow chaining commands after VtrAttachToPane
Occasionally it can be useful to be able to interact with more than one
REPL at a time. VTR doesn't have official support for this behavior, but
we can combine the `VtrAttachToPane` command and the
`VtrSendLinesToRunner` command to provide rough support for this.

This change updates the `VtrAttachToPane` configuration to support this
chaining.

*Note* this mechanism will only allow for sending single lines.

``` vim
nmap <leader>v1 :VtrAttachToPane 1 \| VtrSendLinesToRunner<cr>
nmap <leader>v2 :VtrAttachToPane 2 \| VtrSendLinesToRunner<cr>
```
2018-11-04 15:03:37 -05:00
Vinod Krishna
b9c630f882 Automatically detect and exit copy mode when sending commands #70 2018-04-16 13:22:07 -04:00
Vinod Krishna
140017a04d Allow specifying the pane index with VtrAttachToPane (fixes #67) 2018-04-16 13:21:28 -04:00
Chris Toomey
30ed8912f5 Add tmux version note to README 2017-06-26 12:07:01 -04:00
Chris Toomey
5ba24952c9 Update install notes to use vim-plug 2017-06-25 17:35:34 -04:00
Michael Anhari
6db978fd0a Add elixir to list of CurrentFiletypeRunners (#72) 2017-04-11 22:08:55 -04:00
Chris Toomey
a7d1717e6b Add MIT License file 2017-01-28 10:59:28 -05:00
rpisharody
5efb5197bb Removed references to the non-existent function VtrSendSelectedToRunner (#64)
from doc/vim-tmux-runner.txt
2016-09-15 18:44:27 -06:00
Andy Waite
98618d2237 Add link to demo from Vim London 2016-02-27 08:45:30 +00:00
Dain Miller
3246f75827 Update vim-tmux-runner.txt 2015-10-17 02:08:43 -04:00
Raine Virta
9b9c8f70bb fix g:vtr_filetype_runner_overrides typo 2015-06-09 10:58:15 +03:00
Chris Toomey
515f7d8730 Prevent kill wrong background window
Closes #37 - Check for detached window title before killing
2015-02-07 00:14:53 -05:00
Chris Toomey
0a80e5bc67 Add VtrSendFile command and docs
Closes #30 - Add SendFile command proper
2015-02-06 19:48:48 -05:00
Chris Toomey
d6a0abcb26 Ensure valid runner pane setting before killing
Closes #44 - Prevent killing vim pane
2015-01-27 15:35:44 -05:00
Chris Toomey
745a54b0a7 Fix undefined vim_pane when reorienting
Closes #43 - Error related to s:vim_pane on VtrReorient
2015-01-05 22:05:38 -05:00
Chris Toomey
8d064375e5 Don't base pane validity on count
This introduced an implicit dependency on zero-based pane indexing.
This code now checks that the desired pane is one of the current pane
indexes.

Closes #42 - Off by one error in runner_pane with base-index 1 in tmux
2015-01-05 22:04:48 -05:00
Chris Toomey
d56939fa94 Add explicit EnsurePane option to sending commands
Add bang version of SendLinesToRunner and SendCommand which will ensure
a runner is present and open one if needed. Also add optional second
argument to VtrSendCommand function to ensure runner pane

Closes #27 - Add EnsurePaneAndRun
2015-01-04 14:36:15 -05:00
Chris Toomey
a0d0e95cdf Unify SendCommand function & Command
Closes #33
2015-01-03 18:20:47 -05:00
Chris Toomey
fa1e9a53e3 Reset the s:vim_pane when reattaching
Prior to this change, VTR could get confused and focus the wrong pane
after reattaching the runner pane.

Closes #38 - Detaching the runner pane does not reset the vim_pane
2014-12-31 14:50:49 -05:00
Chris Toomey
8399c4ab7b Ensure runner_pane is valid before using
This protects all commands that expect a runner pane from runner
against an invalid pane, including the Vim pane. Since the user can
modified the tmux layout and open and close panes outside the context
of VTR, it's neccesary to check this before any command that requires
the runner pane.

Closes #28 - Protect against running command against invalid panes
2014-12-31 14:45:28 -05:00
Chris Toomey
e8abf1ae69 Remove ZoomRunnerPane in favor of FocusRunnerPane
The functionality was largely duplicated across the commands, and with
regard to naming, `FocusRunnerPane` better maps to how I use it.

Closes #35 - Unify Focus & Zoom runner pane functions
2014-12-31 14:12:25 -05:00
Chris Toomey
e1749bc7fb Error when running commands without a runner pane
Previous behavior was to implicitly open a runner pane if none
attached. I regularly ran into this in unwanted circumstances. With the
recent updated to make AttachToPane smarter, an error plus quick
manual attach is nearly as quick as the implicit form, but is much
better overall.

Closes #36 - Explicitly error when running without a pane attached
2014-12-31 14:05:31 -05:00
Chris Toomey
f39a860595 Capture the major orientation with AttachToPane
ReorientRunner needs to know the current orientation in order to be
able to toggle it. With this change, we capture the current major
orientation (outermost split orientation) and assume it to be
representative. Imperfect, but I believe it to be a very good
approximation.

Closes #32 - Error: Reorient Runner fails when run after manual attach
2014-12-31 11:25:22 -05:00
Chris Toomey
cf363c892c Remove ResizeRunner command
It was buggy and the functionality is much better handled through tmux
bindings than through plugin behavior

Closes #34 - Remove ResizeRunner command
2014-12-31 11:02:22 -05:00
Chris Toomey
20acb64319 Rename readme to .md extension, update sections 2014-12-23 22:15:56 -05:00
Chris Toomey
b00685f019 Unify SendLines by making it accept a range
Love cleaning up the interface and removing code!

Closes #15 - Unify SendLines command by allowing it to take a range
2014-11-17 13:06:46 -05:00
Chris Toomey
7c4cd3d059 Smarten up AttachToPane functionality
- Automatically attach if only 2 panes
- Ensure pane with index exists before attaching

The runner_pane must not be the Vim pane, so if there are only two
panes, then we can be certain that the desired pane is the other, and
automatically attach

Closes #20 - Make AttachToPane command smarter
2014-11-17 12:51:21 -05:00
Chris Toomey
e05b373ff3 Prevent killing the Vim pane
If the user has swapped the pane layout, it is possible that VTR could
attempt to kill the Vim pane. This introduces a sanity check that
prevents killing the active / Vim pane.

Closes #7 - Protect against killing Vim pane
2014-11-14 16:41:59 -05:00
Chris Toomey
1be6d62b51 Ensure runner pane is present before sending lines
Closes #8 - Only send line(s) when runner pane is open
2014-11-14 14:03:41 -05:00
Chris Toomey
20a02948c7 Add mapping for AttachToPane 2014-11-14 14:03:09 -05:00
Chris Toomey
457c189f16 Ignore empty pane number in AttachToPane
Closes #23 - AttachToPane Ctrl-C interpreted as 0
2014-11-14 13:46:17 -05:00
Chris Toomey
4fdd883ce5 Zoom runner on focus 2014-11-14 12:09:24 -05:00
Rusty Geldmacher
1187668e56 Fixed a couple documentation typos 2014-09-19 09:01:01 -04:00
Chris Toomey
0c571bc5ca Enter copy-mode on zoom 2014-07-27 19:26:13 -04:00
Chris Toomey
fb486dcfed Use <leader> maps. Not sure how this lasted so long... 2014-04-11 13:50:25 -04:00
Chris Toomey
cf0b282fe2 Add zoom runner command and map 2014-04-11 13:43:23 -04:00
Chris Toomey
191d9d843c Add support for python syntactic whitespace
Closes #18 - Stripping whitespace

Add ipython readline and auto-indent notes
2014-02-17 10:30:18 -05:00
Chris Toomey
18d5ef9acd Allow for attaching to specific numbered pane 2013-08-23 14:23:09 -04:00
Chris Toomey
620f0ca989 Include explicit enter string 2013-06-09 20:07:19 -04:00
Chris Toomey
626531af5d Strip whitespace when sending lines
Closes #12 - Trim leading whitespace before sending
2013-06-05 21:28:58 -04:00