prompt-toolkit / prompt-toolkit/python-prompt-toolkit

Emacs movement bindings

Open
#852 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
10.6k
Forks
815
PR merge metrics
No merged PRs in 30d

Description

When using pgcli with emacs bindings, I'll often have a long multi-line query

> SELECT a, max(b), c
FROM t
WHERE ...
GROUP BY a, c
...

when point is in the middle of the query, I don't know how to get to the start of the prompt other than pressing up-arrow several times. Perhaps this was different before https://github.com/prompt-toolkit/python-prompt-toolkit/issues/106, I'm not sure.

One option I can think of is to introduce the emacs paragraph and sentence bindings.

https://www.gnu.org/software/emacs/manual/html_node/emacs/Paragraphs.html
https://www.gnu.org/software/emacs/manual/html_node/emacs/Sentences.html

there are also a bunch more useful movement bindings

https://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html

I'm not sure where they'd all go given the extraction of some readline bindings discussed in https://github.com/prompt-toolkit/python-prompt-toolkit/issues/56#issuecomment-234368457.

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 file, test, or entry point is named. Start by locating the existing Emacs and extracted readline bindings, then review the linked prompt-toolkit discussions; done should mean users can move to the start of a multi-line query and use the selected useful Emacs movement bindings.

Written by the indexing model from the issue text.

Assessment

Tech stack
emacs, python
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.