What editors are best used for q coding? And how to get the syntax highlighting

1,722 views
Skip to first unread message

Pratyush Raman

unread,
Aug 25, 2015, 4:42:46 AM8/25/15
to Kdb+ Personal Developers
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

Yan Yan

unread,
Aug 25, 2015, 5:00:23 AM8/25/15
to Kdb+ Personal Developers

Nick Psaris

unread,
Aug 25, 2015, 6:25:04 AM8/25/15
to personal...@googlegroups.com
if you like emacs, try: https://github.com/psaris/q-mode
--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.

Yan Yan

unread,
Aug 25, 2015, 7:57:48 AM8/25/15
to Kdb+ Personal Developers


On Tuesday, August 25, 2015 at 4:42:46 PM UTC+8, Pratyush Raman wrote:

Andrew Kozyrev

unread,
Aug 25, 2015, 8:20:30 AM8/25/15
to Kdb+ Personal Developers
I've added some plugins for Q for Atom (www.atom.io) editor. It is node/chrome based and thus slower than native editors but you can easily extend it if you need something.

Pratyush Raman

unread,
Aug 25, 2015, 10:00:55 AM8/25/15
to Kdb+ Personal Developers
Hey Nick,
Yes huge fan of emacs- does this have all features that Simon has planted in vim?

Thanks vm
Pratyush


On Tuesday, 25 August 2015 15:55:04 UTC+5:30, Nick wrote:
if you like emacs, try: https://github.com/psaris/q-mode

On Tuesday, August 25, 2015, Pratyush Raman <prty...@gmail.com> wrote:
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.

Pratyush Raman

unread,
Aug 25, 2015, 10:00:55 AM8/25/15
to Kdb+ Personal Developers
I have found atom to be relatively unstable.
I will try this out though!

Pratyush Raman

unread,
Aug 25, 2015, 10:00:55 AM8/25/15
to Kdb+ Personal Developers
I have checked these at contrib location. Most of them are written long back/
For one I had lack of version compatibility.

Pratyush Raman

unread,
Aug 25, 2015, 10:07:38 AM8/25/15
to Kdb+ Personal Developers
Urge you to link the code in the git page for kx :)


On Tuesday, 25 August 2015 15:55:04 UTC+5:30, Nick wrote:
if you like emacs, try: https://github.com/psaris/q-mode

On Tuesday, August 25, 2015, Pratyush Raman <prty...@gmail.com> wrote:
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.

Nick Psaris

unread,
Aug 25, 2015, 10:23:07 AM8/25/15
to personal...@googlegroups.com
i can't claim to know what Simon's vim mode does.  but q-mode does perform syntax highlighting

and in addition, it allows you to communicate with a q/qcon process so you can send single lines, regions, functions or whole buffers.  (very similar to the way ESS-mode allows you to interact with an R/S process)


On Tue, Aug 25, 2015 at 9:58 PM, Pratyush Raman <prty...@gmail.com> wrote:
Hey Nick,
Yes huge fan of emacs- does this have all features that Simon has planted in vim?

Thanks vm
Pratyush

On Tuesday, 25 August 2015 15:55:04 UTC+5:30, Nick wrote:
if you like emacs, try: https://github.com/psaris/q-mode

On Tuesday, August 25, 2015, Pratyush Raman <prty...@gmail.com> wrote:
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.

Yan Yan

unread,
Aug 25, 2015, 10:44:47 AM8/25/15
to Kdb+ Personal Developers
nick: i have been waiting for your q-mode. can your q-mode automatically add a prefix to every expression submitted to kdb thru ipc? one useful prefix i often use is 'system "d .rdb"' to make sure that stuff goes to the .rdb namespace. the 'system "d .rdb"' is only effective during the ipc call. so it has to be submitted as a prefix every time.


On Tuesday, August 25, 2015 at 10:23:07 PM UTC+8, Nick wrote:
i can't claim to know what Simon's vim mode does.  but q-mode does perform syntax highlighting

and in addition, it allows you to communicate with a q/qcon process so you can send single lines, regions, functions or whole buffers.  (very similar to the way ESS-mode allows you to interact with an R/S process)

On Tue, Aug 25, 2015 at 9:58 PM, Pratyush Raman <prty...@gmail.com> wrote:
Hey Nick,
Yes huge fan of emacs- does this have all features that Simon has planted in vim?

Thanks vm
Pratyush

On Tuesday, 25 August 2015 15:55:04 UTC+5:30, Nick wrote:
if you like emacs, try: https://github.com/psaris/q-mode

On Tuesday, August 25, 2015, Pratyush Raman <prty...@gmail.com> wrote:
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.

