neovim-cmake icon indicating copy to clipboard operation
neovim-cmake copied to clipboard

Support lazy loading with vim-plug

Open lbiaggi opened this issue 3 years ago • 5 comments

Bug description Hi, when trying to load it (using lazy load from vim-plug) with c/cpp/(c)make/qml files, it fails

Steps to reproduce Plug 'Shatur/neovim-cmake', {'for' : ['cpp', 'c', 'make', 'cmake', 'qml']}

Expected behavior Behaves nicely and only in the wanted files, now I have it everywhere :(

Screenshots

Environment

  • OS: Arch
  • Desktop environment: I3wm
  • Plugins commit hash: 86c74676f73096d5d979a524d832d74c243de15c Additional context

lbiaggi avatar Feb 13 '22 20:02 lbiaggi

What do you mean under "it fails"? It should be loaded once you open any of the specified files. You can't unload it later.

Shatur avatar Feb 13 '22 21:02 Shatur

I can't lazy load it, need to let be enable with other filetypes e.g.: rust

On Sun, Feb 13, 2022, 18:34 Hennadii Chernyshchyk @.***> wrote:

What do you mean under "it fails"? It should be loaded once you open any of the specified files. You can't unload it later.

— Reply to this email directly, view it on GitHub https://github.com/Shatur/neovim-cmake/issues/23#issuecomment-1038442067, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJGX4AK7FHYGMC4XRN5PWDU3APWXANCNFSM5OJV24WQ . You are receiving this because you authored the thread.Message ID: @.***>

lbiaggi avatar Feb 14 '22 09:02 lbiaggi

I don't understand the problem. Please, explain it more.

Shatur avatar Feb 14 '22 09:02 Shatur

I prefer not to have :CMake available to all possible file types, only the associated with C/C++, usually I do this with lazy loading (where I specify which file type would it be allowed).

lbiaggi avatar Feb 14 '22 10:02 lbiaggi

It's not possible. Commands can't be relative to the filetype. You can lazy load the plugin by filetype, but once it loaded by the specified filetype, :CMake command will be available anywhere.

Shatur avatar Feb 14 '22 12:02 Shatur