ox icon indicating copy to clipboard operation
ox copied to clipboard

Advanced keyboard navigation

Open vlisivka opened this issue 4 years ago • 7 comments

Is your feature request related to a problem? Please describe. Cannot edit text using muscle memory, because some navigation keys are not working.

Describe the solution you'd like

Ctrl+Left/Right - jump word to left/right. Shift+Left/Right - extend selection by char to left/right Shift+Up/Down - extend selection by line up/down Ctrl+Shift+Left/Right - extend selection by word to left/right Ctrl+C - copy selection to buffer Ctrl-V - paste selection from buffer Ctrl+X - cut selection to buffer Ctrl-T - new tab Ctrl-H - search and replace

mcedit:

F1 - help screen Ctrl-F - put selection into file. Default file name "~/.config/ox/clipboard". Shift-F5 - paste from file. Default file name "~/.config/ox/clipboard". F3 - start selection mode for cases when Shift doesn't work. F3, or Ctrl-F, Ctrl-C, Ctrl-X, Delete to end. Shift-F3 - start rectangle selection mode. F3, or Ctrl-F, Ctrl-C, Ctrl-X, Delete to end. Ctrl-L - refresh screen Ctrl-Y - delete line under cursor F10 - show editor menu F11 - show user menu with external filters or commands, such as "sort" or "date". For filter, current selection or whole file is sent to stdin and then replaced by stdout. A command output is just pasted under cursor. Command may prompt for command line options (e.g. "sed").

Describe alternatives you've considered

https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts#Text_editing

vlisivka avatar Nov 03 '20 10:11 vlisivka

I might add an observation / request:

Pressing "Left" at the beginning of a line should navigate the cursor to the back of the previous line. Pressing "Right" at the end of a line should navigate the cursor to the front of the next line.

r-chris avatar Nov 03 '20 10:11 r-chris

I'll be working on this over the next week, adding the line wrapping option shouldn't be too difficult, Ox originally had it but I found it annoying and removed it so I'll be adding an option in the configuration file to enable it should the user want to. As for the extra keyboard shortcuts, I'll be rewriting the entire editor in Crossterm which I hope will provide much better access to those key bindings as the current library I'm using, termion, lacks many features including Ctrl+Shift key bindings.I'll try to keep you guys posted.

curlpipe avatar Nov 08 '20 00:11 curlpipe

It's come to my attention that the library I'm using doesn't support Ctrl+Shift keys and multiple modifiers, I've added an issue to the repository of the library and hopefully it'll be added at some point, but for now, it looks like I might have to skip adding this for now and add it later when the library has support for it.

curlpipe avatar Nov 22 '20 10:11 curlpipe

@curlpipe Drop link to issue, please.

vlisivka avatar Nov 22 '20 10:11 vlisivka

https://github.com/crossterm-rs/crossterm/issues/515

curlpipe avatar Nov 22 '20 10:11 curlpipe

I have just released 0.2.7 and added more available keybindings such as the arrow keys and the function keys too. For now, this issue will remain open until we can get a conclusion on the status of those Ctrl+Shift keys.

curlpipe avatar Nov 22 '20 17:11 curlpipe

Please can you add "Delete" key to delete the characters to the right of the cursor ? Thanks

duboiss avatar Nov 25 '20 18:11 duboiss