Crates.io | editor-command |
lib.rs | editor-command |
version | 1.0.0 |
created_at | 2024-08-16 23:59:51.030419+00 |
updated_at | 2024-12-27 20:47:02.574838+00 |
description | Open files in a user's configured editor |
homepage | |
repository | https://github.com/LucasPickering/editor-command |
max_upload_size | |
id | 1341130 |
size | 21,876 |
Load a user's preferred file editing command from the VISUAL
or EDITOR
environment variables.
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();