vim-matlab icon indicating copy to clipboard operation
vim-matlab copied to clipboard

Workspace browser in vim split

Open tdy opened this issue 8 years ago • 2 comments

It'd be nice to have a workspace summary in a read-only vim split (like a topright new split with buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap nomodifiable).

As for how to keep this vim buffer in sync with MATLAB's workspace, I'm not sure.

1) My first thought was to use whos, which gives a condensed version of the GUI workspace browser (without min/max/range/mean/median/mode/std/var):

>> whos
  Name     Size     Bytes     Class     Attributes
  S        4x1       6230     struct
  ans      5x5        200     double
  p       64x3       1536     double
  x        1x1          8     double

Use MatlabCliController#run_code to store whos output in a new diary after each command.

diary = "/tmp/vim-matlab.whos"
code += ",delete '{diary}',diary '{diary}',whos,diary off".format(diary=diary)

And create PythonVimUtils#get_current_matlab_workspace to update the workspace buffer with the contents of /tmp/vim-matlab.whos (or maybe just open the file itself).

But even if this idea works, it would output whos to the console after each command. As far as I can tell, pexpect's filters wouldn't help in this case.

2) My second thought... I don't have one yet.

tdy avatar Aug 18 '16 21:08 tdy

How about using MATLAB's GUI window as-is (workspace command in cli)?

Similarly you can do edit {filename} or (:MatlabCliOpenInEditor in vim) to open the GUI editor for things like setting breakpoints.

screenshot 2016-08-18 20 57 56

daeyun avatar Aug 19 '16 01:08 daeyun

That's true, but I was just thinking about potential functionalities that could be moved to vim/multiplexers without the JVM.

This is just a lower priority feature request in case someone has the time/interest/idea for implementing it. Actually I don't know how to submit feature requests on github, so I just used Issues. Not sure if that's how it works on here.

tdy avatar Aug 19 '16 01:08 tdy