A vim plugin that emulates all of the powerful IDE features of MATLAB in vim so you don't need to run the full GUI.
git clone https://mcol.xyz/code/vimlab
Log | Files | Refs | README | LICENSE

commit f0adbd6034aba0b9a25bc37e96ad91b142e5a97d
parent 95f463a9a5da636c450287d73af8b0ab2431b383
Author: mcol <mcol@posteo.net>
Date:   Sun, 16 Dec 2018 00:13:31 +0000

IsMatlabLineContinuation no longer s:function; used for continuing line continuation when wanting to send a line to repl

Diffstat:
Mftplugin/matlab.vim | 14+++++++++++++-
Mindent/matlab.vim | 8++++----
2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/ftplugin/matlab.vim b/ftplugin/matlab.vim @@ -223,7 +223,19 @@ nnoremap <unique> <buffer> <silent> <F2> :call TmuxSendKeysEnter(expand("%:r"))< " Control-w will list variables in the current workspace nnoremap <unique> <buffer> <silent> <C-w> :TmuxSendKeysEnter who<CR> - +" override default 'run line' from tide plugin to follow line continuations ... +function! VimlabSendLine(lnum) + if IsMatlabContinuationLine(a:lnum) + let l:end = a:lnum + while IsMatlabContinuationLine(l:end) + let l:end += 1 + endwhile + call TmuxSendLines(a:lnum, l:end) + else + TmuxSendLine + endif +endfunction +nnoremap <silent> <buffer> <F8> :call VimlabSendLine(line("."))<CR> "------------------------------------------------------------------ " Debugging code diff --git a/indent/matlab.vim b/indent/matlab.vim @@ -18,7 +18,7 @@ if exists("*GetMatlabIndent") finish endif -function! s:IsMatlabContinuationLine(lnum) +function! IsMatlabContinuationLine(lnum) let continuationLine = 0 if a:lnum > 0 let pnbline = getline(prevnonblank(a:lnum)) @@ -49,8 +49,8 @@ function GetMatlabIndent() " If the previous line is a continuation line, get the beginning of the block to " use the indent of that line - if s:IsMatlabContinuationLine(plnum - 1) - while s:IsMatlabContinuationLine(plnum - 1) + if IsMatlabContinuationLine(plnum - 1) + while IsMatlabContinuationLine(plnum - 1) let plnum = plnum - 1 endwhile endif @@ -61,7 +61,7 @@ function GetMatlabIndent() endif let curind = indent(plnum) - if s:IsMatlabContinuationLine(v:lnum - 1) + if IsMatlabContinuationLine(v:lnum - 1) let curind = curind + &sw endif " Add a 'shiftwidth' after classdef, properties, switch, methods, events,