microsoft / microsoft/edit

Feature Request: Dump/persist editor state to disk (extension?)

Open
#90 2 comments 0 reactions 0 assignees View on GitHub
C-feature
Dominant language
Rust
Stars
14.6k
Forks
734
Avg merge
8h 40m
Merged PRs (30d)
4

Description

One feature of `nano` I use to massively accelerate my workflows is its `filepos_history` file. That file simply contains a MRU list of file paths and their last cursor position. `nano` itself obviously uses this to remember your cursor position in files between `nano` launches--which is great!--but I also use this list in shell scripts and workflows to great effect and I couldn't live without these. They are nearly mandatory for someone who doesn't live in their editor but instead live in their shell, which is a use-case very befitting of `edit` and which you should consider supporting.

`nano` also persists search queries in `search_history`, allowing to simply up- and down-arrow in the find dialog like at the shell prompt between `nano` launches. Very, very handy.

My workflows depend so much on rapidly and usefully entering and exiting my editor that I'm finding myself wanting to write my own just so I can make it dump/persist its text selection and undo history, too (which `nano` doesn't do).

My request is for the capability of dumping the editor state to disk in a trivially readable and editable format fit for integration with other tools and scripts. In trying to suggest this in the most appropriate way and looking at #17 I think that this feature should be suggested as an extension? By editor state I have in mind:

- Opened file path
- Cursor position
- Scroll offset
- Selections (relevant: #24)
- Search/replace history
- Undo history

This feature has very high synergy with #89 and together they present a highly _integrating_ view of program extension which gels really well with composition of **small tools** (as opposed to giant monolithic tools like VSCode, Visual Studio, etc).

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by reviewing the extension discussion in #17 and the related selection and integration work in #24 and #89; done would require an agreed, readable on-disk format covering the requested editor state.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.