Metadata-Version: 2.4
Name: submizeVim
Version: 0.1.1
Summary: Run Vim commands against a file from Python.
Author: submizeVim maintainers
License-Expression: MIT
Project-URL: Homepage, https://pypi.org/project/submizeVim/
Project-URL: Source, https://pypi.org/project/submizeVim/
Keywords: vim,automation,text-editing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Text Editors
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# submizeVim

`submizeVim` is a tiny Python helper for running Vim Ex commands against a file in
the current working directory.

## Install

```bash
pip install submizeVim
```

Vim must be installed and available on `PATH`.

## Usage

```python
import submizeVim

submizeVim.vim_do("hello.txt", "%s/old/new/g")
```

The first argument is the file name relative to the current folder. The second
argument is a string containing one or more Vim commands. Multiple commands can
be separated by newlines:

```python
submizeVim.vim_do(
    "hello.txt",
    """
    %s/foo/bar/g
    normal! gg
    """
)
```

By default, `vim_do` writes the file after the commands finish. It returns a
`VimResult` object with `returncode`, `stdout`, `stderr`, `file`, and `cwd`.
It also prints short terminal hints by default. If Vim is missing, Vim fails, or
Vim runs longer than the default 30-second timeout, it raises a clear exception
instead of waiting forever.

```python
submizeVim.vim_do("hello.txt", "%s/old/new/g", timeout=10)
submizeVim.vim_do("hello.txt", "%s/old/new/g", verbose=False)
```

## CLI

```bash
submizevim hello.txt "%s/old/new/g"
```

## Notes

This library does not execute commands through a shell. It writes the Vim
commands to a temporary Vim script and runs Vim in Ex mode.
