GithubHelp home page GithubHelp logo

daeyun / vim-matlab Goto Github PK

View Code? Open in Web Editor NEW
93.0 93.0 15.0 327 KB

Neovim plugin for MATLAB

License: Mozilla Public License 2.0

Python 57.53% M 0.40% MATLAB 2.25% Shell 0.86% Vim Script 38.96%

vim-matlab's People

Contributors

arntanguy avatar daeyun avatar fsharpasharp avatar tdy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vim-matlab's Issues

InsertEnter throws KeyError: 'last_written'

I get this error every time I open a file and enter insert mode. InsertEnter tries to read buffer_state[path]['last_written'], which only exists if a BufWrite event has previously occurred.

error caught in async handler '/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab:autocmd:InsertEnter:*.m ()'
Traceback (most recent call last):
  File "/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab/__init__.py", line 242, in insert_enter
    self.refresh_buffer()
  File "/Users/tdy/.vim/plugs/vim-matlab/rplugin/python/vim_matlab/__init__.py", line 258, in refresh_buffer
    last_written = self.buffer_state[path]['last_written']
KeyError: 'last_written'

A similar but simpler vim plugin for matlab

First, I have to thank you for the idea to send message from vim to matlab. However, it seems a little complex to modify the python code(I am a vim user under linux).
I found that gnu screen could pass commands from one terminal to another, so I write a very simple vim plugin with pure vimL. Here is the project: matlab-screen

UpdateRemotePlugins fails

Hi,

I am trying to install this plugin but I get the following error.
Has anyone seen this before? I can for example install denite.vim which also needs the command UpdateRemotePlugins. So it seems to be a problem with this plugin.

Any help is appreciated

remote/host: python3 host registered plugins []
function remote#host#UpdateRemotePlugins[6]..<SNR>123_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[14]..provider#Poll, line 6
Vim(let):E475: Invalid value for argument cmd: '' is not executable
function remote#host#UpdateRemotePlugins[6]..<SNR>123_RegistrationCommands[15]..remote#host#Require[10]..provider#pythonx#Require[14]..provider#Poll, line 17
Failed to load python host. You can try to see what happened by starting nvim with $NVIM_PYTHON_LOG_FILE set and opening the generated log file. Also, the host stderr is available in messages

Unable to quit matlab server instance

After working for a while, I closed neovim and the terminal session. However, the MATLAB server instance does not seem to shut down. Even after forcefully killing the process with kill-9 , another instance keeps popping up. I'd like to fully stop the MATLAB server process.

Functions inside script causing crash

Hi! Thanks for this wonderful plugin, I have been seeking exactly this.

My problem is that if I write following script

hello()

function hello()
    fprintf('Hello\n');
end

and try to run it with :MatlabCliRunCell, I get error message
'Error: Illegal use of reserved keyword "end"'

However, script works well when I run it from gui or when I call it by file name on command window.

Shouldn't it save functions in separate files? It seems for me that this feature is not working. Would it be maybe more robust to create temporary file from lines to execute, and then execute this file as command?

Is it possible to use tab autocompletion in matlab?

I noticed that tab autocompletion works if I launch matlab with "matlab -nodesktop -nosplash" in a terminal, but it doesn't when launched from neovim or directly from the supplied script. Is there a specific reason for that, can it be enabled?
In case it matters, this is in Linux

Matlab commands not available in nvim

running MatlabCliRunSelection gives error

 not a editor command in nvim.

Only this commands work

  • MatlabLaunchServer
  • Matlab(Insert/visual/Normal)ModeCreateCell

E492: Not an editor command: MatlabCliOpenInMatlabEditor

I've installed vim-matlab for neovim and I'm able to launch the matlab server and issue command. But I can't open this editor in my matlab (currently running) and matlab is already in the $PATH.

here is the error:

E492: Not an editor command: MatlabCliOpenInMatlabEditor

