synaptiko / xit.nvim

Plugin for [x]it! format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with the configuration recommended in README

dmartzol opened this issue · comments

Using the config recommended in the README and running PackerSync, I get the error:

packer.vim: Error running config for xit.nvim: vim/shared.lua:0: after second argument: expected table, got nil

Minimal config to reproduce:

local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
  packer_bootstrap = fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
end

local status_ok, packer = pcall(require, "packer")
if not status_ok then
    print("packer not found")
  return
end

return packer.startup(function(use)
    use "wbthomason/packer.nvim"
    use {'nvim-treesitter/nvim-treesitter', run = ':TSUpdate'}
    use {
        'synaptiko/xit.nvim',
        opt = true, -- for lazy-loading
        ft = 'xit', -- for lazy-loading
        run = function(plugin)
            plugin.config()
            vim.cmd[[:TSInstall! xit]]
        end,
        config = function() require('xit').setup() end,
        requires = { 'nvim-treesitter/nvim-treesitter' }
    }

    -- Automatically set up your configuration after cloning packer.nvim
    -- Put this at the end after all plugins
    if packer_bootstrap then
        require('packer').sync()
    end
end)

The setup function expects a table, which isn't passed. You can fix it by calling it like this: .setup({}).