How to use vim as editor in Matlab GUI

杀马特。学长 韩版系。学妹 提交于 2019-12-30 03:09:12

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/23380456/how-to-use-vim-as-editor-in-matlab-gui

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!