Design by Typing

I got asked about my three preferred web development tools, and I really wanted to answer with simply "Vim". The reason I like Vim for HTML is things like cit ("change inner tag"), ci" (change inner quote), and the visual selection and manipulation possibilities created by these motions.

Coincidentally I ran into Design by Typing, a site dedicated to screencasts for Vim and modern web development. It includes examples for things like responsive layouts, SVG, and publishing with npm.

The responsive photo grid example shows the author navigating and editing HTML with motions that you might find useful if you find the idea of working with HTML in Vim difficult.

Read More →

Get the Vim Stack Exchange Started

There's an Area 51 proposal to get a vi/Vim Stack Exchange site going. The way this works is enough people have to commit to use it. Right now it's 45% complete with 91 people who are committed.

I read a discussion about whether Vim questions belong elsewhere, but due to the volume of Vim questions across Stack Overflow I think it's a reasonable proposal.

People already find a huge wealth of Vim advice on Stack Overflow -- I still find discussions about the "you don't grok vi" post, so a more vi/Vim focused community would be very interesting.

Read More →

Script Roundup: vim-lambdify


Some languages make heavy use of lambdas to the point that you may like to fold them. vim-lambdify (GitHub: calebsmith / vim-lambdify) by Caleb Smith is a plugin that conceals lambdas and inline functions with a lambda character.

It supports Python, JavaScript, and Scheme. It works by replace text for display, but not when the file is saved:

Plugins such as vim-haskellConceal and vim-cute-python use this to replace many different things with more pithy/mathy symbols. The approach taken here is to replace only lambdas, but to do so for many different languages to avoid having to use many plugins for a single feature.

Read More →

Ex Mode

Apparently, NeoVim may be removing Ex mode. The NeoVim developers have found supporting Ex mode adds extra code that they'd like to remove.

Why would you care about Ex mode (:help Ex-mode)? It's basically a mode that allows you to enter several : commands, with some slight caveats. To leave Ex mode you have to type :visual. To enter it, you type Q, which some people hit accidentally and consider an annoyance.

Scripts sometimes use Ex mode, and plugin authors occasionally use it to try out snippets of Vim script. Many people use Vim for years without using it at all, and some even remap Q.

Read More →

Writing to External Commands

I like to use Vim as a general place to manipulate text. Sometimes that means I paste text into an unsaved buffer, pipe it through a Unix command, and then further manipulate the buffer in Vim before finally yanking it and pasting it to another program.

One tool that makes this process easier is :w !cmd, where cmd, is a Unix command. For example, :w !wc will pipe the current buffer to the standard input of wc, giving me a neat character, word, and line count.

This works with unsaved buffers, which is perfect for quickly editing pasted text from a document or web page.

Read More →

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 →