tweekmonster / haunted.vim

:ghost: Scripted automation in Vim using ghosts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

haunted.vim

This is an experimental plugin for scripted automation in Vim using ghosts :ghost:

a ghost

Requirements

Nvim 0.1.5 or Vim 7.4.1626 for the has('timers') feature.

Installation

Follow your package manager's instructions.

Usage

The :Haunt command runs a haunt script. Without a file argument, it will run the current buffer's content. You can cancel the haunting with Shift+F12.

Format

Each non-blank line in a haunt script is fed into Vim as if you were typing them. Non-printable characters must use the \<key> notation as described in :h expr-quote. For example, newlines are ignored, so you must use \<cr>.

A line that starts with ## (it has a space after it) is a haunt directive. A line that starts with ### is a comment.

Haunt directives

Name Description
pause Pauses for a duration (in ms). Without arguments, defaults to 1000
execute Execute a command
key_delay Sets the amount of time between keystrokes (in ms). Two arguments will cause the delay to be random within the range.
feed_full Feed in the next line as a whole instead of individual keystrokes. Useful for operator keys.
show_keys Displays keystrokes on screen. Argument is the time before clearing the buffer. 0 to disable and hide.

Example script: support/demo/demo.hnt

License

MIT

About

:ghost: Scripted automation in Vim using ghosts

License:MIT License


Languages

Language:Vim Script 94.7%Language:Python 5.3%