exercism/vimscript

Name: vimscript

Owner: exercism

Description: Exercism exercises in Vim script.

Created: 2017-02-20 22:12:38.0

Updated: 2017-12-13 19:38:41.0

Pushed: 2018-02-07 16:28:30.0

Homepage: http://exercism.io/languages/vimscript

Size: 134

Language: Vim script

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Exercism Vim script Track

build status Join the chat at https://gitter.im/exercism/vimscript

We welcome any kind of contribution!

If you have a suggestion or question, create a new issue.

For code or fixing typos and similar things, open a pull request.

Look at recent commits to get a feeling on how to format your own ones.

Even if there are any uncertainties, go for it nevertheless. We can straighten out everything in the process.

Thank you for contributing! :tada:

Linting Vim files

If you add or change a Vim file, the CI will use vint to ensure best practices. Therefore it's recommended idea to run it locally first, before creating a pull request.

  1. Install vint.
  2. Recursively lint all Vim files:
    nt .
    
Writing test files
Generating test files

Use the generator to create Vader files from their canonical test data:

 Vim
rce lib/generate.vim
erate word-count

This would fetch the canonical test data, decode the JSON to Vim data types, iterate over the result, and put the tests in a new unnamed buffer.

This script requires Vim 7.4.1304+ for json_decode(). It also relies on the netrw plugin (:h netrw), but that one is shipped and sourced by default.

Type mismatch exceptions

Older Vims don't like changing types for the same variable. If your tests use global variables, unlet! them in a Before block at the top of the Vader file.

When each test uses let expected = ..., then put this at the top:

re:
let! expected

This is patched as of Vim 7.4.1546, but we shouldn't assume versions in favor of compatibility.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.