Vertical Movement with vim-columnmove

A reader who was also a fan of Patternjump sent in vim-columnmove, which is by the same author. This is a plugin that helps make vertical movement more convenient by providing vertical equivalents of motions like f and t.

For example, columnmove-f (mapped to <M-f>) will move the cursor down along the current column to the next matching character.

There's also columnmove-w which is for word-wise movement, where "words" are the characters in the current column. I find this harder to visualise, so I've only really used columnmove-f.

Read More →

Kakoune

Kakoune

Kakoune by Maxime Coste is a Vim-inspired editor that focuses on incremental editing using selections:

Kakoune works on selections, which are oriented, inclusive range of characters, selections have an anchor and a cursor character. Most commands move both of them, except when extending selection where the anchor character stays fixed and the cursor one moves around.

It's a C++/Boost project with ncurses and support for Linux, Mac OS, and Windows with Cygwin.

Read More →

Script Roundup: github-issues.vim

The github-issues.vim (GitHub: jaxbot / github-issues.vim, License: MIT) by Jonathan Warner allows you to look up GitHub issues using Vim. That means the next time you're writing a commit and want to reference a ticket, you can get completion based on issue numbers.

GitHub issues

Typing :Gissues will show the issues for the current repository. If you want to use it with private repositories, then you'll need to set your API access token using let g:github_access_token. Tokens can be obtained from /settings/tokens/new on GitHub.

Read More →

Folding a vimrc

vimrc with folding

Something that surprises people when they see my .vimrc is the fact I use folding to keep it tidy. Because it's a Vim-specific file, I don't mind having a modeline at the top that ensures folding is enabled by default: " vim:fdm=marker. This sets foldmethod to foldmarker so comments can define folds:

" Mouse {{{
set ttyfast
set ttymouse=xterm2
set mouse=a
" }}}

My .vimrc is 109 lines, which I think is way too long, but even if it was shorter I'd probably still use folds to organise it.

Read More →

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

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

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 →