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

a_indent

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 →

WinMan

WinMan now has a website and GitHub repository. The repository doesn't have any source code -- the author isn't sure if it will be open source yet.

WinMan is a "window manager" for OS X that handles windows, apps and other things using Vim-like expressions. If you are used to and love Vim, then this is the ultimate tool to get rid of the mouse even outside of your text editor.

I previously wrote about WinMan last month in A Vim-inspired Mac Window Manager. Back then it was just an interesting video, but it's received some attention from reddit and the author continues to make progress videos.

Read More →

Script Roundup: Vim-EPUB

Vim-EPUB

Vim-EPUB (GitHub: etnadji / vim-epub, License: GPL) by Etienne Nadji is an eBook editing plugin that makes it easier to work with EPUB files.

For example, :AddEmptyPage adds a new page, :AddEmptyCSS adds a CSS file, and :AddMedia can be used to add image files and fonts.

The :OpenReader command opens the resulting document in the system's default EPUB reader.

Read More →

Vim in Windows Redux

Knowing that cmd.exe is nowhere near a modern Unix terminal and shell, I usually tell Windows Vim users to install gVim. gVim feels fast and very close to the experience of gVim on Linux or MacVim.

One of the things I love about the Unix terminal workflow is tmux. I've got so used to using it for multiple windows and split panes that I prefer it to most GUI environments. It's not really just tmux though, it's the way I work on the command-line next to Vim.

The last few years has seen a renaissance in Windows shell development. One example of this is cmder:

Read More →

How to Boost your Vim Productivity

How to boost your Vim productivity by Adam Stankiewicz has some thoughtful tips about improving the way you use Vim. The first tip is about changing Leader to the space bar, which Adam says means he can keep his fingers on the home row because space is easy to hit with both thumbs.

Other tips include some useful plugins for manipulating visual selections, tmux, and more remapping techniques.

It was published back in March, so there are some useful comments as well.

Read More →

Script Roundup: Clickable.vim, SearchInRange

Clickable.vim

I have this in my .vimrc:

set ttyfast
set ttymouse=xterm2
set mouse=a

Combined with this in .tmux.conf:

set -g mode-mouse on
set-option -g mouse-select-pane on
set-option -g mouse-select-window on
set-option -g mouse-resize-pane on

It means I can resize panes and navigate with the mouse. I don't use it very often, but it can be a nice surprise when people pair program with me and realise my console setup isn't as hard to learn as they expected.

Read More →

Vim Bootstrap

Vim Bootstrap is a web app that helps you to quickly generate a new .vimrc. It allows you to select from a list of programming languages, then creates a file that includes the appropriate NeoBundle dependencies.

To use the file, copy it to ~/.vimrc and then install the dependencies with vim +NeoBundleInstall +qall.

Vim Bootstrap supports further customisation through an optional .vimrc.local file, so you don't need to modify the original.

Read More →