Compile cmd as silent commands? #270
-
Hello! ...
-- plugins
use { "junegunn/fzf.vim", cmd = { "GFiles", "GFiles?" } }
...
--------------------------------------------------
-- compiled
...
vim.cmd [[command! -nargs=* -range -bang -complete=file GFiles lua require("packer.load")({'fzf.vim'}, { cmd = "GFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]
vim.cmd [[command! -nargs=* -range -bang -complete=file GFiles? lua require("packer.load")({'fzf.vim'}, { cmd = "GFiles?", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]
... and this causes error:
We could simply get around this by compiling the cmd as silent command as follows: -- compiled
...
vim.cmd [[silent! command -nargs=* -range -bang -complete=file GFiles lua require("packer.load")({'fzf.vim'}, { cmd = "GFiles", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]
vim.cmd [[silent! command -nargs=* -range -bang -complete=file GFiles? lua require("packer.load")({'fzf.vim'}, { cmd = "GFiles?", l1 = <line1>, l2 = <line2>, bang = <q-bang>, args = <q-args> }, _G.packer_plugins)]]
... BTW, dein also compile as silent commands as follows:
Any thoughts? |
Beta Was this translation helpful? Give feedback.
Answered by
wbthomason
Mar 31, 2021
Replies: 1 comment 8 replies
-
I'll admit I'm not sure why making the commands |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
eth3lbert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'll admit I'm not sure why making the commands
silent
fixes this, but I also don't know of a reason not to make that change.