Coder Social home page Coder Social logo

vimmmex's Introduction

vimmmex : a vim execution engine

Overview

vimmmex is an illustration that a turing machine can be built from copy/paste/search/replace style operations, informally showing the turing-completeness of regular vim commands. we limit ourselves to only the "normal" vim commands - that is, vim "ex" commands (those commands that begin with a colon) and vimscript are avoided, as these are already powerful, and showing their turing completeness is trivial. specifically, vimmmex implements a brainf@!# interperter with vanilla vi commands.

Usage

to use the interpreter, open the file vimmmex in vanilla vim. if possible, reduce the font size so that the entire file fits on the screen - this will make observing execution easier. press gg2yy@" to launch the interpreter. the default BF program calculates prime numbers, up to 100. the numbers will appear on the output line (below "_o:") as they are calculated. calculations are performed by copying and pasting characters while moving about the file through searches and cursor movement keys.

Demonstration

Calculating prime numbers
vimmmex
... while tracking the cursor movement
vimmmex

Versions

the vimmmex_raw file contains (non-ascii) vim special characters, such as ^M and ^R. vimmmex provides a pure-ascii version of the interpreter, in which special characters are inserted by the execution process itself, but uses an (ideally forbidden) vim "ex" command (the first line) to perform the substitution. this may be more conducive for copying and pasting the contents of the file.

Limitations

the only non-vi compatible requirement is that "whichwrap" is set to at least "b,s" - this is the default for vim, and is automatically configured when "nocompatible" is set. this requirement is only in place for aesthetics, as it allows breaking one long line into several smaller lines.

vimmmex's People

Contributors

xoreaxeaxeax avatar

Watchers

James Cloos avatar Mr.Jack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.