Skip to main content

submizeVim

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

Install

pip install submizeVim

Vim must be installed and available on PATH.

Usage

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:

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.

CLI

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

submizevim-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

submizevim-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file submizevim-0.1.0.tar.gz.

File metadata

  • Download URL: submizevim-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for submizevim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1eeaa8e72f9d63af699cef88d3f442ccd81e8c2dc470b5f1712e5d5ec0700830
MD5 5cace6178e03f6e673694ee8b269f9ff
BLAKE2b-256 8dd09c81c8d1f4d131f10a36e6116b07b8c55d18f692c243ee5b0560b8056dea

See more details on using hashes here.

File details

Details for the file submizevim-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: submizevim-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.2

File hashes

Hashes for submizevim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc76ddf08694ea0a69e19e58866e00411ce6a1cff96b6d00ad67a5aa4cd6b1e8
MD5 673cb7a80d3553cc2ebdfe5d0e499b27
BLAKE2b-256 040ab762a154bf4c0b48e3709ea2bf1d7c26b8018a1cf2817b5682519b7e2c1a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page