Simon Garland

unread,
Aug 25, 2015, 10:59:45 AM8/25/15
to Kdb+ Personal Developers
my vim stuff only does syntax colouring: 


if you want more advanced features like communicating with a q session see attila's version at:

Ryan Gonzalez

unread,
Aug 25, 2015, 12:00:23 PM8/25/15
to personal...@googlegroups.com
I use Howl + howl-k; even though it's technically for K2, it works well with Q.

(Speaking of which, I've been meaning to write a Q bundle based on howl-k, but I haven't gotten the chance yet.)


--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.



--
Ryan
[ERROR]: Your autotools build scripts are 200 lines longer than your program. Something’s wrong.

Nick Psaris

unread,
Aug 25, 2015, 7:04:29 PM8/25/15
to personal...@googlegroups.com
good idea yan. i'll take this offline to discuss the merits of having it configured as a global/file-local variable or a prefix arg to the functions. 

On Tue, Aug 25, 2015 at 10:44 PM, Yan Yan <lamh...@gmail.com> wrote:
nick: i have been waiting for your q-mode. can your q-mode automatically add a prefix to every expression submitted to kdb thru ipc? one useful prefix i often use is 'system "d .rdb"' to make sure that stuff goes to the .rdb namespace. the 'system "d .rdb"' is only effective during the ipc call. so it has to be submitted as a prefix every time.

On Tuesday, August 25, 2015 at 10:23:07 PM UTC+8, Nick wrote:
i can't claim to know what Simon's vim mode does.  but q-mode does perform syntax highlighting

and in addition, it allows you to communicate with a q/qcon process so you can send single lines, regions, functions or whole buffers.  (very similar to the way ESS-mode allows you to interact with an R/S process)

On Tue, Aug 25, 2015 at 9:58 PM, Pratyush Raman <prty...@gmail.com> wrote:
Hey Nick,
Yes huge fan of emacs- does this have all features that Simon has planted in vim?

Thanks vm
Pratyush

On Tuesday, 25 August 2015 15:55:04 UTC+5:30, Nick wrote:
if you like emacs, try: https://github.com/psaris/q-mode

On Tuesday, August 25, 2015, Pratyush Raman <prty...@gmail.com> wrote:
I have tried vim, emacs and sublime. I find significant quality of life improvement when using highlighting while I code in q.
Emacs does not seem to have an active contribution to syntax highlighting. Vim's highlights written by Simon Garland seems to be a standard.

Let me know what are you using and what are your preferences?

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
Visit this group at http://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.

Kim Tang

unread,
Aug 25, 2015, 8:00:32 PM8/25/15
to personal...@googlegroups.com

I personally use sublime.

 

Syntax highlighting is here: https://github.com/kimtang/sublime-q/

 

And there is also a plugin where you can send q commands directly to a q process via kdb+ studio. The idea is to load kdb+ studio into sublimerepl via scala. From there you can execute any q commands from sublime and have the results displayed in kdb+ studio.

 

Unfortunately the plugin depends on sublimerepl and scala and the installation is not trivial. So that’s why it is not available to the community yet.

 

Kim

--

Pratyush Raman

unread,
Aug 26, 2015, 7:24:18 AM8/26/15
to Kdb+ Personal Developers
I want to change the way assignment changes formating.
e.g., "func: `abc " formats func to a symbol
but   "func,: `abc" doesnt format

Kim Tang

unread,
Aug 27, 2015, 2:56:03 AM8/27/15
to personal...@googlegroups.com

Ok, done.

yogesh garg

unread,
Aug 27, 2015, 3:12:42 AM8/27/15
to personal...@googlegroups.com
I also use sublime, it's much better to view at the very least, I and a friend wrote a simple plugin to send q queries from sublime to q servers over http. It's not much, but it's something! We're yet to write something to send queries over tcp.

Kim, Thanks for your highlighting plugin!

If the above mentioned plugin can be used by a wider community, I'd be happy to re-write it.

Yogesh Garg

Pratyush Raman

unread,
Aug 27, 2015, 3:42:59 AM8/27/15
to Kdb+ Personal Developers
Hey Kim,
I still see the same issue.
Not sure if I am doing something wrong...
-Pratyush

Pratyush Raman

unread,
Sep 22, 2015, 5:48:05 AM9/22/15
to Kdb+ Personal Developers
I have settled on vim for now. Simon's script for syntax is very useful.
I found Sublime equally good, but since most of my work is Unix based, makes more sense to use vim.

Attila Vrabecz

