File: README.md

package info (click to toggle)
rust-editor-command 1.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 172 kB
  • sloc: makefile: 4
file content (16 lines) | stat: -rw-r--r-- 659 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# editor-command

[![Test CI](https://github.com/github/docs/actions/workflows/test.yml/badge.svg)](https://github.com/LucasPickering/editor-command/actions)
[![crates.io](https://img.shields.io/crates/v/editor-command.svg)](https://crates.io/crates/editor-command)
[![docs.rs](https://img.shields.io/docsrs/editor-command)](https://docs.rs/editor-command)

Load a user's preferred file editing command from the `VISUAL` or `EDITOR` environment variables.

```rust
use editor_command::EditorCommand;
use std::process::Command;

std::env::set_var("VISUAL", "vim");
let mut command: Command = EditorCommand::edit_file("file.txt").unwrap();
command.spawn();
```