Skip to content

Commit 8a20aec

Browse files
committed
Update README and docs
1 parent 346f679 commit 8a20aec

File tree

2 files changed

+5
-144
lines changed

2 files changed

+5
-144
lines changed

README.mkd

Lines changed: 4 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# vimux
22

3-
Easily interact with tmux from vim. This project is still in development, so some features are still missing.
3+
Easily interact with tmux from vim.
4+
5+
![vimux](https://www.braintreepayments.com/assets-faccd47687/assets/images/blog/vimux3.png)
46

57
What inspired me to write vimux was [tslime.vim](https://github.com/kikijump/tslime.vim), a plugin that lets you send input to tmux. While tslime.vim works well, I felt it wasn't optimized for my primary use case which was having a smaller tmux pane that I would use to run tests or play with a REPL.
68

@@ -21,143 +23,4 @@ Otherwise download the latest [tarball](https://github.com/benmills/vimux/tarbal
2123

2224
## Usage
2325

24-
### RunVimTmuxCommand
25-
Run a system command in a small horizontal split bellow the current pane vim is in. You can optionally pass a second argument to stop vimux from automatically sending a return after the command.
26-
27-
```viml
28-
" Run the current file with rspec
29-
map <Leader>rb :call RunVimTmuxCommand("clear; rspec " . bufname("%"))<CR>
30-
31-
" Run command without sending sending a return
32-
map <Leader>rq :call RunVimTmuxCommand("clear; rspec " . bufname("%"), 0)<CR>
33-
```
34-
35-
### PromptVimTmuxCommand
36-
Prompt for a command and run it in a small horizontal split bellow the current pane.
37-
38-
```viml
39-
" Prompt for a command to run
40-
map <Leader>rp :PromptVimTmuxCommand<CR>
41-
```
42-
43-
### RunLastVimTmuxCommand
44-
Run the last command executed by `RunVimTmuxCommand`
45-
46-
```viml
47-
" Run last command executed by RunVimTmuxCommand
48-
map <Leader>rl :RunLastVimTmuxCommand<CR>
49-
```
50-
51-
### InspectVimTmuxRunner
52-
Move into the tmux runner pane created by `RunVimTmuxCommand` and enter copy mode (scroll mode).
53-
54-
```viml
55-
" Inspect runner pane
56-
map <Leader>ri :InspectVimTmuxRunner<CR>
57-
```
58-
59-
### CloseVimTmuxRunner
60-
Close the tmux runner created by `RunVimTmuxCommand`
61-
62-
```viml
63-
" Close vim tmux runner opened by RunVimTmuxCommand
64-
map <Leader>rq :CloseVimTmuxRunner<CR>
65-
```
66-
67-
### CloseVimTmuxPanes
68-
Close all other tmux panes in the current window.
69-
70-
```viml
71-
" Close all other tmux panes in current window
72-
map <Leader>rx :CloseVimTmuxPanes<CR>
73-
```
74-
75-
### InterruptVimTmuxRunner
76-
Interrupt any command that is running inside the runner pane.
77-
78-
```viml
79-
" Interrupt any command running in the runner pane
80-
map <Leader>rs :InterruptVimTmuxRunner<CR>
81-
```
82-
83-
### Full Keybind Example
84-
85-
```viml
86-
" Run the current file with rspec
87-
map <Leader>rb :call RunVimTmuxCommand("clear; rspec " . bufname("%"))<CR>
88-
89-
" Prompt for a command to run
90-
map <Leader>rp :PromptVimTmuxCommand<CR>
91-
92-
" Run last command executed by RunVimTmuxCommand
93-
map <Leader>rl :RunLastVimTmuxCommand<CR>
94-
95-
" Inspect runner pane
96-
map <Leader>ri :InspectVimTmuxRunner<CR>
97-
98-
" Close all other tmux panes in current window
99-
map <Leader>rx :CloseVimTmuxPanes<CR>
100-
101-
" Close vim tmux runner opened by RunVimTmuxCommand
102-
map <Leader>rq :CloseVimTmuxRunner<CR>
103-
104-
" Interrupt any command running in the runner pane
105-
map <Leader>rs :InterruptVimTmuxRunner<CR>
106-
```
107-
108-
### tslime replacement
109-
110-
Here is how to use vimux to send code to a REPL. This is similar to tslime. First, add some helpful mappings.
111-
112-
```viml
113-
114-
" Prompt for a command to run
115-
map <LocalLeader>vp :PromptVimTmuxCommand<CR>
116-
117-
" If text is selected, save it in the v buffer and send that buffer it to tmux
118-
vmap <LocalLeader>vs "vy :call RunVimTmuxCommand(@v . "\n", 0)<CR>
119-
120-
" Select current paragraph and send it to tmux
121-
nmap <LocalLeader>vs vip<LocalLeader>vs<CR>
122-
```
123-
124-
Now, open a clojure file. Let's say your leader is backslash (\). Type \vp, and then type lein repl at the prompt. This opens a tmux split running a REPL. Then, select text or put the cursor on a function and type \vs. This will send it to the REPL and evaluate it. The reason we pass `0` to `RunVimTmuxCommand` is to stop the normal return that is sent to the runner pane and use our own new line so the clojure REPL will evaluate the selected text without adding an extra return. Thanks to @trptcolin for discovering this issue.
125-
126-
## Options
127-
128-
### VimuxHeight
129-
Set the percent height of the runner pane opened by `RunVimTmuxCommand`.
130-
**Default: `"20"`**
131-
132-
```viml
133-
let VimuxHeight = "50"
134-
```
135-
136-
### VimuxOrientation
137-
Set the default position of the runner pane.
138-
139-
**Acceptable Values:**
140-
`"v"` Vertical
141-
`"h"` Horizontal
142-
143-
**Default: `"v"`**
144-
145-
```viml
146-
let VimuxOrientation = "h"
147-
```
148-
149-
### VimuxUseNearestPane
150-
Use nearest pane (not used by vim) if found instead of running split-window. Useful if you always have two panes opened and you want Vimux to use the existing one.
151-
152-
```viml
153-
let VimuxUseNearestPane = 1
154-
```
155-
156-
### VimuxResetSequence
157-
The keys sent to the runner pane before running a command. By default it sends `q` to make sure the pane is not in scroll-mode and `C-u` to clear the line.
158-
159-
**Default: `"q C-u"`
160-
161-
```viml
162-
let VimuxResetSequence = ""
163-
```
26+
The full documentation is available [online](https://raw.github.com/benmills/vimux/master/doc/vimux.txt) and accessible inside vim `:help vimux`

doc/vimux.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ ABOUT (1) *VimuxAbout*
2525

2626
Vimux -- Easily interact with tmux from vim.
2727

28-
This project is still in development, so some features are still missing.
29-
3028
What inspired me to write vimux was tslime.vim [1], a plugin that lets you
3129
send input to tmux. While tslime.vim works well, I felt it wasn't optimized
3230
for my primary use case which was having a smaller tmux pane that I would use
@@ -40,7 +38,7 @@ without losing focus of vim. Once that pane exists whenever you call
4038
using vimux myself I wanted to rerun commands over and over. An example of
4139
this was running the current file through rspec. Rather than typing that over
4240
and over I wrote `RunLastVimTmuxCommand` that will execute the last command
43-
you called with `RunVimTmuxCommand`.
41+
you called with `RunVimTmuxCommand`.
4442

4543
Other auxiliary functions and the ones I talked about above can be found
4644
bellow with a full description and example key binds for your vimrc.

0 commit comments

Comments
 (0)