unread,
Sep 23, 2015, 6:19:00 PM9/23/15
to [kdb+] [kdb+]
Actually recently I've been using Nick's emacs config in spacemacs (https://github.com/syl20bnr/spacemacs) with vim bindings of course

Cheers,
   Attila

Kim Tang

unread,
Sep 24, 2015, 2:19:43 AM9/24/15
to personal...@googlegroups.com

I am now using lighttable. Syntax highlighting for q is there already , quite nice J. What is missing is a plugin to have repl supported for q. Anyone there working on this?

 

Thanks,

 

Kim

 

Von: personal...@googlegroups.com [mailto:personal...@googlegroups.com] Im Auftrag von Attila Vrabecz
Gesendet: Donnerstag, 24. September 2015 06:19
An: [kdb+] [kdb+]
Betreff: Re: [personal kdb+] What editors are best used for q coding? And how to get the syntax highlighting

 

Actually recently I've been using Nick's emacs config in spacemacs (https://github.com/syl20bnr/spacemacs) with vim bindings of course

Komsit Prakobphol

unread,
Nov 5, 2015, 8:05:07 AM11/5/15
to Kdb+ Personal Developers
How about chrome? 

It support syntax highlighting and REPL on the browser. Also, it wraps your code in a function so it's safe to run on rdb.
It's not be a full fledge IDE, but I find it useful for quick query on hundred of kdb instances that I have at my work :)

You will need to install the plugin from source at the moment, but I might release to chrome store if people find it useful.

Komsit

Kim Tang

unread,
Nov 5, 2015, 4:46:04 PM11/5/15
to personal...@googlegroups.com

Nice,

 

Thx for sharing.

 

Kim

 

Von: personal...@googlegroups.com [mailto:personal...@googlegroups.com] Im Auftrag von Komsit Prakobphol


Gesendet: Donnerstag, 5. November 2015 21:02
An: Kdb+ Personal Developers

--

Yan Yan

unread,
Nov 6, 2015, 7:21:44 AM11/6/15
to Kdb+ Personal Developers
How could I get syntax highlight when I copy from a kdb/q editor and paste on this forum?


On Tuesday, August 25, 2015 at 4:42:46 PM UTC+8, Pratyush Raman wrote:
Message has been deleted

Yan Yan

unread,
Nov 6, 2015, 7:45:44 AM11/6/15
to Kdb+ Personal Developers
Can I have custom prefix and suffix stored for each host:port combination rather than closures? Closures work like prefix="{" and suffix="}[]"

Jack Andrews

unread,
Nov 6, 2015, 7:28:33 PM11/6/15
to Kdb+ Personal Developers
Yan,

> How could I get syntax highlight when I copy from a kdb/q editor and paste on this forum?


Simon wrote:
>  my vim stuff only does syntax colouring: 

--

Komsit Prakobphol

unread,
Nov 7, 2015, 3:18:14 AM11/7/15
to Kdb+ Personal Developers
I have updated the plugin. Now you can change custom template. Interestingly, if you change it to 'system"%0"', you can almost use q as a remote terminal!

Yan Yan

unread,
Nov 7, 2015, 3:24:33 AM11/7/15
to Kdb+ Personal Developers
ty

Yan Yan

unread,
Nov 8, 2015, 7:22:57 AM11/8/15
to Kdb+ Personal Developers
My query takes a long time to run and it gives a long resultset that spans multiple pages. After clicking the pageDown link the URL becomes


Can I write the query in such a way that it takes advantage of the row number in the URL to fetch just enough rows for display? The built-in hdb browser already does that.

On Thursday, November 5, 2015 at 9:05:07 PM UTC+8, Komsit Prakobphol wrote:

Komsit Prakobphol

unread,
Nov 9, 2015, 2:41:46 AM11/9/15
to Kdb+ Personal Developers
You can increase html output size by running
system"C 1000 1000"

but the limit is 2000 rows. And I actually like it this way because it's much faster and use less memory than fetching all results in one go

Going forward, I think it's better to raise feature request/issue for the plugin in the github page instead of in this post. Since this is a bit off the topic

Carfield Yim

unread,
Nov 9, 2015, 6:15:01 AM11/9/15
to Kdb+ Personal Developers
Hi, I would like to give it a try but look like "Load unpacked extension" is disabled?



On Thursday, November 5, 2015 at 9:05:07 PM UTC+8, Komsit Prakobphol wrote:

Komsit Prakobphol

unread,
Nov 9, 2015, 10:50:23 AM11/9/15
to Kdb+ Personal Developers
Did you try checking the developer mode on the top right of the extension page? see the attached screenshot
Screen Shot 2015-11-10 at 12.45.10 AM.png
Reply all
Reply to author
Forward
0 new messages