Giter Site home page Giter Site logo

Comments (9)

fdncred avatar fdncred commented on August 23, 2024 20

Current voting

Vote for the topic(s) you care about by selecting the corresponding emoji. (No judgement based on the emojis sentiment!)

  • 👍 All major functionality should be exposed via keybindings
  • 👎 Ability to have multiple keybindings (see above)
  • 😄 Ability to load keybindings from file
  • 🎉 Ability to execute previously defined code or externals via keybindings
  • 😕 Ability to have keybinding chords (see above)

from reedline.

Abdillah avatar Abdillah commented on August 23, 2024 2

It is very useful to expose Vi hard-coded keybinding to support other keyboard layout.

I like how Helix editor handles the config in nested way to represent mode. Maybe kind of abstracting major modes ("emacs", "vi insert", and "vi normal") into a single state combined with nested keybindings to support Vi actions. This way, we can put ChangeMode in ReedlineEvents and vi command into a nested one.

keybindings: {
  { name: goto_minor, modifier: null, keycode: char_t, modes: [ vi_normal ], event: { send: ChangeMode, mode: v_insert } }
  { name: goto_minor, modifier: null, keycode: char_g, modes: [ vi_normal ], subs: [
    { modifier: control, keycode: char_h, event: { edit: movetostart } }
    { modifier: null, keycode: char_h, event: { edit: movewordleft, count: numarg } }
  ] }
}

from reedline.

nothingnesses avatar nothingnesses commented on August 23, 2024 1

One suggestion is to include a Kakoune-like mode. I find the interactivity in Kakoune to make more sense and be more conducive to faster navigation and editing flow than how it works in vi.

from reedline.

nicoburns avatar nicoburns commented on August 23, 2024

I would like to suggest a Sublime Text (/VS Code/micro) mode with GUI-like keyboard shortcuts, and ideally mouse support.

from reedline.

elferherrera avatar elferherrera commented on August 23, 2024

what syntax should this keybinding file should have?

from reedline.

fdncred avatar fdncred commented on August 23, 2024

In nushell it's a yaml file but I'd guess that json, yml, toml, some structured file may work. I'm also guessing that if reedline is already using one of these crates somewhere that we'd want to use whichever one that is in order to keep dependencies down. thoughts?

from reedline.

elferherrera avatar elferherrera commented on August 23, 2024

I think it wouldn't be too hard to create this dictionary. If we use EditCommands and ReedlineEvents you can describe any command

from reedline.

fdncred avatar fdncred commented on August 23, 2024

we might want to take a look at rustyline's issues regarding keybinding to make sure we can support the functionality. one thing that comes to mind is attaching arbitrary internal or external commands to keybindings. like maybe ctrl-shift-h runs htop or something like that.

as I recall, we created a few issues on rustyline's repo about keybindings. of course, this type of functionality can come later but we want to be sure our deserialization handles such things up front. i.e. start with the end in mind.

from reedline.

luccahuguet avatar luccahuguet commented on August 23, 2024

I think a helix-mode would go a long way into making the reedline experience more complete, now targeting the three major modal editors.

Helix's philosophy is a bit like this (a small excerpt from their vision page on github):

Selection -> Action, not Verb -> Object. Interaction models aren't linguistics, and "selection first" lets you see what you're doing (among other benefits).
We aren't playing code golf. It's more important for the keymap to be consistent and easy to memorize than it is to save a key stroke or two when editing.

helix also has multi-cursors but we could add it later.

Also important to note that helix is heavily inspired by kakoune, so this would be satisfying for that group of users too.

from reedline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.