daeyun / vim-matlab Goto Github PK
View Code? Open in Web Editor NEWNeovim plugin for MATLAB
License: Mozilla Public License 2.0
Neovim plugin for MATLAB
License: Mozilla Public License 2.0
comment_pattern = re.compile(r"(^(?:[^'%]|'[^']*')*)(%.*)$")
gets hung up with single apostrophes.
Raw code:
%%
A = sqrtm(B) \ C.'; % foo
Z = A * Y; % bar
Run code:
,A = sqrtm(B) \ C.'; % foo,Z = A * Y;
Not sure if there's a regex to handle comment markers + string apostrophes + transpose apostrophes.
Thought about switching ','.join(lines)
to "\n".join
, but that seems to create side effects like line continuation issues (in other code, not in this example).
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'
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
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
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.
Hi,
When I try to run the matlab code using C-m, i get an error saying "not an editor command." However, insert mode commands seem to work pretty well.
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?
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
running MatlabCliRunSelection
gives error
not a editor command in nvim.
Only this commands work
MatlabLaunchServer
Matlab(Insert/visual/Normal)ModeCreateCell
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.
It would be nice to have option to change path to matlab executable as we have multiple versions of matlab.
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
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.
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?
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?
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
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.
Once I've launched a terminal buffer I can no longer use escape to get to the vim command promt nor can I use ctrl-W to swap panes.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.