Script Roundup: rogue.vim



Sometimes in life a hobgoblin hits you, but then it's OK because you defeat it and find a green potion. I've getting back into Rogue, thanks to rogue.vim (GitHub: katono / rogue.vim, License: MIT) by Kato Noriaki. This is a Vim implementation of Rogue. It requires Lua-enabled Vim, which I installed with brew install vim --with-lua.

If you don't already know, Rogue uses hjkl for movement, so it's a great excuse to play a game while practising essential Vim skills. This version includes lots of useful stuff, like the Rogue man page, guide, and also documentation for rogue.vim itself.

Read More →

Learn Vim with No Settings

Most people end up with huge .vimrc files and lots of configuration options. That can make using a standard installation of Vim tricky. So just how much vanilla Vim do you remember?

First, start Vim like this:

vim -u NONE

The -u option lets you change the .vimrc that Vim loads, so in this case no file will be used. Now when you start Vim it'll behave more like vi.

Read More →

Neovim Update for September

I'm still following Neovim's progress, and there's just been an update for September. The project now has 1,000 issues and pull requests. The contributors have been working on removing dead code for legacy systems, unit tests, and the RPC implementation.

One of the cool things about Neovim is it uses libuv, and a Neovim contributor has actually been sending pull requests to the libuv project:

@Hinidu, one of Neovim's contributors, sent a pull request to libuv to add a new function, uv_fs_mkdtemp. The changes (now part of libuv version 0.11.27) are being used by Neovim to provide temporary file/directory creation and the changes work across platforms.

Read More →

Script Roundup: Browserlink


Browserlink (GitHub: jaxbot / browserlink.vim, License: MIT) by Jonathan Warner is a plugin to show a live preview of a Vim buffer in a browser. You can also evaluate selections of JavaScript, and the author demonstrates this with something that looks like a HTML5 game.

Browserlink is very simple. The plugin itself hooks autocommands for file changes (and other things) to the provided functions. The functions connect through HTTP to a node.js backend, which your webpage connects also to. The entire process happens extremely fast.

The source for the Node server is here: brolink.js. It uses WebSockets to perform realtime updates, and it looks like it should run on Windows as well.

Read More →

CI for Vim

With all the Vim forks and reinventions of Vim, I thought readers might find it interesting to learn about vim-ci, created by the vim-jp community.

This repository includes a fork of Vim as a submodule and includes a build script so a continuous integration server like Travis can easily handle the output. The build script triggers ./configure with make && make test so it's easy to run the tests.

I found this through a thread on vim dev where Marslo Jiao was asking about how to adapt Vim to help maintain a Windows Vim build.

Read More →

Emacs Evil Mode and SLIME

I've recently seen people using Vim plugins in just about every editor: Visual Studio, WebStorm, Atom, Sublime, and Emacs. Emacs seem to appeal to a particular type of programmer: experimenters who try out lots of languages only to find Lisp strangely rewarding.

Lisp programmers like Emacs because of SLIME. This is basically an editor mode dedicated to developing Lisp applications. You can quickly evaluate selections of code or the whole file, inspect values, skip to files based on stacktraces, and restart programs. It really gives you a feeling of being able to accurately work with parts of large, complex programs without treating them as impenetrable monoliths.

For an introduction to SLIME, take a look at the SLIME chapter in Lisp: Outside the Box.

Read More →

Script Roundup: C64.vim, autorepeat.vim



C64.vim is a colour scheme that uses the 16 preset colours available on a Commodore 64. Of course, you'll need to run this through a CRT display to really appreciate it, but at least you don't have to load it from a cassette tape.


autorepeat.vim (GitHub: daisuzu / autorepeat.vim) by Daisuke Suzuki is a plugin to repeatedly execute a command until a key is pressed.

Read More →

Italic Fonts in iTerm and Vim

In Enabling italic fonts in iTerm2, tmux, and vim, Alex Pearce explains the steps required to get italic fonts working in console Vim on a Mac. You'll need a font that supports italics, like Consolas, and some configuration for iTerm, tmux, and Vim.

I really like having comments in italic. It differentiates them one step more from the surrounding code, and it makes sense semantically too, as a comment is treated very differently from anything else in the source.

Because Alex's solution changes the value of $TERM, you might see errors when sshing to remote servers. He explains how to extract the termcap values, but you could alias ssh to TERM=xterm-256color ssh.

Read More →

Configuring Vim for SICP

Structure and Interpretation of Computer Programs (PDF: sicp.pdf) is a popular book used as an introduction to computer science. It uses MIT Scheme, and covers concepts that are now mainstream concerns, like concurrent programming, functional programming, and lazy evaluation.

In Configuring Vim for SICP, the author explains how to set up Vim and tmux for following along with the book. Racket is recommended as the Scheme interpreter, because the REPL is more friendly than MIT Scheme. There's also a third-party package to support people reading SICP.

Steve Losh's tslime.vim fork is recommended for quickly evaluating code by passing it from Vim to tmux and the Scheme interpreter.

Read More →

Script Roundup: a_indent, Session-Viminfo-Management


aindent (GitHub: caigithub / aindent) by Colin Cai is a plugin for manipulating code blocks. It's relatively language agnostic because it scans for blocks based on indentation.

Typing am selects the current code block, and ai selects code based on the current level of indentation. There are also some jump commands, like M for jumping to the next block with the same level of indentation.

I usually select blocks based on brackets with %, which is the motion for matching brackets. This isn't always that convenient, however, because I have to first move to the nearest bracket.

Read More →