Skip to content

GunniBusch/edit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

edit

Tiny Unix editor launcher for $EDIT_EDITOR, $VISUAL, $EDITOR, or vi.

Build

cargo build --release --bin edit

The binary is written to target/release/edit.

To check the library crate:

cargo build --release --lib

Cargo builds the normal Rust library artifact for use by Rust crates.

To prefer dynamic Rust linking for the binary:

RUSTFLAGS="-C prefer-dynamic" cargo build --release --bin edit

That requires the matching Rust toolchain libraries to be available at runtime. A Rust dylib is not a stable C ABI; foreign-language callers need a separate cdylib API.

CLI

edit path/to/file.txt
edit file1.txt file2.txt

Library

edit::open(None, ["file.txt"]);                  // uses VISUAL, EDITOR, vi
edit::open(Some("MY_APP_EDITOR"), ["file.txt"]); // app override first
edit::spawn(None, ["file.txt"])?;                // starts the editor

License

BSD 3-Clause

About

Tiny Unix editor launcher and Rust library for VISUAL, EDITOR, vi, or custom editor env vars

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages