markx

markx selects execution targets with editor and executes commands.


Keywords
exec, command, cli, vi, nim, util
License
MIT
Install
nimble install markx

Documentation

markx

nimble-version nimble-install gh-actions

markx selects execution targets with editor and executes commands. markx is inspired by mmv

demo_1

Table of contents

Usage

markx read targets from stdin or command line args. markx opens a tmp file with a default editor (vi, or EDITOR of environment variables) when markx started. markx filters that as targets if you wrote x to prefix of lines of buffer of your editor. markx executes command string to filtered targets. The {} of command string is replaced with filtered target when markx executes that.

$ markx -c 'command string' <args...>

$ <command> | markx -c 'command string'

Echo example is below.

$ markx -c 'echo "target is {} ."' src/*.nim
$ ls src/*.nim | markx -c 'echo "target is {} ."'

You can use rm command if you want to remove any files.

$ markx -c 'rm -f {}' src/*.nim

And you can use shell-pipe.

$ find . -type f | grep -v -e node_modules -e .git/ | grep example | markx -c 'echo {}'

You quit editor without save file if you want to stop executing commands.

Examples

See bin directory.

Installation

$ nimble install -Y markx

or

Download from Releases

LICENSE

MIT