I have Language server client (vim-lsc) installed as a plugin in neovim. This client interacts with a language server for couple of languages, like python or R, and provides features like autocomplete, variable renaming etc...
One feature I want to use is the code execution, in which case you can select the part of the code and then send it to the LSP server for evaluation and get the response for it. I can do a similar thing if I create a terminal emulator "term://python" and copy paste the code there, but in this way there are two "servers" running, one via the LSP server and other from the terminal, similar to what vim-matlab does.
I was hoping to be able to do both with just one instance of python or R or MATLAb running. If there is a way to send the typed "command" in the terminal emulator to the LSP server via the vim-lsc plugin, then the job can be done with just one instance running.
I also thought of making a vimscript which creates a buffer that emulates terminal (like how Conque or vim-terminal do) and then capture and pass the commands via that script. Although, I was not able to figure out how those plugin made the prompt and command output non-modifiable but keeping the current typed command by the user modifiable.
My reason for preferring the LSP route and not opting for plugins like vimterm is that they don't provide various features like autocomplete and refactoring.
Any suggestions would be welcome. Thanks.
EDIT: I would like to clarify that as of now I don't think vim-lsc has the capability to send the executeCommand request. I wrote a small vimscript (sepatate code) which is able to do that. I plan to submit a pull-request in time and have the feature available in vim-lsc, hence the inclusion of vim-lsc in the description. Apologies for the confusion.
If it's part of the LSP protocol, and you can indeed send the code to the LSP server for execution, then it's not one that vim-lsc has implemented; I can't find it in the helpfile. Best thing you can do is search on the issue page and/or post about the feature yourself.
Related
I'm used to PhantomJS and Watir, which both provide a REPL out of the box. The REPL lets me execute automation calls on a currently-running browser.
This is a fun way to make automation scripts because I can watch the effect of each step as I build an automation script.
In fact, I can even write a script that defines methods for opening a browser, performing a log-in, and other common tasks, and then call them as I please from within the generic Node or Ruby REPL.
Can I execute NightmareJS calls without closing the browser (Electron)?
Without closing? Yes - don't call .end().
If you're asking if you could disconnect the IPC - meaning the calling program ends but does not end the Nightmare instance - and then pick up the Nightmare instance again somewhere else, the answer is no.
#393 (packaging Nightmare functions with an existing Electron application) and #593 (covering v3 wants, including one Electron instance for many applications) are related, but I'm not convinced attaching IPC from new calling applications is a great idea.
If you provide more information about what your circumstances are and what you're trying to do, I'll edit this answer to try to help.
Having a REPL is a different question - I will add it to my list of things to look into. It's a good idea.
I'm planing to make a web app which will allow you to have a Linux Terminal on a web page so that you can execute any command an get the response as if you were in front of your linux terminal.
I planed to use NodeJS as it is server side JavaScript, asynchronous and fast.
Also I saw this wich does exactly what i'm trying to do, I peeked in the source code, but didn't found something useful, I also analysed it with google chrome developer tools on the network tab, but there is absolutely nothing even while executing some commands and getting responses. How is this possible ? what technology do you think they used ?
So I wanted to get your advice, your experience in order to start it the right way.
I firstly decided to use NodeJS, but if there is another programming language or Framework more appropriate for this kind of application please let me know.
If you want a real terminal in the browser using node.js on the backend, you might give tty.js a try.
Alternatively you can use the pty.js module manually which is used by tty.js. Along with that, you could also use xterm for doing the browser-side terminal emulation.
I'm looking for an IDE or environment, or "graphical console" similar to ISE for PowerShell.
I want to work on some JavaScript but not have a new instance of a node runtime everytime. Just like in the console I want to be able to run some code here and there, and still have access to the variables from commands I ran a few minutes ago. Also i'd love one that also can take the JavaScript Objects or JSON and display them visually rather than just in plain text like the console does.
Is there any IDE for this sort of thing, or are all the Node environments build for starting a new Node instance everytime you run your solution?
I'm not a Javascript programmer, so I don't know exactly if this is what you are looking for, but you might check out Cloud9 IDE. It's web-based, supports Node.js, and saves the exact state of your setup so you wouldn't need to restart anything every time you log in.
I need your help. Because I've no idea what I'm doing.
There is this nice plugin vim-instant-markdown I recently stumbled onto. Basically, it's a live preview in a browser, running in the background, while you're writing your text in markdown plugin, and I like the concept.
So, I've tried to get it to work on Windows,
installed Ruby (rubyinstaller-1.9.3-p125)
installed Ruby-DevKit (DevKit-tdm-32-4.5.2-20111229-1559-sfx)
followed instructions on https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
gem install redcarpet pygments.rb
installed node (node-v0.6.10)
npm -g install instant-markdown-d
So far so good,
I open a markdown file in Vim, and it opens (pause button works here) a command line window with my text inside. Browser not seen anywhere.
In the plugin there is an /dev/null "thing" (I'm not an unix guy, more than I needed to be, which wasn't very much - just an ordinary user for most part). /dev doesn't exist on Windows.
To put long story short, my question is - can this be made to work on Windows, the way it should work, or is it a waste of effort even to try it to get it to work?
I'm welcoming all constructive ideas and suggestions.
glad you found this useful enough to want a Windows port! I think it definitely can be done, you just might need more dependencies and hackage.
First of all, understand that there's a server component that is used apart from the actual .vim file to make this work, which is started and stopped on demand. You will definitely need to look at its code, which can be found here.
The server uses open on OSX and xdg-open on Linux to open a browser window, neither of which exist on Windows. On Windows, you can use start (more here). Try to find a way to make the browser window open in the background, and not steal focus, otherwise it will be very annoying.
Also, curl is used to send commands to the server, and curl doesn't exist for Windows. Indeed, I don't think anything similar exists. There is a curl Windows port, though IMO it kinda sucks to add such a thing as a requirement for the plugin...
It seems that you've taken this on at least partially as a learning experience, so I hope you can make it work and send back a pull request! (Of course feel free to keep asking questions if you're stuck) But in the (hopefully unlikely) event that you lose interest or give up, create an issue in github requesting Windows compatibility, and I'll see if I have time to implement it. Also, keep in mind that some questions/comments will be better suited to the project's issues area than here.
Good luck!
How do I control a running Google Chrome instance from the command line? I'm hoping there's something like a -remote flag that will allow me to send in some javascript or somesuch. In particular, I would like to reload the topmost document on the foremost window.
I'm especially interested in Linux/MacOS solutions.
Take a look at http://code.google.com/p/chromedevtools/ . It might be you can use the Debugging Protocol to do the job.
There is also an Ruby Client.
There is also chromix.
You can use this command line tool if you're on a Mac - it uses the Chrome Scripting API, I guess
https://github.com/prasmussen/chrome-cli