Home

Awesome

Autovim (UNDER DEVELOPMENT)

Build Status

Autovim is simply Vimscript optimized for processing files using the command line. It also has special syntax additions, built-in mappings and updated defaults to make it better suited for code golfing. It is directly inspired by V.

Installation

Autovim currently works on Linux and Windows using Git Bash (not in PowerShell or cmd.exe). You also need to have VIM installed and available in your PATH. It is tested against VIM 7.4.1721 and 8.0.

Since this is still under development, installation is done manually; simply checkout this repo, run chmod +x ./bin/autovim and you're good to go!

Usage

autovim run script.autovim will run the specified script on whatever is provided to stdin, and write the output to stdout.

See the tutorial to get started.

See the documentation for more information.

Why

Syntax

Any Vimscript script file will work as is; Autovim will simply expand compressed expressions. Therefore, this:

ñÿ®xp

is the exact equivalent of

execute "normal! yy" . @x . "p"

See Autovim Documentation for more syntax examples.

Contributing

This project is mostly for learning purposes, but if you think you can use it yourself and feel like contributing, please do so. The only requirements is that tests still pass, the coding style is similar to the rest and new functionality has been discussed with me first.

To run tests, simply run chmod +x ./tests/test and run the script.

How does it work?

Three things are happening:

  1. ./bin/autovim takes the command line inputs and forward them to vim by setting a g:autovim_cmd variable using --cmd
  2. ./src/vimrc is used to provide the runtime environment common to the scripts and autovim itself - it also defines mappings like ÿ
  3. ./src/autovim.vim then parses the input, loads the script, do some regex replacements on it, and finally runs (source) the result on the input file

Fun facts

All of Autovim and its documentation was written on an Android phone (Samsung S7 Edge) thanks to the awesome Termux.

Resources