Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/matlab-screen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ CONFIGURATION *matlab-screen-configuration*
* matlab terminal height, default: 10 >
let g:matlab_screen_terminal_height = 10

* the matlab terminal is split vertically and runs on the right.
In this case, the panes are of equal size. default: 0 >
let g:matlab_screen_vertical_terminal = 1

* default shortcut & Function >
vnoremap <Leader>mr :call matlab#RunSelected()<CR>
nnoremap <Leader>mr :call matlab#RunCell()<CR>
Expand Down
12 changes: 9 additions & 3 deletions ftplugin/matlab.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ function matlab#Start()
echom "Only one MATLAB process in current vim!"
return
endif
rightbelow let s:matlab_buf =
\term_start(g:matlab_term_cmd,
\{"term_finish" : "close", "term_rows": g:matlab_screen_terminal_height, "norestore" : 1 })
if exists('g:matlab_screen_vertical_terminal') && g:matlab_screen_vertical_terminal == 1
rightbelow let s:matlab_buf =
\term_start(g:matlab_term_cmd,
\{"term_finish" : "close", "vertical" : 1, "norestore" : 1 })
else
rightbelow let s:matlab_buf =
\term_start(g:matlab_term_cmd,
\{"term_finish" : "close", "term_rows": g:matlab_screen_terminal_height, "norestore" : 1 })
endif
wincmd p
endfunction

Expand Down