micro-editor / micro-editor/micro

Local keybindings

Open
#1,656 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

It would be useful to support setting keybindings per buffer. Also it would be useful to support setting keybindings temporarily, without saving them to bindings.json.
So it seems natural to implement local keybindings, similar to local options: per buffer, without saving to bindings.json.

Any thoughts on it?

A simple use case for it: keybindings for command mode only.
A more elaborate use case: in my init.lua I implemented a simple "view mode" which makes micro behave somewhat like a less-like pager. It temporarily sets readonly=true and remaps some keys (e.g. "n" to FindNext, "q" to Quit). Currently, with global keybindings, it is quite messy. I want to enable/disable view mode per buffer, I don't want it to affect keybindings in command mode, I don't want it to write to bindings.json each time when toggling between view mode and normal mode, and so on.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing keybinding and local-options implementations, then determine how per-buffer and temporary bindings should interact with command mode and bindings.json. Done means the proposed behavior is defined and supported for the view-mode use cases without persisting temporary changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.