Besides this (might be related). I don't have :MatlabCliOpenInMatlabEditor in my command mode. I just have these:

:MatlabInsertModeCreateCell  
:MatlabLaunchServer          
:MatlabNormalModeCreateCell  
:MatlabVisualModeCreateCell

But I can launch :MatlabCliOpenInMatlabEdito with ,e. This happens for others as well such as :MatlabCliRunSelection. It seems that I've not these command in my nvim and I don't know why. I re-installed the plugin but that doesn't helped.

p.s. I've set let g:matlab_auto_mappings=1 explicitly to get sure. This is the only configuration I've made after installing the plugin.

Not working on Windows

Thanks for your work!

I am a Matlab user and I really appreciate a Neovim/vim plugin for that! However I have to work on Windows at work.
If I understand it correctly, this plugin doesn't work on Windows .... Do you think if it is possible to make it working on Windows?
Thanks

Workspace browser in vim split

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.

How to start MATLAB with an environment variable override?

I need to start MATLAB with "env MESA_LOADER_DRIVER_OVERRIDE=i965 matlab" to get hardware opengl rendering to work. I have tried to insert this into the python script to start the server, but it throws an error. I have no experience with python. How can I achieve this?

Matlab Server starts with software opengl

I'm facing this issue for the first time on a fresh installation of ubuntu with matlab 2019b.

It seems if I run :MatlabLaunchServer in vim, it starts a matlab instance with software opengl support and doesn't spawn any java windows. If i start the server by running the script (hardware opengl seems to work and everything is fine. If I spawn the matlab instance through the command line, it still recognizes hardware opengl. Any thoughts on what might be the problem?

Run in neovim terminal buffer doesn't work (matlab_server_launcher = 'vim')

Hi,

I'm trying to use matlab built-in terminal buffer instead of tmux (or even split horizontally instead of vertical) and none of the below configurations works. neovim still complain that I need to run inside tmux which I've added these configurations.

let g:matlab_server_launcher = 'vim'  "launch the server in a Neovim terminal buffer

let g:matlab_server_split = 'horizontal' "launch the server in a horizontal split

OSError: [Errno 8] Exec format error

Hey,
for some reason whenever I try to start the Matlab server via the vim-matlab-server.py script I get this Error:

Traceback (most recent call last):
File "./vim-matlab-server.py", line 192, in
main()
File "./vim-matlab-server.py", line 182, in main
server.matlab = Matlab()
File "./vim-matlab-server.py", line 30, in init
self.launch_process()
File "./vim-matlab-server.py", line 35, in launch_process
self.proc = pexpect.spawn("matlab", ["-nosplash", "-nodesktop"])
File "/usr/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 204, in init
self._spawn(command, args, preexec_fn, dimensions)
File "/usr/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 303, in _spawn
cwd=self.cwd, **kwargs)
File "/usr/lib/python2.7/site-packages/pexpect/pty_spawn.py", line 314, in _spawnpty
return ptyprocess.PtyProcess.spawn(args, **kwargs)
File "/usr/lib/python2.7/site-packages/ptyprocess/ptyprocess.py", line 330, in spawn
raise exception
OSError: [Errno 8] Exec format error

On google I've learned that the last line indicates a problem with the shebang line. But I checked it 1000 times and tried other scripts with the same shebang and they work just fine.
I also tried:
using #!/usr/bin/python2 instead of #!/usr/bin/env python2,
reinstalling neovim,
reinstalling the plugin,
reinstalling python.
nothing changed.
I'm a noob and super lost, so any help would be appreciated.

Problem executing large cells: truncated commands

Hi,

It seems that there is an issue when executing cells with a large amount of Matlab code.
The commands get truncated, which causes Matlab to fail executing them.

I haven't had time to investigate this further, but I wrote a dirty quick hack for my own purposes that splits large commands at each ";": arntanguy/vim-matlab@de5b714

There obviously has to be a better solution, but I don't have time to investigate.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.