andmarti1424 / sc-im

sc-im - Spreadsheet Calculator Improvised -- An ncurses spreadsheet program for terminal
Other
4.77k stars 201 forks source link

`nnoremap "C-k"` requiring multiple presses to execute #873

Closed tunalad closed 1 month ago

tunalad commented 2 months ago

Hello, So I was trying to create bindings to move rows and columns around the file by pressing Ctrl+H/J/K/L:

# move row up/down
nnoremap "<C-k>" "drkkp"
nnoremap "<C-j>" "drp"
# move column right/left
nnoremap "<C-l>" "dclpaa"
nnoremap "<C-h>" "dchpaa"

They all work, except Ctrl+K. Whenever I want to move the row up, I have to hit Ctrl+K three times for it to execute. I assume that's because of the Greek and math symbols Ctrl+K to start executing, even though it's insert mode only thing?

ps: I was initially trying to bind those to Alt key instead, but sadly it's not supported yet

andmarti1424 commented 2 months ago

@tunalad I believe C-k is special keybinding and it might be captured by your terminal. so that it cannot be binded. EDIT: terminal or shell

tunalad commented 2 months ago

@tunalad I believe C-k is special keybinding and it might be captured by your terminal. so that it cannot be binded. EDIT: terminal or shell

you're right, it cuts text from the cursor's position and to the right XD

In that case, is Alt key planned for implementation?

andmarti1424 commented 2 months ago

Regarding capturing ALT key is a limitation of ncurses I am afraid.

tunalad commented 2 months ago

Regarding capturing ALT key is a limitation of ncurses I am afraid.

Can Ctrl+arrows be used instead?

andmarti1424 commented 2 months ago

Not really sure. It might not. Feel free to try it.

tunalad commented 2 months ago

I did but they aren't working like this, so I assumed that there's a different way of defining arrows

nnoremap "<C-Down>" "drkkp"
nnoremap "<C-Up>" "drp"
andmarti1424 commented 2 months ago

Almost sure ncurses cannot handle them

tunalad commented 2 months ago

Gotta deal with it then. Thanks for helping me figure the problem out tho