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

Keep <C-t> for action select_tab #250

Open
sbeyer opened this issue Mar 18, 2023 · 6 comments
Open

Keep <C-t> for action select_tab #250

sbeyer opened this issue Mar 18, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@sbeyer
Copy link

sbeyer commented Mar 18, 2023

Is your feature request related to a problem? Please describe.
When I use telescope, I usually use <C-x>, <C-v> and <C-t> to open the selected file in a new split, vsplit, and tab respectively. These are telescope's default mappings that work with every other telescope extension (that I use). telescope-file-browser.nvim is the exception, because the mapping <C-t> is overridden to action change_cwd.

Describe the solution you'd like
I would like, that <C-t> is kept as default select_tab action.

Describe alternatives you've considered
Fortunately, telescope mappings are configurable. I fixed it via the configuration

      local actions = require "telescope.actions"
      local fb_actions = require("telescope").extensions.file_browser.actions
      require("telescope").setup {
        extensions = {
          file_browser = {
            mappings = {
              i = {
                ["<C-t>"] = actions.select_tab,
                ["<C-z>"] = fb_actions.change_cwd,
              },
              n = {
                t = actions.select_tab,
                z = fb_actions.change_cwd,
              },
            },
          },
        },
      }

However, I think this configuration should not be necessary, since default telescope mappings are overridden without necessity.

Additional context
I accidentally issued this request in the wrong repository as nvim-telescope/telescope.nvim#2419 where @jamestrew replied that we will never agree on one correct mapping. I closed the issue (mainly since I was ashamed of having opened it in the wrong repo). But after thinking about the reply, I decided to re-open the issue -- now in the correct repo -- and add a rationale: I want to point out that there are default mappings of telescope. I think, the default mappings of any telescope extension should not override any of the telescope default mappings. Otherwise the telescope-file-browser.nvim user must write a mapping configuration just to be able to access all standard functionality. It sounds more user-friendly to me if the defaults allow you to access all standard functionality, so that configuration is only necessary when you actually want to change some standard behavior, not enable standard behavior.

@sbeyer sbeyer added the enhancement New feature or request label Mar 18, 2023
@jamestrew
Copy link
Collaborator

jamestrew commented Mar 19, 2023

I want to point out that there are default mappings of telescope. I think, the default mappings of any telescope extension should not override any of the telescope default mappings.

Yeah that's a valid point. If we could go back to the inception of the change_cwd mapping being created I'd probably do something different to avoid overriding the default mappings. Definitely worth considering going forward but at this point, unfortunately it would be a breaking change. And unless I see more widespread support for changing this mapping, I don't want to disrupt the current user base by making this change.

Thanks for bringing this up though. If more people continue to chime in on this, we can circle back and consider addressing this.

@gegoune
Copy link

gegoune commented Mar 19, 2023

I agree with @sbeyer and wouldn't mind small breaking changes to restore default mapping bringing more unified experience.

@sbeyer
Copy link
Author

sbeyer commented Mar 22, 2023

I never felt that breaking changes are a big issue in the rapidly evolving neovim ecosystem, where either users live with breaking changes all the time (which are btw also highlighted when doing plugin updates in Packer and lazy.nvim) or just pin their plugin versions. ;-) Also note that the <C-t>/t binding is only about one year old (see commit d9ce5d0 from 2022-01-05)

Moreover, the breaking change is only in a key mapping. If misused, there are no crazy consequences.

Yes, I'm only here to belittle the breaking change. 😇

@IevgeniiB
Copy link

Chiming in on this, keeping the mappings consistent across telescope plugins makes a lot of sense. Thank you for the configuration that can be used as a workaround!

@rbmarliere
Copy link

+1 on this. I'm coming from a pure netrw workflow since I started using telescope a lot more and having a different map to an action I'm so used to is simply not a good experience.

@chanithecat
Copy link

in normal mode, t calls change_cwd as expected but in insert mode, telescope's <C-t> is being called instead of change_cwd is that normal?

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

No branches or pull requests

6 participants