Loading Projects

On reddit there's a post about managing projects in Vim: How do you load projects?

I recently added a "Project loading" section to my vimrc. I want to load a project in vim quickly. I will cd to the root, run ctags, give custom configurations to a plugin, etc. I am currently using a function for each project. A naming convention is used so I can type :call Load Then tab through the wild menu. I shortcut the the project I'm working on. Combined with Tim Pope's Dispatch it really opens up the doors to load smoothly.

I don't use any specific project management plugins. Instead I use the following tools:

Read More →

Script Roundup: Pterosaur, Arrow Key Repurpose


Pterosaur (GitHub: ardagnir / pterosaur, License: AGPL) by James Kolb allows Firefox to use Vim for text inputs. It's built using Pentadactyl, which is a Vim-inspired add-on.

It currently has some quirks and bugs, but the author has put troubleshooting tips into the readme.

Arrow Key Repurpose

Arrow Key Repurpose (Bitbucket: atimholt / arrowkeyrepurpose) by Tim Holt changes the arrow keys to do some things that you might find more useful:

Read More →

Neovim: Two Days Left

Neovim's funding drive is currently at $27,069 (271% of the goal). The 30k stretch goal is to refactor Vim into a reusable library:

$30,000: Refactor the editor into a library. It will require changing the way vim reads input or emits output. More details here. This will allow programs to embed the editor in the same process for better efficiency(no more marshalling of json/msgpack documents between the GUI and the core).

If you want to support the project then you better move quickly!

Read More →

Vim Adventures Quiz

Vim Adventures Quiz

I just discovered a new Vim Adventures game, the Vim Adventures Quiz. This is a smaller challenge where you're tested on the number of keystrokes made to fix a text file.

You can type :help to get instructions for the game and some Vim tips, and :q to exit. The :keyboard command allows you to press a key and get a textual description of what it would do in Vim, which is really useful. If you get stuck you can click the icon on the bottom left to display a menu.

Read More →

Script Roundup: Markology, Nomad


Markology (GitHub: jeetsukumaran / vim-markology) by Jeet Sukumaran shows marks for the current line in the sign column. Marks can be added, deleted, and toggled, and you can jump between the marks in the current buffer.

It's built using parts of ShowMarks and Mark Tools:

Like "ShowMarks", Markology provides visual representation of |marks| local to a buffer by placing a |sign| in the leftmost column of the buffer indicating the label of the mark and its location.

Read More →

Big Integers in Vimscript

Magnum by David B├╝rgin is a Vimscript implementation of big integers. Vimscript has two numerical types, Numbers and Floats. Number is 32 bit, so anything larger than about two billion (2,147,483,647) will wrap:

let a=2147483647
echo a
" 2147483647

let a=2147483648
echo a
" -2147483648

Inspired by this limitation, magnum.vim implements algorithms from a book (BigNum math, Syngress, 2006) that support larger integers. This involves implementing methods for mathematical operations and string encoding:

Vim script is not well suited for the task of implementing big integers. It doesn't have suitable unsigned integer types, nor sufficient support for bitwise operations. In the implementation we instead rely a lot on basic arithmetic.

Read More →

Testing One-off Scripts

I was recently teaching some non-programmers Ruby, and I used TextMate 2 as the editor. The reason I used TextMate 2 was because it's open source, easy to install, and can run Ruby programs with a quick press of cmd-r.

It seems like a lot of people miss this feature when they switch to Vim. Thomas Allen wrote a post about how to write your own program execution mappings, called Testing One-off Scripts in Vim. The basic idea is to create a Vimscript dictionary that maps file types to command-line programs, so you can type <C-p> to run a script instead of :w !python, or the equivalent command for your programming language.

I liked Thomas's example because even though it's written with Vimscript, which is known for being inscrutable, it's easy to follow and extend. This may help you ease yourself into Vim from your previous editor of choice.

Read More →

Script Roundup: t9md

A sample of t9md's work.

A reader sent in t9md's GitHub profile, which contains some cool Vim projects:

  • vim-choosewin has a tmux-inspired window numbering system
  • vim-ezbar is a minimalist status bar plugin
  • vim-smalls supports EasyMotion-style jumping with highlighting, fold skipping, and more features
  • vim-chef, a plugin for jumping around Chef recipes

The person that sent this in said they discovered t9md when looking at Shougo's .vimrc. He has also written lots of cool Vim projects, like Unite.vim and NeoBundle.

There are many more plugins than the ones I've mentioned here, so I think it's worth exploring t9md's projects to see what else he's made.

Read More →

Why Atom Can't Replace Vim

Why Atom Can't Replace Vim by Mike Kozlowski discusses why we love Vim:

Vi is fundamentally built on command composability. It favors small, general-purpose commands that can be combined with objects to compose larger commands. By contrast, Emacs and its philosophical descendants (including Sublime Text and Atom) use monolithic, special-purpose commands.

And composability is about more than just power, it's also learnability and consistency. The command for copying text in Vim is y. Do you know how to copy to the end of the line/file/paragraph? Of course you do: It's y$, yG, and y} respectively. The command for increasing the indent is >, so you instantly know >$, >G, and >}. Convert to lowercase is gu, so... sure enough: gu$, guG, gu}.

Read More →

LLDB Vim Frontend

Ahoy there, fellow binary wrangler. If you work with LLDB and want better Vim integration, then you may want to take a look at Tobias Pflug's vim-lldb. It's a fork of LLVM's Vim plugin -- the goal of the fork was to simply remove the pathogen dependency and improve the documentation.

Tobias thinks the script is useful but underused, so he'd like to get people to try it out. It requires Vim 7.3 and above, and the lldb executable needs to be in the current path.

It supports breakpoints, watchpoints, threads, and locals. That's pretty much everything I use from Xcode anyway, minus the beachballs which I hear are an exclusive feature baked into Xcode.

Read More →