New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vi mode #2174
Vi mode #2174
Conversation
This is awesome!
…On Mon, Apr 24, 2023, 00:49 koltenpearson ***@***.***> wrote:
You just knew this was inevitable after letting there be an emacs mode ; )
The keybindings are not all one to one with vi, and I did not try to
replicate vi's ability to parse sequences of keys to customize the effects
of commands. Rather than being a perfect of version of vi/vim, its purpose
is to help someone with vi muscle memory from stumbling over themselves
constantly
I think I got most of the keybindings that were easy to add with the
available functionality, in the next few weeks I hope to add some
functionality so I can add more motion commands. I might also try and add
to the other non code editors and at least let hjkl work for what the arrow
keys would normally do where it makes sense.
------------------------------
You can view, comment on, or merge this pull request online at:
#2174
Commit Summary
- 74d7e45
<74d7e45>
setups settings so you can choose between different keybinding modes
- 92c3e93
<92c3e93>
basic insert and normal modes for code editor are working
- 2fc6971
<2fc6971>
history now is based off exiting insert mode instead of individual edits
- f6e6bc3
<f6e6bc3>
visual mode kinda working
- 7f2dd7c
<7f2dd7c>
renamed "modal" to "vi"
- 080016e
<080016e>
keybindings in place for everything but bookmarks and outlines
- 289e3c1
<289e3c1>
mappings for basic operations are in place
File Changes
(6 files <https://github.com/nesbox/TIC-80/pull/2174/files>)
- *M* src/studio/config.c
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-aa84e04bf61304f2d47048ad53d4641d1ea6dd10cc92420657c501599aef65b9>
(2)
- *M* src/studio/editors/code.c
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-72897a8b221a70a1a8e8696173615df821ee7230f0da174a8863c6a5702db448>
(298)
- *M* src/studio/screens/mainmenu.c
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-ee03982c71e1247e60d5ed218a6352e564268fc66dba8f5a2f5bf6b566a0fe55>
(38)
- *M* src/studio/studio.c
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-0152e81cb3628abb106946cac9eb1bf247e6ebc145cdedfcd3b63be97bcc2a44>
(22)
- *M* src/studio/studio.h
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-9d81e167012d64ff21cc42d7247e2c402970042aca5818921f512c488e370de9>
(15)
- *M* src/studio/system.h
<https://github.com/nesbox/TIC-80/pull/2174/files#diff-7df22b8cd999390986ca0cf42c11d37cd23aa8a80af159caef54e5574699bcfe>
(8)
Patch Links:
- https://github.com/nesbox/TIC-80/pull/2174.patch
- https://github.com/nesbox/TIC-80/pull/2174.diff
—
Reply to this email directly, view it on GitHub
<#2174>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAOQCAEDGYXKIYRLMU4SSTXCYA5PANCNFSM6AAAAAAXJBE4ZE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
…ollaboration pull request
just a quick note, that last commit fixes #1997, don't want it to get lost in the shuffle if the vi mode ends up not being desired |
position was not correctly avoiding being set before the beginning and the multiline comment functions would cause the history to have a separate entry for each line commented
contents of delimiters and strings and let you change them
this last commit added a replace all feature. I am not sure the best way to add it to UI, as that icon bar is looking a little crowded. Any suggestions on the best way to incorporate it? |
I just noticed that there is a draft mode for WIP pull requests, and that other PRs in the repo were using it, sorry if that was spamming anyone |
okay I think I have added all the functionality I am going to add, here are the keybindings at the moment :
If anyone has any feedback on the choices let me know. My plan now is to use this personally for a few weeks to double check for any bugs and see if there are any adjustments that seem like it would be good to apply and then declare it done and request to be merged. I will go ahead and mark it ready for review now, so I can be fixing any issue with the code found in review as I use it as well. |
You just knew this was inevitable after letting there be an emacs mode ; )
The keybindings are not all one to one with vi, and I did not try to replicate vi's ability to parse sequences of keys to customize the effects of commands. Rather than being a perfect of version of vi/vim, its purpose is to help someone with vi muscle memory from stumbling over themselves constantly
I think I got most of the keybindings that were easy to add with the available functionality, in the next few weeks I hope to add some functionality so I can add more motion commands. I might also try and add to the other non code editors and at least let hjkl work for what the arrow keys would normally do where it makes sense.