Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating vim into matlab [duplicate]

Tags:

vim

editor

matlab

I am using Matlab R2013b. I am using the GUI, with the Command Windows and Editor in split screen. In the Matlab preferences > Editor/Debugger > Editor. There is an option to set a custom editor instead of the Matlab editor. I set it to my local editor /usr/bin/vim, but then I am not able to open files at all anymore. Is there a possibility to use the vim editor in split screen mode?

I am aware of !vim file.m, but this is not the solution I am looking for, as this only works satisfactory in -nodisplay mode. I rather want to keep the split screen mode.

like image 521
Bernhard Avatar asked Jan 19 '26 04:01

Bernhard


2 Answers

I did not find a solution that is 100% satisfying, but for now I am using tmux as an intermediate solution. It allows two use a split screen for two terminals. In one of those I can open matlab -nodesktop in terminal mode, and in the other one vim. It is possible to quickly switch between both split screens.

You can use functionality of GUI Matlab by typing things as commandhistory, who et cetera.

like image 50
Bernhard Avatar answered Jan 20 '26 18:01

Bernhard


Instead of using something such as screen or tmux, you can use vim's :term command (needs to be compiled with the +terminal feature). This way you can open your file on a window and run :term matlab -nodesktop to open another window with the Matlab shell (if you want a vertical window, run :vert term matlab -nodesktop).

Also, you might want to have a look at vim-slime.

like image 31
dccsillag Avatar answered Jan 20 '26 17:01

dccsillag



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!