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

Convert vim-plug installation to Lua #645

Open
jianyuchenxyz opened this issue Feb 17, 2024 · 1 comment
Open

Convert vim-plug installation to Lua #645

jianyuchenxyz opened this issue Feb 17, 2024 · 1 comment

Comments

@jianyuchenxyz
Copy link

jianyuchenxyz commented Feb 17, 2024

The vim-plug VimScript instructions to install MarkdownPreview are as follows:

local vim = vim
local Plug = vim.fn['plug#']

Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}

vim.call('plug#end')

I'm looking for help on how I can convert the line beginning with Plug ... into Lua. This particular line errors out, since Lua does not recognize the data between the curly braces.

The installation guide only shows .lua examples for Packer, and I have seen no other discussion after a cursory issue search.

I have tried the following, changing do and for into ['do'] and ['for'] respectively since both are keywords in Lua, but the same error still surfaces. I suspect the -> operator might need special handling.

Plug 'iamcco/markdown-preview.nvim', { ['do'] = { -> 'mkdp#util#install()' }, ['for'] = {'markdown', 'vim-plug'}}

Any help is appreciated!

@kunring
Copy link

kunring commented Feb 25, 2024

Plug("iamcco/markdown-preview.nvim", { ["do"] = vim.fn["mkdp#util#install"], ["for"] = { "markdown", "vim-plug" } })

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