Skip to content

feat: add keymaps for floating window#174

Open
tronikelis wants to merge 6 commits into
cbochs:mainfrom
tronikelis:fix/172/keymaps_for_window
Open

feat: add keymaps for floating window#174
tronikelis wants to merge 6 commits into
cbochs:mainfrom
tronikelis:fix/172/keymaps_for_window

Conversation

@tronikelis

@tronikelis tronikelis commented Aug 31, 2024

Copy link
Copy Markdown

closes #172

I am up for discussion on how to call these settings and where to put them

fyi I tested the changes locally

Another approach would be to architecture settings like this:

win_mappings = {
	tags = {},
	scopes = {},
	loaded_scopes = {},
}

Not really sure which one's betteer

@edwardbaeg edwardbaeg left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited about this new feature!

Comment thread lua/grapple/settings.lua Outdated
@tronikelis

Copy link
Copy Markdown
Author

@cbochs friendly bump :))

@cbochs

cbochs commented Sep 29, 2024

Copy link
Copy Markdown
Owner

@tronikelis apologies for the late reply. I was away on vacation for the past several weeks. Will take a look here soon 🙂

@cbochs cbochs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start to making mappings more customizable! Left a couple comments.

One note: I think (at least for now) I would prefer that the go_up_scope be fixed. It doesn't have a good common action between the different windows. For example, Tags -> Scopes, Scopes -> Loaded (containers), Loaded (containers) -> Scopes.

It almost feels like there should be separate maps for each:

tag_mappings = { go_to_scopes = "-" }
scope_mappings = { go_to_loaded = "-" }
loaded_mappings = { go_to_scopes = "-" }

But needs a bit more thought, I think. In addition, I don't really like the name loaded. It obscures what is this window is really for: Grapple containers. Something I would like to resolve in the near future would be to rename this from "loaded" to "containers".

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread README.md

--Override default floating window mappings
win_mappings = {
toggle_hidden = "g.",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some action name change suggestions:

  • unload_scope -> unload and put in the loaded_mappings table
  • reset_scope -> reset and put in the loaded_mappings table
  • change_scope -> change and put in the scope_mappings table
  • select_horizontal -> select_split and put in the tag_mappings table
  • select_vertical -> select_vsplit and put in the tag_mappings table

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the insights, I'll change it

@tronikelis tronikelis Sep 29, 2024

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you list all the renames here? Or is something left

@tronikelis

Copy link
Copy Markdown
Author

@cbochs I've changed the names based on your comments, please check if I got everything right

@tronikelis
tronikelis requested a review from cbochs September 29, 2024 14:12
@tronikelis

Copy link
Copy Markdown
Author

@cbochs could we get this merged?

@tronikelis

Copy link
Copy Markdown
Author

@cbochs 🥲

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.

feature: option for the floating window's keymaps

3 participants