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

Load tabby on demand #3

Closed
renzhamin opened this issue Nov 20, 2023 · 4 comments
Closed

Load tabby on demand #3

renzhamin opened this issue Nov 20, 2023 · 4 comments

Comments

@renzhamin
Copy link

How can I set it up so that the plugin is completely disabled by default and load it with some setup function (via keymap or autocommands)
And a way to disable it would be nice as well. Or a toggle

@wsxiaoys
Copy link
Member

Discussed in TabbyML/tabby#624

@renzhamin
Copy link
Author

Discussed in TabbyML/tabby#624

This seemed to be related to tabby server. What I'm saying is that, maybe the plugin could be packaged inside a setup_tabby function and only run the plugin code after it's called.

@renzhamin
Copy link
Author

I figured out a way to load tabby on demand when using lazy.nvim.

    {
        "TabbyML/vim-tabby",
        lazy = true,
        keys = { { "<Leader>et" } },
        config = function()
            vim.g.tabby_trigger_mode = 'manual'
            vim.g.tabby_keybinding_accept = '<Tab>'
            vim.g.tabby_keybinding_trigger_or_dismiss = '<C-\\>'
            vim.call("tabby#OnVimEnter")
        end
    },

Hitting '<Leader>et' will enable the plugin.
If you want to disable it, you can run :call tabby#OnVimLeave(). But I couldn't get it to restart after calling this.

@wsxiaoys
Copy link
Member

wsxiaoys commented Nov 20, 2023

Glad you've figured it out! Yes it's better achieved in vim / nvim package manager.

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

No branches or pull requests

2 participants