Skip to content

Commit 9012946

Browse files
committed
Merge pull request #25 from sotte/rename_commands
Rename all commands to Vimux*
2 parents 8a20aec + 8402015 commit 9012946

File tree

2 files changed

+172
-67
lines changed

2 files changed

+172
-67
lines changed

doc/vimux.txt

Lines changed: 69 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ CONTENTS *vimux-contents*
88

99
1. About............................ |VimuxAbout|
1010
2. Usage ........................... |VimuxUsage|
11-
2.1 .............................. |PromptVimTmuxCommand|
12-
2.2 .............................. |RunLastVimTmuxCommand|
13-
2.3 .............................. |InspectVimTmuxRunner|
14-
2.4 .............................. |CloseVimTmuxRunner|
15-
2.5 .............................. |CloseVimTmuxPanes|
16-
2.6 .............................. |InterruptVimTmuxRunner|
11+
2.1 .............................. |VimuxPromptCommand|
12+
2.2 .............................. |VimuxRunLastCommand|
13+
2.3 .............................. |VimuxInspectRunner|
14+
2.4 .............................. |VimuxCloseRunner|
15+
2.5 .............................. |VimuxClosePanes|
16+
2.6 .............................. |VimuxInterruptRunner|
1717
3. Misc ............................ |VimuxMisc|
1818
3.1 Example Keybinding............ |VimuxExampleKeybinding|
1919
3.2 Tslime Replacement............ |VimuxTslimeReplacement|
@@ -31,14 +31,14 @@ for my primary use case which was having a smaller tmux pane that I would use
3131
to run tests or play with a REPL.
3232

3333
My goal with vimux is to make interacting with tmux from vim effortless. By
34-
default when you call `RunVimTmuxCommand` vimux will create a 20% tall
34+
default when you call `VimuxRunCommand` vimux will create a 20% tall
3535
horizontal pane under your current tmux pane and execute a command in it
3636
without losing focus of vim. Once that pane exists whenever you call
37-
`RunVimTmuxCommand` again the command will be executed in that pane. As I was
37+
`VimuxRunCommand` again the command will be executed in that pane. As I was
3838
using vimux myself I wanted to rerun commands over and over. An example of
3939
this was running the current file through rspec. Rather than typing that over
40-
and over I wrote `RunLastVimTmuxCommand` that will execute the last command
41-
you called with `RunVimTmuxCommand`.
40+
and over I wrote `VimuxRunLastCommand` that will execute the last command
41+
you called with `VimuxRunCommand`.
4242

4343
Other auxiliary functions and the ones I talked about above can be found
4444
bellow with a full description and example key binds for your vimrc.
@@ -49,17 +49,32 @@ bellow with a full description and example key binds for your vimrc.
4949
==============================================================================
5050
USAGE (2) *VimuxUsage*
5151

52-
The function RunVimTmuxCommand(command) is the core of Vimux. It will
52+
The function VimuxRunCommand(command) is the core of Vimux. It will
5353
create a split pane in the current window and run the passed command in it.
54-
55-
:call RunVimTmuxCommand("ls")
56-
54+
>
55+
:call VimuxRunCommand("ls")
56+
<
5757
This will run the command in a split pane without losing focus of vim. If the
5858
command takes a long time to return you can continue to use vim while the
5959
process finishes and will see the output in the pane when it's finished.
6060

61-
Furthermore there are several handy commands:
61+
Furthermore there are several handy commands all starting with 'Vimux':
62+
- |VimuxRunCommand|
63+
- |VimuxRunLastCommand|
64+
- |VimuxCloseRunner|
65+
- |VimuxClosePanes|
66+
- |VimuxCloseWindows|
67+
- |VimuxInspectRunner|
68+
- |VimuxInterruptRunner|
69+
- |VimuxPromptCommand|
70+
71+
72+
Note:
73+
Earlier the all commands had different names. There are still aliases for
74+
convenience. Please chang your configuration according to the new naming
75+
conventions!
6276

