javascript development with vim

Vim is great as a lightweight editor for JavaScript programming. But pretty soon I end up missing some more advanced features like syntax checks and code completion. Syntax highlighting only takes you so far.

Recently I was working on a Node.JS project, so I thought I’d find me some plugins for Vim to get those more advanced development features. Vim is super extensible with its massive plugin ecosystem, but sometimes it can take some tinkering to get things to work. After a bit of searching and trying things out, I managed to get code completion working for JavaScript code, and have basic syntax checking active.

I found that the CoC plugin, in combination with some of its extensions work perfectly.

First you need to install the CoC plugin. This plugin is more of a framework to get code completion and VSCode-like features in Vim. So you can use this for other languages too, like Python, Rust, Java, PowerShell, C#, etc. You need Node installed for this to work, but if you’re working with JavaScript, you most likely have that installed already.

Once you have the plugin set up, you then add CoC extensions for the languages you want to use. For JS this turns out to be the TypeScript server plugin, which gives your JS & Typescript support, including JSX and TSX. I also added the JSON plugin.

To add the CoC extensions, open Vim and install the extensions using:

:CocInstall coc-json coc-tsserver

That’s about it. Now if you open up a .js file, you should be getting JS code completion. If you mess up some code, you’ll get some error indications in the margins, telling you something is not quite right with your code.
Handy stuff!

Yep. There’s clearly something wrong with that code.
Helpful code completion info right there.

A good way to find a list of more CoC extensions is through VimAwesome. There’s something in there for everyone it seems.

short dark shock 5, a darkstep, breakcore compilation

A while back I ran into a tweet from the Darkstep recordings label, asking for submissions for a compilation album. To apply you had to send in a 1-minute clip, which would all be compiled and mixed into a single album.

Track style could be anything, as long as it’s hard & fast. Darkstep, breakcore, jungle, drum’n’bass, glitch, industrial techno, you name it.

I thought I’d give it a shot in Renoise to get to know the software a bit, and it turned out to be pretty much a hardcore techno track. Not the greatest thing I’ve come up with, but it was good enough.

If you’re in the mood for a very noisy and glitchy mix, this might be right for you.

extend visual studio with simple scripts

There’s this neat feature in Visual Studio called External Tools that’s underrated. What it does is allow you to run any external tool and pass in stuff from Visual Studio and do something cool with that. For example the current file in your editor, or the currently selected text.

This means that you can write a PowerShell script that gets some input from the command line, and for example edit a file (the current file in VS), or search for a substring (selected text) in other files, or a database.

I’ve used this to do a complex number of find-replaces on the current file in a single run. I also use this to quickly find the source code of a stored procedure that’s used in code, by selecting the stored procedure’s name and running the script.

How do you set this up?
In Visual Studio, in the menu click Tools, then External Tools.
There you click Add and give the thing a title.
The command can be a bit tricky, but the easiest thing is to use a .cmd script, like test.cmd.

Then you create this cmd file, and make sure it’s in your path. You can also use the full path to the script for your command instead.
Now pick your arguments from the arrow at the right of the Arguments input box. I’m using ItemFileName here, but there’s plenty of options.

You’re all set.

As a test script you can use this gem:

@echo off
echo ** Command line parameters **
echo %*

If you want to wrap a more advanced PowerShell script, you can use this:

@powershell.exe -nologo -noprofile -file c:\tools\do-something-awesome.ps1 %*

If you run this from a file now, you’ll see the passed in parameters in the script’s output. Like this:

With this technique you can easily and quickly extend your Visual Studio setup to do some mundane tasks a lot faster, using PowerShell, Node.js, Python or whatever your favorite scripting language is.

bandcamp friday, if you like it breakcore-ish

Final installment of the “dig up some good tunes from the Bandcamp digital crates and stuff your wish lists with because it’s going to be the last Bandcamp friday” posts.
Today, we’re going for some breakcore vibes.

Greg Hates Car Culture (20th Anniversary) by Venetian Snares. Good old snares breakcore. Need I say more?

Ronin Audio 01 by Ronin. You take some hard dark/skull-step drum’n’bass, mix it up with a fair dose of breakcore and gabba, and you’ll end up with something that sounds like this two track EP from Ronin. I have to be honest, I got these from the lad himself to promote his own fresh, new label, but I actually like them, so they are worth a mention here.

Dead Things EP by Meander is a brutal cross-over experimental kind of EP. It clashes drum’n’bass with breakcore in something that’s quite unique and hard as fuck. Great to blast hard and freak people out.

Another live stream discovery, Anorak with 2 great albums GAPANGA! and Aggiratic. Breakcore that snuggles up with the sounds of the Snares himself, but original enough to stand out on its own.

How about something quite different to finish with? The Samurai Math Beats re-release by Bogdan Raczynski. It’s very electronic sounding IDM/techno kind of stuff. Maybe not really breakcore, but it’s weird enough to fit the bill. You’ll have to check it out to get the picture though. Music is hard to describe anyway.

If this short list doesn’t cut it for tomorrow, check out my previous jungle, industrial and slow- beats post too. You’re bound to find something you like. ;)