Skip to content

Vim emulation: add "o", "O" commands#785

Merged
jeremypw merged 13 commits intoelementary:masterfrom
mcclurgm:vim-add-o
Mar 24, 2021
Merged

Vim emulation: add "o", "O" commands#785
jeremypw merged 13 commits intoelementary:masterfrom
mcclurgm:vim-add-o

Conversation

@mcclurgm
Copy link
Contributor

Implements a basic form of the o and O commands in vim. It adds a new line before or after the current, navigates to that line, and enters insert mode.

As with #712 (and the other insertion commands), this doesn't properly work with numbers. It won't repeat the insert multiple times, only once.

Copy link
Collaborator

@jeremypw jeremypw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as expected but some simplification is possible.

@mcclurgm
Copy link
Contributor Author

mcclurgm commented Feb 7, 2021

Ok, I fixed your requests. There's one big issue remaining here that I just discovered, that the MovementStep.PARAGRAPH_START goes to the beginning of the line excluding whitespace. So the shift-O command needs some more work. I'll see if I can fix that.

@mcclurgm
Copy link
Contributor Author

mcclurgm commented Feb 7, 2021

Since the effect is pretty much the same as inserting a newline after the 0 motion, I'm going to wait until we figure that out and then follow that solution here.

@mcclurgm
Copy link
Contributor Author

mcclurgm commented Feb 11, 2021

One more thought I just had. This doesn't respect the current line ending setting. I guess I'll have to fix that too… (Do we have a line ending setting? It's not exposed to the user, but that doesn't mean a ton necessarily)

@jeremypw
Copy link
Collaborator

Need someone to fix the flatpak CI before this can be merged.

@mcclurgm mcclurgm requested a review from jeremypw March 24, 2021 02:02
@jeremypw
Copy link
Collaborator

I think any issues with non-standard line-endings can be dealt with, if required, later. Code is focused on code development on Linux.

@jeremypw jeremypw merged commit 6c120eb into elementary:master Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants