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

Don't override vim keybinds #12

Closed
musjj opened this issue Sep 20, 2023 · 7 comments
Closed

Don't override vim keybinds #12

musjj opened this issue Sep 20, 2023 · 7 comments
Labels

Comments

@musjj
Copy link

musjj commented Sep 20, 2023

Is there a config option so that the plugin doesn't override the default vim yank keybinds? A more granular way to customize the keybinds would also be nice.

@mikesmithgh
Copy link
Owner

Hey @musjj,

I have plans to add more detailed documentation and guides for configuring keymaps/options.

There are a couple things you can do at the moment.

Example disable all keymaps: https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/lua/kitty-scrollback/configs/keymaps_disabled.lua
Example override keymaps: https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/lua/kitty-scrollback/configs/keymaps_custom.lua

  • <NOP> could also be used to disable certain keymaps (e.g., lua vim.keymap.set({ 'n' }, '<Plug>(KsbYankLine)', '<NOP>', {}))

If you run the command :KittyScrollbackGenerateKittens! it will display a list of kittens pointing to all of the example configs.

Those should allow you to reconfigure the default keymaps (https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/lua/kitty-scrollback/keymaps.lua#L20).

Right now, yanks to the unnamed register are handled by an autocommand and not by a keymap. So that can't be configured, https://github.com/mikesmithgh/kitty-scrollback.nvim/blob/main/lua/kitty-scrollback/autocommands.lua#L165

  • I could add an option to specify a register or nil to allow that to be configured or disabled. Is this something that you are interested in?

Appreciate the feedback 👍

@musjj
Copy link
Author

musjj commented Sep 20, 2023

Thanks, that's interesting, I didn't realize that the plugin uses a separate config file. Are there any plans to go with the conventional require("kitty-scrollback").setup(...) configuration method? That'd make configuration a lot easier.

I could add an option to specify a register or nil to allow that to be configured or disabled. Is this something that you are interested in?

Yes, it would be nice if there's an option to configure this too!

@mikesmithgh
Copy link
Owner

Thanks, that's interesting, I didn't realize that the plugin uses a separate config file. Are there any plans to go with the conventional require("kitty-scrollback").setup(...) configuration method? That'd make configuration a lot easier.

I originally used separate config files because the kitten (written in python) starts Nvim and passes kitty specific info as arguments. I did some experimenting and think I could get the conventional setup method to work and agree it would be cleaner.

require('kitty-scrollback').setup({
  default = function(kitty_data)
    return { ... default config here ... }
  end,
  another = function(kitty_data)
    return { ... another config here ... }
  end,
  ...
})

Then the kitten would be called like
kitty.conf

map ctrl+shift+h kitty_scrollback_nvim --config default
map f1 kitty_scrollback_nvim --config another

That way you could centralize all your configs in the setup and then specify the particular config by key. @musjj Does that sound like a good approach to you or do you have any other ideas?

Yes, it would be nice if there's an option to configure this too!

Nice, I'll add an issue for that

@musjj
Copy link
Author

musjj commented Sep 21, 2023

Yes, that sounds pretty good! Maybe also have a special default config key, that when specified, will get invoked when no --config is provided? But I'm just bikeshedding here, either way would be fine.

mikesmithgh added a commit that referenced this issue Nov 1, 2023
BREAKING CHANGE: The `--config-file` option has been removed.
Custom configurations are now supplied in the setup() function instead
of separate config file. The config name correspondes to the key of
the table provided to `setup()`.

closes #16
closes #12
closes #2
mikesmithgh pushed a commit that referenced this issue Nov 1, 2023
# [2.0.0](v1.1.10...v2.0.0) (2023-11-01)

* feat!: use kitty_mod for keymaps ([8e652bf](8e652bf)), closes [#30](#30)
* feat!: replace config-file with config name ([e16e96a](e16e96a)), closes [#16](#16) [#12](#12) [#2](#2)

### BREAKING CHANGES

* The default mapping keys changed from `ctrl+shift` to `kitty_mod`.

- If you are using the default value for `kitty_mod` of `ctrl+shift`, then no change is needed.
- If you are using a different value for `kitty_mod`, then you should correct any potential mapping conflicts that may occur
  now that `kitty-scrollback.nvim` is using `kitty_mod`.
* The `--config-file` option has been removed.
Custom configurations are now supplied in the setup() function instead
of separate config file. The config name correspondes to the key of
the table provided to `setup()`.
@mikesmithgh
Copy link
Owner

🎉 This issue has been resolved in version 2.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@mikesmithgh
Copy link
Owner

Hey @musjj , I released adding configs to your setup function in v2.0.0 let me know how this works for you 👍

@musjj
Copy link
Author

musjj commented Nov 2, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants