Tsuzat / NeoSolarized.nvim

NeoSolarized colorscheme for NeoVim with full transparency
Apache License 2.0
174 stars 16 forks source link

Neovim Cant load theme with packer #4

Closed kaem-e closed 1 year ago

kaem-e commented 1 year ago

Nvim Outputs error as soon as you load colorscheme NeoSolarized via packer. I haven't done anything special to packer nor am i using anything special to load NeoSolrized

Error detected while processing /Users/kaemviotto/.local/share/nvim/site/pack/packer/start/NeoSolarized.nvim/colors/NeoSolarized.lua:
E5113: Error while calling lua chunk: ...k/packer/start/NeoSolarized.nvim/colors/NeoSolarized.lua:1: attempt to index a boolean value
stack traceback:
        ...k/packer/start/NeoSolarized.nvim/colors/NeoSolarized.lua:1: in main chunk
Press ENTER or type command to continue

heres my plugins.lua file that is used to load packer.

-- This file can be loaded by calling `lua require('plugins')` from your init.vim
local fn = vim.fn -- shorthand
local ensure_packer = function()
    -- sets install_path variable with lua function fn.stdpath
    local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'

    -- checks if packer.nvim is present
    if fn.empty(fn.glob(install_path)) > 0 then
        -- and installs it if it isnt
        fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
        vim.api.nvim_command("packadd packer.nvim") -- Only required if you have packer configured as `opt`
        return true
    end
    -- else statement jank
    return false
end

-- putting this here because i dont want to mess up other files
-- basic autocommand that runs :PackerCompile on file save of this file 
vim.cmd [[
  augroup packer_user_config
    autocmd!
    autocmd BufWritePost plugins.lua source <afile> | PackerCompile | PackerSync
  augroup end
]]

-- sourcing the function that checks if packer is installed 
local packer_bootstrap = ensure_packer()

-- Notifys if packer isnt installed failsafe
local packerAval, packer = pcall(require, 'packer')
if (not packerAval) then
    vim.notify("Packer did not load properly tbh")
    return
end

-- ===================== Add Plugins here =====================
--return require('packer').startup({
packer.startup({
    function(use)
    -- Packer can manage itself
    use 'wbthomason/packer.nvim'
    use 'nvim-lua/plenary.nvim'
    -- Treesitter syntax highlighting
    use {
        'nvim-treesitter/nvim-treesitter',
        run = function()
            local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
            ts_update()
        end,
    }
    use {
        'nvim-telescope/telescope.nvim', tag = '0.1.0',
        requires = { {'nvim-lua/plenary.nvim'} }, 
        requires = { {'BurntSushi/ripgrep'} },
        requires = { {'nvim-tree/nvim-web-devicons'} }
        }
    use 'BurntSushi/ripgrep'
    use 'nvim-tree/nvim-web-devicons'

    -- colourschemes
    use { -- Nord
        'shaunsingh/nord.nvim',
        config = "require('plugconf.nord')" 
    }
    use { -- Everforest
        'sainnhe/everforest',
        config = "require('plugconf.everforest')" 
    }
    use { -- Gruvbox Material
        "sainnhe/gruvbox-material",
        config = "require('plugconf.gruvbox-material')" 
    }
    use ('Tsuzat/NeoSolarized.nvim')

    -- Yanked from packer github page lmao
    -- 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,

-- Configure packer looks
config = {
  display = {
    open_fn = function()
      return require('packer.util').float({ border = 'single' })
    end
  }
}})

The only thing close to being weird is that im using a plugconf directory for plugin configuration with lua files named after all the plugins. lua folder itself just has files for overall configuration (so files for things like keymaps, vim buffer options relativenumber, smarttab etc)

.
├── keybinds.lua
├── neosolarized.lua
├── neovide.lua
├── plugconf
│   ├── everforest.lua
│   ├── gruvbox-material.lua
│   ├── neosolarized.lua
│   └── nord.lua
├── plugins.lua
├── settings.lua
└── vscode.lua
Tsuzat commented 1 year ago

@kaem-e, I can understand the frustration. But I use NeoVim with NeoSolarized color scheme in both Arch Linux and Windows. It's working perfectly in both OS. It seems something is breaking the config in your system.