freddiehaddad / feline.nvim

A minimal, stylish and customizable statusline, statuscolumn, and winbar for Neovim
GNU General Public License v3.0
289 stars 8 forks source link

bug: it doesn't work #32

Closed idelice closed 1 year ago

idelice commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

latest

Operating system/version

latest

Describe the bug

I added the lua import using LazyVim and the setup() inside init.lua and it doesn't work.

Steps To Reproduce

  1. add this plugin inside plugins/
  2. call setup() in init.lua

Note: I'm using lazyvim.

Expected Behavior

Well.... I expect it to work with the default configs?

Repro

require("lazy").setup({
  {
    "freddiehaddad/feline.nvim",
    config = function()
      -- your configuration
    end,
  }
})
freddiehaddad commented 1 year ago

I will make the README clearer, but if you just want the default options, the following will work for lazy.nvim.

{
    "freddiehaddad/feline.nvim",
    opts = {},
}

What you shared above is just the boilerplate. That's not going to work without explicitly calling require("feline").setup().

idelice commented 1 year ago

This is my plugins/feline.lua

return {
  "freddiehaddad/feline.nvim",
  opts = {},
}

And inside lazy.lua I have this line of code: require("feline").setup()

Still doesn't show any statusline.

freddiehaddad commented 1 year ago

I'm making some assumptions here, but you're return { ... } looks like part of a plugin spec which means it's missing another pair of curly braces return { { ... } }. That's only true if my assumption is correct. Next, if you switched to the example I posted, there's no need for the explicit setup call. If after those fixes, it's still not showing the statusbar, check if you have it disabled in neovim :help laststatus for starters. The issue is not the plugin.

idelice commented 1 year ago

The return statement is correct. All 9 of my plugins are installed the same way using LazyVim and they work perfectly fine.

I tried removing the setup call but that did not make a change.

freddiehaddad commented 1 year ago

I just made a test init.lua with nothing but feline using the example I shared and its working:

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

vim.opt.termguicolors = true

require("lazy").setup({
  {
    "freddiehaddad/feline.nvim",
    opts = {},
  },
})

Statusbar shows up. What version of neovim are you using?

idelice commented 1 year ago

0.9.1

freddiehaddad commented 1 year ago

Not sure what to say then, its working fine. Can you post your config?

idelice commented 1 year ago

lazy.lua

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
  -- bootstrap lazy.nvim
  -- stylua: ignore
  vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
end
vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup({
  spec = {
    -- add LazyVim and import its plugins
    { "LazyVim/LazyVim", import = "lazyvim.plugins" },
    -- import any extras modules here
    -- { import = "lazyvim.plugins.extras.lang.typescript" },
    -- { import = "lazyvim.plugins.extras.lang.json" },
    -- { import = "lazyvim.plugins.extras.ui.mini-animate" },
    { import = "lazyvim.plugins.extras.lang.java" },
    { import = "lazyvim.plugins.extras.lang.tailwind" },
    { import = "lazyvim.plugins.extras.lang.json" },
    { import = "lazyvim.plugins.extras.lang.yaml" },
    -- { import = "lazyvim.plugins.extras.editor.leap" },
    -- import/override with your plugins
    { import = "plugins" },
  },
  defaults = {
    -- By default, only LazyVim plugins will be lazy-loaded. Your custom plugins will load during startup.
    -- If you know what you're doing, you can set this to `true` to have all your custom plugins lazy-loaded by default.
    lazy = false,
    -- It's recommended to leave version=false for now, since a lot the plugin that support versioning,
    -- have outdated releases, which may break your Neovim install.
    version = false, -- always use the latest git commit
    -- version = "*", -- try installing the latest stable version for plugins that support semver
  },
  install = { colorscheme = { "tokyonight", "habamax" } },
  checker = { enabled = true }, -- automatically check for plugin updates
  performance = {
    rtp = {
      -- disable some rtp plugins
      disabled_plugins = {
        "gzip",
        -- "matchit",
        -- "matchparen",
        -- "netrwPlugin",
        "tarPlugin",
        "tohtml",
        "tutor",
        "zipPlugin",
      },
    },
  },
})

