micro-editor / micro-editor/micro

[Feature Request] syntax coloring of Python f-strings by default

Open
#3,605 11 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

Description of the problem or steps to reproduce

Current behavior of micro is to treat Python f-strings like plain strings (yellow in the default color scheme):

Screenshot 2025-01-11 at 20 48 14

This example is taken from https://docs.python.org/3/reference/lexical_analysis.html#f-strings where the variables like name in the first f-string of this example are in white (screenshot with Firefox showing coloring of the expressions with f-strings):

Screenshot 2025-01-11 at 20 45 53

Desired behaviour would be like the Python.org documentation, or similar - this is Sublime Text Build 4189 on macOS which seems to format the code snippets within f-strings like normal Python code:

Screenshot 2025-01-11 at 20 51 21

Specifications

$ micro --version
Version: 2.0.14
Commit hash: 04c57704
Compiled on August 27, 2024

Commit hash: 04c57704
OS: Linux
Terminal: Ghostty

(Same behavior on macOS with micro 2.0.14)

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

No implementation file or test is named. Start by locating micro's Python syntax-highlighting rules and reproduce the documented f-string examples; compare how expressions inside f-strings are currently classified. Done means Python f-strings visibly highlight their embedded expressions by default, with relevant syntax-highlighting tests updated if they exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, python
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.