Skip to content

Improve 'mini.jump2d' default config and jumping experience #1818

@echasnovski

Description

@echasnovski

Contributing guidelines

Module(s)

mini.jump2d

Description

  • Update default config.view to have dim = true and n_steps_ahead = 2 (or 1). These were not default because they were not present in the initial release and their values preserved the current at the time behavior.
  • Consider having default config.labels as 'asdfghjkl;', i.e. 10 "home row" keys. After test driving them it indeed feels more natural and faster to type, but average label length of targets does go up (less labels -> longer sequences).
  • Consider handling <BS> during sequence enter to undo previously typed label.
  • Add something like a "smart jump":
    • May or may not have a separate config.mappings.smart_jumping entry. I currently very much like sj: it is in "home row" and works well with 'mini.surround'. It feels better than <CR> (because hands stay on the home row which makes further typing faster) and is almost feels the same as a single s key (which doesn't work with 'mini.surround' and is a bit wasteful).
    • Requires pressing a single character after initiating. That character represents a "jumper identifier" in a concept similar to "textobject/surrounding identifier" from 'mini.ai' and 'mini.surround'. A single jumper is essentially a start() table input or function returning it. This allows customizing everything for any jumper separately: view, labels, allowed_lines, etc.
    • A default jumper reused config values and sets spotter to jump to a cell containing identifier, like builtin_opts.single_character. Should also respect 'ignorecase' and 'smartcase'.
    • Something like <BS> can be used as "return to previous position", which is a more flexible (yet verbose) way of doing "remote operations": jump (like sj-<char>-<seq>) - do operation - sj<BS>. May require exported MiniJump2d.jump_back().
    • Maybe . identifier can be used as "jump to any punctuation group".
    • Maybe <Space> identifier can be used as "jump to any whitespace or line start".
    • Add config.custom_jumpers to customize jumpers for this "smart jumping".

References: #1033, #1755

cc @pkazmier and @abeldekat about possible ideas/feedback here.

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