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

Add File sub keymap #3063

Closed
wants to merge 5 commits into from
Closed

Add File sub keymap #3063

wants to merge 5 commits into from

Conversation

QiBaobin
Copy link
Contributor

@QiBaobin QiBaobin commented Jul 14, 2022

Fixes #3052

@poliorcetics
Copy link
Contributor

Sub keycaps should not use uppercase keys IMO, it makes them at least 4 chars to type and typing Shift+<key> is not always practical depending on key (it never is in my opinion, but that's more drastic)

It's more breaking but maybe space+f is ok ? The current behaviour would be recuperated by doing space+f+f, which is easy to type quickly

book/src/keymap.md Outdated Show resolved Hide resolved
@the-mikedavis
Copy link
Member

I like this but I agree about F being tough because of the extra modifier. We tend to prefer sequences to modifiers (for example v instead of shifted motions like in Kakoune). As much as I like the very short <space>f for the main file picker, maybe it's ok to add an extra f in there, eh? I suppose doom emacs / spacemacs already have this same binding. What do others think?

@sudormrfbin
Copy link
Member

<space>f is rather short and sweet, and I'm not sure how frequently the other newly introduced pickers will be used. How much would <space>fd be used compared to <space>ff ? In projects where it makes sense to open the current-buffer-directory picker more often, the default <space>f could be binded to the buffer-directory picker. I personally have backspace in normal mode mapped to the file picker so that it's takes the most minimal number of keystrokes :P


If we do decide to go with <space>f as a submode, <space>fF (open picker at CWD) should be changed to something easier to type.

@poliorcetics
Copy link
Contributor

poliorcetics commented Jul 16, 2022

the default <space>f could be binded to the buffer-directory picker

Having to change learned behavior and remember to make a new local config depending on the project seems wobbly, I would hate that. Configuring my language server to pick up project specific details is one thing, keybindings are supposed to be more "computer wide" IMO

@archseer
Copy link
Member

We could turn space+F into a submode instead and keep space+f as a faster shortcut for the default?

@poliorcetics
Copy link
Contributor

We could turn space+F into a submode instead and keep space+f as a faster shortcut for the default?

That was the original behavior in the PR that I argued against, modes should not use uppercase, it's bothersome to type

@archseer
Copy link
Member

It's a less often used mode though. Users can always add their own keymaps to access certain pickers easier. I'm open to other suggestions but I don't want to remap space+f

@kirawi kirawi added A-helix-term Area: Helix term improvements S-waiting-on-review Status: Awaiting review from a maintainer. labels Sep 13, 2022
@mangas
Copy link
Contributor

mangas commented Sep 20, 2022

Hey guys, I just found this PR while searching for something similar in terms of remapping space keybinds. For my own use I have swapped f and F because F is trickier to use because of shift, and because most of the times they do the same thing. When I do select a directory then I don't need to change the binding. I also think most of the other keybinds use only one key so adding space+ff seems weird to me (unless we make it a sub-command and in that case it would be what? space+ff and space+fF?) I think swapping f and F is prolly a good default as it behaves the same in most cases (I would think).

Is there a reason we can't add the config to rebind space keybinds? If not then maybe that could be a starter?

| ----- | ----------- | ------- |
| `f` | Open file picker | `file_picker` |
| `F` | Open file picker at current working directory | `file_picker_in_current_directory` |
| `d` | Open file picker at current buffer's directory | `file_picker_in_buffer_directory` |
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about b for this?

@the-mikedavis
Copy link
Member

Is there a reason we can't add the config to rebind space keybinds?

This is possible:

[keys.normal]
space.F.c = ":config-open"

@the-mikedavis the-mikedavis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from a maintainer. labels Oct 15, 2022
@QiBaobin
Copy link
Contributor Author

close per #4783

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Requst: File picker based on current buffer's directory
7 participants