local telescope = require("telescope")
local lga_actions = require("telescope-live-grep-args.actions")

telescope.setup({
  extensions = {
    live_grep_args = {
      auto_quoting = true,
      mappings = {
        i = {
          ["<C-k>"] = lga_actions.quote_prompt(),
          ["<C-i>"] = lga_actions.quote_prompt({ postfix = " --iglob " }),
        },
      },
    },
    undo = {
      -- telescope-undo.nvim config, see below
    },
  },
})

-- optional: vim.keymap.set("n", "<leader>u", "<cmd>Telescope undo<cr>")
-- TODO: fix this
require("telescope").load_extension("changed_files")
require("telescope").load_extension("undo")
require("telescope").load_extension("live_grep_args")
require("telescope").load_extension("harpoon")
require("telescope").load_extension("env")
require("telescope").load_extension("media_files")
-- require("telescope").load_extension("ports")
require("neoscroll").setup()

-- Rainbow delimiters setup
-- This module contains a number of default definitions
local rainbow_delimiters = require("rainbow-delimiters")

vim.g.rainbow_delimiters = {
  strategy = {
    [""] = rainbow_delimiters.strategy["global"],
    vim = rainbow_delimiters.strategy["local"],
  },
  query = {
    [""] = "rainbow-delimiters",
    lua = "rainbow-blocks",
  },
  highlight = {
    "RainbowDelimiterRed",
    "RainbowDelimiterYellow",
    "RainbowDelimiterBlue",
    "RainbowDelimiterOrange",
    "RainbowDelimiterGreen",
    "RainbowDelimiterViolet",
    "RainbowDelimiterCyan",
  },
}

local configs = require("lspconfig.configs")
local lspconfig = require("lspconfig")
local util = require("lspconfig.util")

if not configs.helm_ls then
  configs.helm_ls = {
    default_config = {
      cmd = { "helm_ls", "serve" },
      filetypes = { "helm" },
      root_dir = function(fname)
        return util.root_pattern("Chart.yaml")(fname)
      end,
    },
  }
end

lspconfig.helm_ls.setup({
  filetypes = { "helm" },
  cmd = { "helm_ls", "serve" },
})

plugins/feline.lua

return {
  "freddiehaddad/feline.nvim",
  opts = {},
}
freddiehaddad commented 1 year ago

Are you using lazyvim?

idelice commented 1 year ago

Yes, I mentioned that

freddiehaddad commented 1 year ago

Lazyvim comes with lualine. You'll need to disable that if you're planning to use feline.

You'll need to add:

{
  "nvim-lualine/lualine.nvim",
  enabled = false,
},

Also, you'll probably need to set vim.opt.laststatus

freddiehaddad commented 1 year ago

For reference:

https://github.com/freddiehaddad/lazyvim/blob/main/lua/plugins/disabled.lua https://github.com/freddiehaddad/lazyvim/blob/main/lua/plugins/feline.lua

idelice commented 1 year ago

I've already disabled it as it was causes performance issues in java files.

I even copied your feline.lua file and pasted into my own with no change.

freddiehaddad commented 1 year ago

I'm really not sure then. I'm using LazyVim as well with Neovim 0.9.2 and am not having any issues. The only thing different between us is in my feline.lua file, I have:

return {
    {
        -- my plugin config
    }
}

You only have a single set of curly braces.

You have:

return {
  "freddiehaddad/feline.nvim",
  opts = {},
}

A second set IS needed.

idelice commented 1 year ago

I told you that I've already tried that by copied YOUR feline.lua file and pasting it into my own so it's exactly the same but it still doesn't work. I don't know what more to say or do lol

freddiehaddad commented 1 year ago

In your feline.lua file, change it to this:

return {
  {
    "freddiehaddad/feline.nvim",
    config = function() vim.notify("feline.nvim config invoked") end,
  }
}

Restart Neovim. Lemme know if you see that message popup.

Also, make sure the plugin is installed. :Lazy and see if its even installing it.