77+
The DEPRECATED commands:
6378
- |PromptVimTmuxCommand|
6479
- |RunLastVimTmuxCommand|
6580
- |InspectVimTmuxRunner|
@@ -69,79 +84,86 @@ Furthermore there are several handy commands:
6984

7085
------------------------------------------------------------------------------
7186
*RunVimTmuxCommand*
72-
RunVimTmuxCommand~
87+
*VimuxRunCommand*
88+
VimuxRunCommand~
7389

7490
Run a system command in a small horizontal split bellow
7591
the current pane vim is in. You can optionally pass a second argument to stop
7692
vimux from automatically sending a return after the command.
7793
>
7894
" Run the current file with rspec
79-
map <Leader>rb :call RunVimTmuxCommand("clear; rspec " . bufname("%"))<CR>
95+
map <Leader>rb :call VimuxRunCommand("clear; rspec " . bufname("%"))<CR>
8096
" Run command without sending sending a return
81-
map <Leader>rq :call RunVimTmuxCommand("clear; rspec " . bufname("%"), 0)<CR>
97+
map <Leader>rq :call VimuxRunCommand("clear; rspec " . bufname("%"), 0)<CR>
8298
<
8399

84100
------------------------------------------------------------------------------
85101
*PromptVimTmuxCommand*
86-
PromptVimTmuxCommand~
102+
*VimuxPromptCommand*
103+
VimuxPromptCommand~
87104

88105
Prompt for a command and run it in a small horizontal split bellow the current
89106
pane.
90107
>
91108
" Prompt for a command to run map
92-
<Leader>rp :PromptVimTmuxCommand<CR>
109+
<Leader>rp :VimuxPromptCommand<CR>
93110
<
94111

95112
------------------------------------------------------------------------------
96113
*RunLastVimTmuxCommand*
97-
RunLastVimTmuxCommand~
114+
*VimuxRunLastCommand*
115+
VimuxRunLastCommand~
98116

99-
Run the last command executed by `RunVimTmuxCommand`
117+
Run the last command executed by `VimuxRunCommand`
100118
>
101-
" Run last command executed by RunVimTmuxCommand
102-
map <Leader>rl :RunLastVimTmuxCommand<CR>
119+
" Run last command executed by VimuxRunCommand
120+
map <Leader>rl :VimuxRunLastCommand<CR>
103121
<
104122

105123
------------------------------------------------------------------------------
106124
*InspectVimTmuxRunner*
107-
InspectVimTmuxRunner~
125+
*VimuxInspectRunner*
126+
VimuxInspectRunner~
108127

109-
Move into the tmux runner pane created by `RunVimTmuxCommand` and enter copy
128+
Move into the tmux runner pane created by `VimuxRunCommand` and enter copy
110129
pmode (scroll mode).
111130
>
112131
" Inspect runner pane map
113-
<Leader>ri :InspectVimTmuxRunner<CR>
132+
<Leader>ri :VimuxInspectRunner<CR>
114133
<
115134

116135
------------------------------------------------------------------------------
117136
*CloseVimTmuxRunner*
118-
CloseVimTmuxRunner~
137+
*VimuxCloseRunner*
138+
VimuxCloseRunner~
119139

120-
Close the tmux runner created by `RunVimTmuxCommand`
140+
Close the tmux runner created by `VimuxRunCommand`
121141
>
122-
" Close vim tmux runner opened by RunVimTmuxCommand
123-
map <Leader>rq :CloseVimTmuxRunner<CR>
142+
" Close vim tmux runner opened by VimuxRunCommand
143+
map <Leader>rq :VimuxCloseRunner<CR>
124144
<
125145

126146
------------------------------------------------------------------------------
127147
*CloseVimTmuxPanes*
128-
CloseVimTmuxPanes~
148+
*VimuxClosePanes*
149+
VimuxClosePanes~
129150

130151
Close all other tmux panes in the current window.
131152
>
132153
" Close all other tmux panes in current window
133-
map <Leader>rx :CloseVimTmuxPanes<CR>
154+
map <Leader>rx :VimuxClosePanes<CR>
134155
>
135156
136157
------------------------------------------------------------------------------
137158
*InterruptVimTmuxRunner*
138-
InterruptVimTmuxRunner~
159+
*VimuxInterruptRunner*
160+
VimuxInterruptRunner~
139161

140162
Interrupt any command that is running inside the
141163
runner pane.
142164
>
143165
" Interrupt any command running in the runner pane map
144-
<Leader>rs :InterruptVimTmuxRunner<CR>
166+
<Leader>rs :VimuxInterruptRunner<CR>
145167
<
146168

147169

@@ -154,25 +176,25 @@ Full Keybind Example~
154176

155177
>
156178
" Run the current file with rspec
157-
map <Leader>rb :call RunVimTmuxCommand("clear; rspec " . bufname("%"))<CR>
179+
map <Leader>rb :call VimuxRunCommand("clear; rspec " . bufname("%"))<CR>
158180
159181
" Prompt for a command to run
160-
map <Leader>rp :PromptVimTmuxCommand<CR>
182+
map <Leader>rp :VimuxPromptCommand<CR>
161183
162-
" Run last command executed by RunVimTmuxCommand
163-
map <Leader>rl :RunLastVimTmuxCommand<CR>
184+
" Run last command executed by VimuxRunCommand
185+
map <Leader>rl :VimuxRunLastCommand<CR>
164186
165187
" Inspect runner pane
166-
map <Leader>ri :InspectVimTmuxRunner<CR>
188+
map <Leader>ri :VimuxInspectRunner<CR>
167189
168190
" Close all other tmux panes in current window
169-
map <Leader>rx :CloseVimTmuxPanes<CR>
191+
map <Leader>rx :VimuxClosePanes<CR>
170192
171-
" Close vim tmux runner opened by RunVimTmuxCommand
172-
map <Leader>rq :CloseVimTmuxRunner<CR>
193+
" Close vim tmux runner opened by VimuxRunCommand
194+
map <Leader>rq :VimuxCloseRunner<CR>
173195
174196
" Interrupt any command running in the runner pane
175-
map <Leader>rs :InterruptVimTmuxRunner<CR>
197+
map <Leader>rs :VimuxInterruptRunner<CR>
176198
>
177199
178200
------------------------------------------------------------------------------
@@ -184,10 +206,10 @@ First, add some helpful mappings.
184206

185207
>
186208
" Prompt for a command to run
187-
map <LocalLeader>vp :PromptVimTmuxCommand<CR>
209+
map <LocalLeader>vp :VimuxPromptCommand<CR>
188210
189211
" If text is selected, save it in the v buffer and send that buffer it to tmux
190-
vmap <LocalLeader>vs "vy :call RunVimTmuxCommand(@v . "\n", 0)<CR>
212+
vmap <LocalLeader>vs "vy :call VimuxRunCommand(@v . "\n", 0)<CR>
191213
192214
" Select current paragraph and send it to tmux
193215
nmap <LocalLeader>vs vip<LocalLeader>vs<CR>
@@ -196,7 +218,7 @@ First, add some helpful mappings.
196218
Now, open a clojure file. Let's say your leader is backslash (\). Type \vp,
197219
and then type lein repl at the prompt. This opens a tmux split running a REPL.
198220
Then, select text or put the cursor on a function and type \vs. This will send
199-
it to the REPL and evaluate it. The reason we pass `0` to `RunVimTmuxCommand`
221+
it to the REPL and evaluate it. The reason we pass `0` to `VimuxRunCommand`
200222
is to stop the normal return that is sent to the runner pane and use our own
201223
new line so the clojure REPL will evaluate the selected text without adding an
202224
extra return. Thanks to @trptcolin for discovering this issue.

0 commit comments

Comments
 (0)