https://github.com/louis-thevenet/open-editor
Open files or strings in default editor
https://github.com/louis-thevenet/open-editor
edit editor open-editor rust-edit
Last synced: 12 months ago
JSON representation
Open files or strings in default editor
- Host: GitHub
- URL: https://github.com/louis-thevenet/open-editor
- Owner: louis-thevenet
- License: mit
- Created: 2025-06-24T05:59:42.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-24T20:27:07.000Z (12 months ago)
- Last Synced: 2025-06-24T20:51:20.808Z (12 months ago)
- Topics: edit, editor, open-editor, rust-edit
- Language: Rust
- Homepage: https://docs.rs/open-editor/0.1.0/open_editor/
- Size: 29.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://crates.io/crates/open-editor) [](https://docs.rs/open-editor/) 
# `open-editor`
## About
`open-editor` allows you to open the system default editor to edit files or simply get the result as a String.
It supports calling the editor with specific line and column numbers.
## Quick Start
See the examples for more details.
### Writing in a file
```rust
use open_editor::editor_call_builder::EditorCallBuilder;
let filename = "./file.txt";
EditorCallBuilder::new(filename)?
.at_line(5)
.at_column(42)
.call_editor()?;
```
### Getting the result as a String
```rust
use open_editor::open_editor;
let content = open_editor()?;
assert!(!content.is_empty(), "Editor returned empty content");
```
### Editing Strings
```rust
let template = "Hello, {name}!\nWelcome to {place}.";
let filled_template = edit_in_editor(template)?;
```