ShellCheck

ShellCheck is a static analysis tool for shell scripts. Shell scripting isn't necessarily difficult, but the syntax is hard to get the hang of, particularly if you rarely write shell scripts. ShellCheck is a Haskell program that runs through your scripts and provides warnings and suggestions for improvements. It will help if you're a beginner, but it also catches more subtle issues that even more advanced users may miss.

ShellCheck

I ran it on a script I use for updating usevim images, and it noticed I was using cat where a redirection would have sufficed.

Read More →

dotenv.vim

Yesterday Tim Pope published a new plugin called dotenv.vim (GitHub: tpope/vim-dotenv, License: Vim). It reads variables from a .env or Procfile and sets the corresponding variables in Vim.

This is useful if you have Procfiles for web applications and want to trigger the same commands for local development. Tim notes that you can use dotenv.vim with projectionist.vim and dispatch.vim to get a default :Start of foreman start for projects with a Procfile, which is ideal if you're working on lots of Heroku projects.

Read More →

VimAwesome Plugin Completion

If, like me, you install lots of Vim plugins regularly, then why not autocomplete plugin names based on VimAwesome? Junegunn Choi posted a gist to do this, and it's on Hacker News if you want to upvote it.

VimAwesome

It actually uses a Ruby scrip to download and parse the JSON from vimawesome.com, so you could use the same principle to add all kinds of web-based completion for services like GitHub, npm, RubyGems.org, and so on.

Read More →

Vim Builds in Visual Studio 2015

There have been a few patches to vim's master branch that ensure Vim builds in Visual Studio 2015. Visual Studio has a free "Community" edition that was introduced last year, and one of the main reasons people are excited about the 2015 RC is Microsoft's continued efforts to support cross-platform development.

I'm not really a Windows developer, but I'd prefer to be able to build Vim in Visual Studio rather than having to install GCC for Windows. Builds initially failed under the 2015 RC, but it looks like the main issue was fairly minor. If you're trying out a free RC you should at least be able to get Vim to build again now.

Read More →

Colortuner

Colortuner by Zefei Xuan is a colour scheme editor that allows you to alter the scheme with sliders. There's a slider for brightness, contrast, saturation, and hue. You can also invert the scheme to see the dark/light version.

The interface also allows you to switch between themes, and you can specify a list of themes with g:colortuner_preferred_schemes.

Read More →

Neovim.app: Multiple Windows

Neovim.app windows

The Neovim.app project for Mac OS X has recently got multiple window support. It's starting to feel closer to MacVim, although you'll still need to build it yourself.

I tried sourcing my .vimrc in it, and it worked pretty well without many changes. That's really Neovim doing the hard work, but I wondered about GUI glitches from my colour scheme, syntax highlighting, and plugins.

Read More →

Neovim Client Library for Clojure

Jeb Beich has created a Neovim client library for Clojure: jebberjeb/neovim-client. That means you can use Neovim's inter-process messaging library for scripting Neovim from a Clojure process.

There's a sample plugin that creates a horizontal split and then sets some text in a buffer:

(ns sample-plugin.core
  (:require [neovim-client.nvim :as nvim])
  (:gen-class))

(defn -main
  [& args]
  (nvim/connect!)
  (nvim/hsplit!)
  (let [cur-buf (nvim/get-current-buffer)]
    (nvim/buffer-set-text! cur-buf "Sample plugin was here!")))

You can also open a Clojure REPL and send commands to an instance of Neovim -- see the readme for instructions on how to do this. It might be fun to combine this with Neovim's built-in terminal emulator.

Read More →

Vison: JSON Schema Completion

Vison (GitHub: Quramy/vison) by Yosuke Kurami is a plugin for writing JSON schema files. It handles completion for keys and values, and works with downloadable JSON schemas that are intended to be used for auto-completion.

Vison

The completion menu includes type hints and shows what values are optional, so it will make writing JSON files much easier. This is ideal if you frequently write things like package.json files.

Read More →

Omni Completion and JavaScript

This week I tried out Visual Studio Code (VSCode), a new editor from Microsoft that has features focused on web development. One of the cool things about it is it brings IntelliSense to JavaScript developers, and it's cross platform as well -- it supports Mac OS X, Linux, and Windows.

IntelliSense is one of those things that works well if you're learning a codebase or API, and work with a strongly typed language. Because languages like C# have detailed type hints, IntelliSense is able to provide a rich completion interface that helps you find the right objects and methods. Visual Studio also encourages code comments, and makes typing Microsoft's XML-style comments quite easy.

JavaScript isn't C#, however, so VSCode has to do some extra magic to dredge up the right type hints. It works by using Microsoft's TypeScript definition files. It's a little bit like ctags -- you effectively have a tags file that maps between names and values to aid completion. Type definition fines are written partly by hand, though, so it's not quite as easy as ctags.

Read More →