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

fix(init): turn telescope-fzf-native into a dependecy #384

Merged
merged 2 commits into from
Aug 6, 2023
Merged

fix(init): turn telescope-fzf-native into a dependecy #384

merged 2 commits into from
Aug 6, 2023

Conversation

pbnj
Copy link
Contributor

@pbnj pbnj commented Aug 6, 2023

No description provided.

@feoh
Copy link
Collaborator

feoh commented Aug 6, 2023

hi! This is a very intriguing contribution. Thanks very much. Could you explain why this is desirable and the testing you've done to ensure that your change won't break anything for people?

@pbnj
Copy link
Contributor Author

pbnj commented Aug 6, 2023

@feoh - certainly.

Rationale

The top-level list of plugins are plugins that can be directly used by neovim users.

Examples:

  • tpope/fugitive
  • hrsh7th/nvim-cmp
  • nvim-treesitter/nvim-treesitter
  • ... and so on.

These top-level plugins can have "dependencies" or other plugins that extend/modify their behavior.

Examples (in the same order as above):

  • rhubarb extends fugitive's :GBrowse to open github repos in the browser; GitLab repos require shumphrey/fugitive-gitlab.vim, Bitbucket repos require tommcdo/vim-fubitive, ...etc. (P.S. I intend to submit a PR for this as well, let me know if it should be included in this PR or submitted separately).
  • L3MON4D3/LuaSnip, saadparwaiz1/cmp_luasnip, hrsh7th/cmp-nvim-lsp, rafamadriz/friendly-snippets, ...etc
  • nvim-treesitter/nvim-treesitter-textobjects, and others if users choose to add them here.
  • ... and so on.

Grouping plugins like this also makes for easier discovery and maintenance.

  • If users want to extend telescope even further in their personal setups, they can add to the dependencies of telescope, like dependencies = { ..., 'nvim-telescope/telescope-file-browser.nvim' }
  • If users switch to some other fuzzy finder, just dap or delete the telescope block including its dependencies, rather than hunt for every line in the list of plugins that may or may not be related to telescope.

Testing

As for testing, I have made this change in my personal nvim config, rm -rf ~/.local/{state,share}/nvim, re-launched neovim, and verified I can still search and use fzf search syntax in telescope.

@felix-kaestner
Copy link

Just to add some more context, lazy.nvim will lazy-load dependencies by default (as per Plugin-Spec).

Taking the example from @pbnj about hrsh7th/nvim-cmp, this would mean that plugins like hrsh7th/cmp-nvim-lsp/hrsh7th/cmp-nvim-lua/etc. are lazy-loaded when they are required from nvim-cmp. This also has the great effect, that you can specify a lazy-load event like "InsertEnter" on nvim-cmp only and have all the autocompletion plugins being lazy-loaded together.

I have done the same approach for things like nvim-cmp (here), telescope.nvim(here), nvim-treesitter(here) and nvim-lspconfig(here) in my personal config and it works perfectly.👌

@feoh feoh merged commit 5a59fb8 into nvim-lua:master Aug 6, 2023
@pbnj pbnj deleted the fix/telescope-fzf-native-as-dependency branch August 6, 2023 14:25
qiuye2015 pushed a commit to qiuye2015/fjp.nvim that referenced this pull request Dec 10, 2023
s-frick pushed a commit to s-frick/kickstart.nvim that referenced this pull request Jul 29, 2024
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.

3 participants