Vim mode in the Linux SQL editor · Issue #3651 · TableProApp/TablePro · GitHub
Skip to content

Vim mode in the Linux SQL editor #3651

Closed

Description

@datlechin

Problem

The Linux SQL editor has no Vim mode. linux/ROADMAP.md, Backlog, SQL editor, lists "Vim mode." The macOS editor has one (features/vim-mode.mdx).

The editor is GtkSourceView (linux/ROADMAP.md, Implemented, SQL editor). GtkSourceView 5 ships Vim emulation as GtkSourceVimIMContext, and the sourceview5 0.11 bindings the app builds with (linux/Cargo.toml:92) include it.

Proposed solution

  • A Vim Keybindings switch in Preferences, Editor, stored in GSettings, off by default.
  • When on, the editor attaches GtkSourceVimIMContext and shows the mode and the pending command under the editor.
  • :w saves the tab's file as Ctrl+S does, and :q closes the tab, asking first when it would lose work, as closing does today.
  • App shortcuts that use Ctrl keep working in every mode: Ctrl+Return runs (linux/crates/app/src/application/accelerators.rs:203), Ctrl+Shift+Return runs the statement at the cursor, and find, format and comment keep their keys. Plain keys go to Vim in normal mode.
  • Completion, find and replace, and toggle comment work in insert mode as they do now.

Done means: with the switch on, normal, insert and visual modes work in an editor tab, :w saves, and the run shortcuts still run.

Alternatives considered

No response

Platform

Linux

Related database type

N/A / General

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions