This plugin provides some simple integration between vim, MATLAB and tmux. On
opening a MATLAB file (for example a .m-file) the plugin launches a MATLAB
console in a new hidden tmux split at the right of the current split. The split
is hidden by zooming the current pane and can be unhidden by using
prefix+rightarrow
, for example.
The plugin now provides multiple functions and mappings which make it easier to interact with MATLAB. These include running scripts, adding breakpoints and opening documentation.
matlab.vim also includes syntax highlighting, which was copied from MatlabFilesEdition by Fabrice Guy.
Use your favourite vim plugin manager. I recommend using
vim-plug. To install this plugin add
this to your .vimrc
:
Plug 'MortenStabenau/matlab-vim'
And then run :PlugInstall
.
- Open any MATLAB file with vim inside of tmux. A MATLAB console will automatically open inside a hidden tmux split.
- Run
:MatlabRun
to execute the file - Run
:MatlabBreakpoint
to set a breakpoint in the current line - Run
:MatlabDoc
to open the help for the function below your cursor
- Change the MATLAB executable
let g:matlab_executable = '/path/to/your/matlab/version'
- Change the tmux split size
let g:matlab_panel_size = 50
For an overview of all options, check out the doc file.
For a full documentation detailing the commands, options and mappings, please
read the
doc
file or run help matlab
. The latter also gives you pretty syntax
highlighting.
- Octave compatibility?
- Add new MATLAB functions to highlighting: the old MatlabFilesEdition code was written in 2009 or so. Since then, a lot of new MATLAB functions have been added which are currently not recognized by the syntax highlighting.
- Initial working folder should check if any MATLAB files are present
- Add a nice demo gif to this README
- Display breakpoints (?)
- Paths with spaces do not work
- Zack for his bugfix
- Fabrice Guy: for his work on MatlabFilesEdition. I used his code for the syntax highlighting and the indentation.
- Daan Bakker: for his handy projectroot functions