vimcmdline icon indicating copy to clipboard operation
vimcmdline copied to clipboard

Add q (kdb) support

Open statquant opened this issue 8 years ago • 11 comments

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 ?

statquant avatar Apr 18 '16 17:04 statquant

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.

jalvesaq avatar Apr 18 '16 20:04 jalvesaq

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

statquant avatar May 06 '16 10:05 statquant

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.

jalvesaq avatar May 06 '16 10:05 jalvesaq

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

statquant avatar May 06 '16 15:05 statquant

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.

xiangpeng2008 avatar May 12 '18 10:05 xiangpeng2008

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

jalvesaq avatar May 12 '18 11:05 jalvesaq

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.

jalvesaq avatar Jun 10 '18 12:06 jalvesaq

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.

statquant avatar Jun 10 '18 15:06 statquant

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.

jalvesaq avatar Jun 10 '18 16:06 jalvesaq

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?

statquant avatar Jun 10 '18 20:06 statquant

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.

jalvesaq avatar Jun 10 '18 21:06 jalvesaq