jalvesaq / vimcmdline

Send code to command line interpreter
GNU General Public License v2.0
223 stars 38 forks source link

Add q (kdb) support #5

Closed statquant closed 11 months ago

statquant commented 8 years ago

I am running a similar functionality that I mostly derived from your notes in vim-r-plugin. With the help of tmux/screen I send selection from my vim buffer to another tmux/screen session. This looks very similar to what your plugin seems to be doing. Is there a possibility for the user to specify any program (would be q for me) and leverage on your plugin ?

jalvesaq commented 8 years ago

Is q the name of an application? To add support to another command line interpreter, you have to create the corresponding files in ftplugin and syntax directories.

statquant commented 8 years ago

Yes q is the name of an application from https://kx.com/, with a trial here: https://kx.com/software-download.php which is massively used in finance. The problem with it is that the interpreter is very sensible to tabs and spaces. I am wondering how the "multiline" sendline would work. I sent a question that has been answered on SO http://stackoverflow.com/questions/20419485/how-to-concatenate-several-lines-in-vim

jalvesaq commented 8 years ago

You have to add the support yourself because I don't have spare time to install and learn q. Please copy the files of one of the already supported languages from syntax/ and ftplugin/ directories, rename them appropriately, make the necessary adjustments in their contents, test the result, and send a pull request. Python is very sensible to tabs and spaces too. So, you could use the files supporting Python as a starting point.

statquant commented 8 years ago

Ok, I never suggested you did all this, I was merely showing you what q was. Will try to pull that out.

xiangpeng2008 commented 6 years ago

Hi, I'm trying to finish this, even though I have no 0 knowledge on vim script (I'm reading the vim script tutorial now), is it possible for you to give me the permission to create a branch in this repository ? Thanks a lot.

jalvesaq commented 6 years ago

Yes, if you can make a pull request creating a branch I will merge it.

jalvesaq commented 6 years ago

I merged the pull request, but the file syntax/cmdlineoutput_kbd.vim is missing, and it is required to get the output colorized in Neovim's terminal.

statquant commented 6 years ago

I am not using neovim,I'll get my hand on a syntax file and send another PR. BTW did you add support to send from multiple buffers I tested vim and thus and it works perfectly.

jalvesaq commented 6 years ago

In the rare occasions that I use vimcmdline, I just edit one script and send the code to one interpreter. I did not intentionally support multiple buffers.

statquant commented 6 years ago

Hey there are many q syntax files available, can I simply copy https://github.com/katusk/vim-qkdb-syntax for instance? Can I also add an indent file?

jalvesaq commented 6 years ago

can I simply copy https://github.com/katusk/vim-qkdb-syntax

No. It's not a q syntax that is missing. Please, install Neovim and take a look at the other syntax files at vimcmdline syntax directory. The output should be highlighted as output, not as the q language.