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

how to input nano keybinds into micro? #3409

Open
qbai opened this issue Jul 31, 2024 · 5 comments
Open

how to input nano keybinds into micro? #3409

qbai opened this issue Jul 31, 2024 · 5 comments

Comments

@qbai
Copy link

qbai commented Jul 31, 2024

I transfer from nano to micro, but it seems the default keybinds is based on window's mode, not linux. this is very odd.
could we input nano's keybinds into micro by some way? thanks a lot

@Andriamanitra
Copy link
Contributor

All keybindings in micro are configurable. help keybindings should contain all the information you need to configure them to match nano.

@niten94
Copy link
Contributor

niten94 commented Jul 31, 2024

There is also an example of bindings.json with nano keybindings in this comment: #277 (comment)

CtrlK is binded as CutLine by default and Open is OpenFile now, so the example would be like this when using it in new versions:

{
    "CtrlO": "Save",
    "CtrlR": "OpenFile",
    "CtrlY": "PageUp",
    "CtrlV": "PageDown",
    "CtrlU": "Paste",
    "CtrlX": "Quit",
    "CtrlW": "Find"
}

@qbai
Copy link
Author

qbai commented Aug 3, 2024

@niten94
this is little part of nano bindings, not all. what I meaning is that micro should provide compatible keybind for linux environment, not just using window's. this is not suitable for linux developer.

@qbai
Copy link
Author

qbai commented Aug 3, 2024

I suggest micro team to provide a tool that will create new keybind.json that is same as nano's, not just change jason file manually

@niten94
Copy link
Contributor

niten94 commented Sep 7, 2024

Keybindings in nanorc can be easily parsed but it does not seem like nanorc with default keybindings can be generated. The function calls in shortcut_init in src/global.c in code of nano can somewhat be parsed but the code can be changed so I think it is better if a manually written file is available instead.

I do not think programs like text editors usually include controls specific to other programs or files related with converting configuration. I tried at least writing bindings.json with default keybindings written in the cheatsheet in the website: bindings.json

The formatting of bindings.json is rewritten and comments are removed when a plugin adds keybindings but it is discussed in this issue: #2194

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

No branches or pull requests

3 participants