Haskell Vim IDE

Frogtor, from Learn You a Haskell

Over the last few years there has been an increasing amount of accessible documentation for Haskell. For example, the Learn You a Haskell book has introduced a new audience to the language, without over-simplifying the functional concepts required to write proper Haskell.

I found the Haskell Vim IDE project through Hacker News -- it only has one HN upvote but I think it's worth looking at if you're interested in working with Haskell. The author, Joe Nelson, recommends installing it with curl, so if you decide to do that make sure you check the script is safe first. Once you've got it installed, you get bindings for types, autocomplete, linting, Hoogle, the GHCI repl (in tmux), Git, commenting, aligning, and even tags so you can jump around Haskell programs more easily.

Read More →

Script Roundup: permut.vim

Permut (GitHub: jlemetay/permut, License: Vim) by JYLM is a plugin for swapping columns in a text-formatted table. It requires that a common column separator character is used, and the default is |.

Permut is invoked with :[range] Permut col1 col2 [separator].

You might find this plugin useful if you write tables Markdown. I've found Markdown tables can be difficult to manage, so I end up writing tables in another tool then converting them to Markdown later.

Read More →

Anti-patterns of vimrc

Most of us collect fragments in our vimrc files without ever considering best practices. Anti-pattern of vimrc by rbtnn lists some common mistakes with the fixed alternatives.

The author suggests that it's better to use strict options instead of mixing in abbreviations. Also, you should always use the right scope instead of leaking global variables.

Another interesting point is using groups to define auto-commands to avoid reevaluating them:

Read More →

Scripts of 2014

I've been going over the Script Roundup posts of 2014 to find the things that I still use, enjoyed trying out, or had the most GitHub stars. People have

Textabyss

Textabyss by Liang Li is a plugin for panning around lots of files. It organises files into columns, and allows you to scroll through columns quickly using the mouse. It's a unique idea that's best explained in a video.

Better Whitespace

Better Whitespace (GitHub: ntpeters / vim-better-whitespace) by Nate Peterson is a plugin for highlighting trailing whitespace.

Read More →

Script Roundup: EntryComplete, cf5-compile.vim

EntryComplete

EntryComplete by Ingo Karkat allows you to specify buffers that will be used for line completion (triggered by CTRL-X CTRL-L in Insert mode). This means you can use a file that contains a list of useful snippets, like a cheat sheet.

Ingo was inspired by a stackoverflow post where the issues with the default behaviour of i_CTRL-X_CTRL-L were discussed.

Note that if you want to try this plugin you'll need to install ingo-library and CompleteHelper, also written by Ingo.

Read More →

Read Man Pages with Vim

SuperMan

Vim SuperMan by Jake Zimmerman is a Vim plugin that allows you to read man pages with Vim instead of the default pager. You'll have to add a function to your shell's settings to make it work -- follow the example in the readme to make vman command work.

I tried it out and I thought it worked well. I prefer being able to search and navigate the text using the Vim commands, and the syntax highlight for man pages looks great.

Read More →

The VimL Primer

Benjamin Klein sent me a quick email about the release of The VimL Primer: Edit Like a Pro with Vim Plugins and Scripts. It's a short book that will be published on The Pragmatic Bookshelf.

It will be around 100 pages, and is meant to be released in January. It sounds ideal for those of you who want to get started scripting your own Vim plugins:

The VimL Primer ... gets you comfortable in VimL quickly, walking you through creating a working plugin that you can run yourself as you write it in Vim. You'll learn how to script common commands and buffer interaction, work with windows and buffers from within a plugin script, and how to use autocommands to have Vim recognize entirely new filetypes. You'll discover how to declare filetype-specific settings and define your own syntax elements for use with Vim's syntax highlighting. And you'll see how you can write your own command-line commands and define new mappings to call them.

Read More →

Script Roundup: vim-tab, Vim-Swoop

vim-tab

vim-tab (GitHub: rargo/vim-tab) by Rargo Ye is designed to allow Vim to use a different working directory for each tab. Why? The author provides some interesting background: he writes software for Android, and finds that because Android development can be so complex things like ctags get slow.

vim-tab allows you to set a directory per tab, and also run commands. That means you could reload tags for the new working directory.

The readme on GitHub has more details and configuration examples.

Read More →

Running Tests from Inside Vim

If you're keen on TDD, then leaving your editor to run tests can be annoying. There are lots of options for running tests, however: some people use file watchers to trigger tests when the project's files are modified, and others use test runners from within their IDE or editor. Janko Marohnić sent in test.vim, which is a new plugin for triggering test runners.

Janko wanted features like zero dependencies and configuration, automatically choosing the correct test runner, and a wide range of language/platform support. Lots of Vim test runners are Ruby-focused, which makes sense because the Ruby community is big on testing. However, the exact way in which a single test, test file, or test suite is actually run is highly dependent on each test framework.

The way test.vim works is to associate test runners with strategies. It has to be able to do the right thing for running a test nearest the current line of code (:TestNearest), running the current test file (:TestFile), or running the entire suite (:TestSuite).

Read More →