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

change default keybinding in default config #5925

Merged
merged 4 commits into from Jul 2, 2022

Conversation

WindSoilder
Copy link
Collaborator

@WindSoilder WindSoilder commented Jul 2, 2022

Description

Introduce new keybinding ctrl-y in default, I use it heavily with ctrl-k...

And move var menu from ctrl-y to alt-o, the alt-o comes from pycharm navigate to symbol, which is using Alt-Cmd-O in macOS

alt-o looks similar to it, so I chose alt-o

Tests

Make sure you've done the following:

  • Add tests that cover your changes, either in the command examples, the crate/tests folder, or in the /tests folder.
  • Try to think about corner cases and various ways how your changes could break. Cover them with tests.
  • If adding tests is not possible, please document in the PR body a minimal example with steps on how to reproduce so one can verify your change works.

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --workspace --features=extra -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo test --workspace --features=extra to check that all the tests pass

@stormasm
Copy link
Contributor

stormasm commented Jul 2, 2022

@WindSoilder I believe on a mac keyboard

the Alt key is =

Shift-Option

I tried it a few times and it seems pretty simple to hit on my keyboard...

curious to see what @fdncred thinks about introducing the Alt key as we don't currently use it for any

default keybinding commands,

but if people like it --- it will open the door for other Alt key commands in the future...

@fdncred
Copy link
Collaborator

fdncred commented Jul 2, 2022

I use iterm2 on my Mac and I have it setup so I can do option-o like alt-o without issue. I'm fine with it.

@WindSoilder
Copy link
Collaborator Author

Oh... I never though about alt in mac keyboard, in different terminal, alt may need extra setup(like iterm2, alacritty) to make it works property.

I'm not sure if alt introduces not frendly usage on mac.

@fdncred
Copy link
Collaborator

fdncred commented Jul 2, 2022

It's probably fine.

@stormasm
Copy link
Contributor

stormasm commented Jul 2, 2022

I just tested your binding and it does not appear to work at all...

Unfortunately it does not appear to be working on my mac and I use the standard out of the box terminal

Monterey Terminal.app Version 2.12 (443)

So we might not be able to use this binding...

@stormasm
Copy link
Contributor

stormasm commented Jul 2, 2022

just curious @fdncred can you fire up the standard terminal I am using on your mac and see if it works for you ?

It would be good to know for future reference as we come up with new default key bindings which ones work
the best across all possible platforms...

@stormasm
Copy link
Contributor

stormasm commented Jul 2, 2022

For simplicity for now I think I would stick with either the

modifier: Shift
modifier: Ctrl

which is the way we currently have the default keybindings...

We can leave the ALT keys etc... to people's custom bindings....

And then we don't have to worry about all of the keyboard issues / international keyboards etc....

I think all keyboards and platforms have shift and control by default.

Just my 2 cents 😄

@WindSoilder
Copy link
Collaborator Author

WindSoilder commented Jul 2, 2022

I've tested in mac terminal, it works fine for me, but we need to have extra setup: Use Option as Meta key, as the following screenshot, enable this should make alt on mac work as expected.

图片

For simplicity for now I think I would stick with either the
modifier: Shift
modifier: Ctrl
which is the way we currently have the default keybindings...
We can leave the ALT keys etc... to people's custom bindings....
And then we don't have to worry about all of the keyboard issues / international keyboards etc....
I think all keyboards and platforms have shift and control by default.

I'm fine with changing the modifier to Ctrl

@fdncred
Copy link
Collaborator

fdncred commented Jul 2, 2022

@stormasm, After making the change that @WindSoilder suggests alt-o works fine in terminal.app. We also cannot use ctrl-o as it's already used. Check keybindings default.

@stormasm
Copy link
Contributor

stormasm commented Jul 2, 2022

@fdncred @WindSoilder

ok we are good ! we can now start using the ALT modifier for future key bindings....

I tested

modifier : alt

based on making the config change recommended above in the terminal preferences window....

Thank you both for helping me out here with this particular issue 😄

@fdncred
Copy link
Collaborator

fdncred commented Jul 2, 2022

thanks

@fdncred fdncred merged commit b80299e into nushell:main Jul 2, 2022
@stormasm
Copy link
Contributor

stormasm commented Jul 3, 2022

@WindSoilder @fdncred just updated to latest code base and deleted config.nu so that it could get the latest version and it works great !!

glad to know now that we can use ALT on the mac

great job...
in tracking this down...

@WindSoilder WindSoilder deleted the keybinding branch September 26, 2022 02:33
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.

None yet

3 participants