Skip to content
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

Unimpaired move up and down ([e and ]e) #4691

Closed
jzelinskie opened this issue Nov 10, 2022 · 4 comments
Closed

Unimpaired move up and down ([e and ]e) #4691

jzelinskie opened this issue Nov 10, 2022 · 4 comments
Labels
C-enhancement Category: Improvements R-duplicate Duplicated issue: please refer to the linked issue

Comments

@jzelinskie
Copy link
Contributor

I'm a big fan of remapping the arrow keys to be more useful in normal and visual mode.
I typically map them to move current line left, right, up, down.

Here's a snippet of lua that demonstrates what exactly I do in neovim:

          nmap('<Up>',    '[e')
          vmap('<Up>',    '[egv')
          nmap('<Down>',  ']e')
          vmap('<Down>',  ']egv')
          nmap('<Left>',  '<<')
          nmap('<Right>', '>>')
          vmap('<Left>',  '<gv')
          vmap('<Right>', '>gv')

[e and ]e come from unimpaired, but I noticed these were missing from Helix.

@jzelinskie jzelinskie added the C-enhancement Category: Improvements label Nov 10, 2022
@kirawi
Copy link
Member

kirawi commented Nov 10, 2022

Is this a duplicate of #2245?

@jzelinskie
Copy link
Contributor Author

jzelinskie commented Nov 10, 2022

Yep! Thanks a bunch!

I was able to reproduce the mapping like this:

[keys.normal]
"up"= ["keep_primary_selection","extend_line","yank","move_line_up","open_above","normal_mode","replace_with_yanked", "move_line_down", "move_line_down", "extend_line", "delete_selection", "move_line_up", "move_line_up"]
"down" = ["keep_primary_selection","extend_line","delete_selection", "paste_after", "move_line_down"]
"left" = "unindent"
"right" = "indent"

@kirawi kirawi added the R-duplicate Duplicated issue: please refer to the linked issue label Nov 10, 2022
@robrecord
Copy link

Yep! Thanks a bunch!

I was able to reproduce the mapping like this:

[keys.normal]
"up"= ["keep_primary_selection","extend_line","yank","move_line_up","open_above","normal_mode","replace_with_yanked", "move_line_down", "move_line_down", "extend_line", "delete_selection", "move_line_up", "move_line_up"]
"down" = ["keep_primary_selection","extend_line","delete_selection", "paste_after", "move_line_down"]
"left" = "unindent"
"right" = "indent"

Thanks for this.

For me, up works perfectly but down leaves the cursor on the line below where it should be, making repeated movements tricky. I tried removing "move_line_down" but it messes up even more.

@jzelinskie
Copy link
Contributor Author

Yeah, I definitely hit corner cases with this configuration regularly. I haven't spent the time to figure out what's wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: Improvements R-duplicate Duplicated issue: please refer to the linked issue
Projects
None yet
Development

No branches or pull requests

3 participants