Skip to content

Commit ef5622f

Browse files
authored
Add VimuxClearTerminalScreen (#178)
1 parent 7f15726 commit ef5622f

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

doc/vimux.txt

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ CONTENTS *vimux-contents*
1313
2.3 .............................. |VimuxInspectRunner|
1414
2.4 .............................. |VimuxCloseRunner|
1515
2.5 .............................. |VimuxInterruptRunner|
16-
2.6 .............................. |VimuxClearRunnerHistory|
17-
2.7 .............................. |VimuxZoomRunner|
18-
2.8 .............................. |VimuxRunCommandInDir|
16+
2.6 .............................. |VimuxClearTerminalScreen|
17+
2.7 .............................. |VimuxClearRunnerHistory|
18+
2.8 .............................. |VimuxZoomRunner|
19+
2.9 .............................. |VimuxRunCommandInDir|
1920
3. Misc ............................ |VimuxMisc|
2021
3.1 Example Keybinding............ |VimuxExampleKeybinding|
2122
3.2 Tslime Replacement............ |VimuxTslimeReplacement|
@@ -70,6 +71,7 @@ Furthermore there are several handy commands all starting with 'Vimux':
7071
- |VimuxInspectRunner|
7172
- |VimuxInterruptRunner|
7273
- |VimuxPromptCommand|
74+
- |VimuxClearTerminalScreen|
7375
- |VimuxClearRunnerHistory|
7476
- |VimuxZoomRunner|
7577
- |VimuxRunCommandInDir|
@@ -170,6 +172,15 @@ runner pane.
170172
<
171173

172174

175+
------------------------------------------------------------------------------
176+
*VimuxClearTerminalScreen*
177+
VimuxClearTerminalScreen~
178+
179+
Clear the terminal screen of the runner pane.
180+
>
181+
" Clear the terminal screen of the runner pane.
182+
map <Leader>v<C-l> :VimuxClearTerminalScreen<CR>
183+
<
173184

174185
------------------------------------------------------------------------------
175186
*VimuxClearRunnerHistory*
@@ -240,6 +251,9 @@ Full Keybind Example~
240251
241252
" Zoom the runner pane (use <bind-key> z to restore runner pane)
242253
map <Leader>vz :call VimuxZoomRunner()<CR>
254+
255+
" Clear the terminal screen of the runner pane.
256+
map <Leader>v<C-l> :VimuxClearTerminalScreen<CR>
243257
>
244258
245259
------------------------------------------------------------------------------

plugin/vimux.vim

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ command VimuxScrollUpInspect :call VimuxScrollUpInspect()
2121
command VimuxScrollDownInspect :call VimuxScrollDownInspect()
2222
command VimuxInterruptRunner :call VimuxInterruptRunner()
2323
command -nargs=? VimuxPromptCommand :call VimuxPromptCommand(<args>)
24+
command VimuxClearTerminalScreen :call VimuxClearTerminalScreen()
2425
command VimuxClearRunnerHistory :call VimuxClearRunnerHistory()
2526
command VimuxTogglePane :call VimuxTogglePane()
2627

@@ -142,6 +143,12 @@ function! VimuxInterruptRunner()
142143
call VimuxSendKeys("^c")
143144
endfunction
144145

146+
function! VimuxClearTerminalScreen()
147+
if exists("g:VimuxRunnerIndex")
148+
call VimuxSendKeys("C-l")
149+
endif
150+
endfunction
151+
145152
function! VimuxClearRunnerHistory()
146153
if exists("g:VimuxRunnerIndex")
147154
call _VimuxTmux("clear-history -t ".g:VimuxRunnerIndex)

0 commit comments

Comments
 (0)