| Crates.io | open-editor |
| lib.rs | open-editor |
| version | 1.1.0 |
| created_at | 2025-06-24 20:18:47.298642+00 |
| updated_at | 2025-07-13 07:48:49.547062+00 |
| description | Open files or Strings in user's default editor |
| homepage | |
| repository | https://github.com/louis-thevenet/open-editor |
| max_upload_size | |
| id | 1724954 |
| size | 42,384 |
open-editoropen-editor allows you to open the system default editor to edit files or simply get the result as a String.
It also supports calling a specific editor or opening on specific line and column numbers.
See the examples for more details.
use open_editor::EditorCallBuilder;
let filename = PathBuf::from_str("./file.txt")?;
EditorCallBuilder::new()
.at_line(5)
.at_column(42)
.open_file(&filename)?;
use open_editor::open_editor;
let content = open_editor()?;
assert!(!content.is_empty(), "Nothing was written");
use open_editor::edit_string;
let template = "Hello, {name}!\nWelcome to {place}.";
let filled_template = edit_string(template)?;