CosmicNvim/CosmicNvim

nvim-gps plugin not working

LSleutsky opened this issue ยท 4 comments

I am trying to get the SmiteshP/nvim-gps plugin working with the CosmicNvim config, but cannot get it to display in the galaxyline status bar. I followed the directions straight from the nvim-gps plugin page, but still it won't display.

Here is how I have it setup:

  -- cosmic/core/pluginsInit.lua

  ...

  use({
    'SmiteshP/nvim-gps',
    config = function()
      require('cosmic.plugins.nvim-gps')
    end,
    after = 'nvim-treesitter'
  })

And also have tried

-- cosmic/core/pluginsInit.lua

...

use({
  'SmiteshP/nvim-gps',
  requires = { 'nvim-treesitter/nvim-treesitter' },
  config = function()
    require('cosmic.plugins.nvim-gps')
  end
})

Then in the galaxyline init file:

-- plugins/galaxyline/init.lua

local gps = require('nvim-gps')

...

-- inside gls.left
{
  DiffRemove = {
    provider = 'DiffRemove',
    condition = check_git_and_buffer,
    icon = ' ' .. icons.diff_remove,
    highlight = { colors.diffDeleted, 'StatusLine' },
  },
},
{
  nvimGPS = {
    provider = function()
      return gps.get_location()
    end,
    condition = function()
      return gps.is_available()
    end,
    highlight = { colors.green, 'StatusLine' }
  },
},

Just like the plugin docs have it. Does anyone know what I'm doing wrong...? Thanks!

@LSleutsky Will you make a pull request? That'll make testing much easier and I can help you get this running properly.

Can you talk more about the plugin itself? I'll have to do some digging into it. But to be honest, I'm a bit hesitant to include another plugin as a default. (But a working PR is a very good way to try to convince me ๐Ÿ˜‰)

You want me to raise a PR even tho the functionality is not working? I can do that yea, if you wanted to see the code. The issue is just that the plugin is not working when trying to add it to the galaxyline init.lua file, that's all.

I followed the instructions from the plugin GitHub page, but still cannot get the information to render in the galaxyline, that's all. The plugin displays the function/method that the cursor is currently inside of, based on the cursor position. I wasn't suggesting adding a plugin to the core config or anything. If you want me to open up a PR with what I have, I'll do that as soon as I can...

You want me to raise a PR even tho the functionality is not working? I can do that yea, if you wanted to see the code. The issue is just that the plugin is not working when trying to add it to the galaxyline init.lua file, that's all.

I followed the instructions from the plugin GitHub page, but still cannot get the information to render in the galaxyline, that's all. The plugin displays the function/method that the cursor is currently inside of, based on the cursor position. I wasn't suggesting adding a plugin to the core config or anything. If you want me to open up a PR with what I have, I'll do that as soon as I can...

Much appreciated ๐Ÿ˜ƒ A PR will help me look at the issue you're facing without me having to copy and paste code places.

Have you looked at config/examples? It will show you how to add a plugin without modifying the core code such as pluginsInit.lua.

I think you're one of the first to request a feature for the status bar. (Most if anything, roll their own). So I might have to do some tweaking to allow this in the user config. I'll keep ya posted!

Much appreciated ๐Ÿ˜ƒ A PR will help me look at the issue you're facing without me having to copy and paste code places.

Have you looked at config/examples? It will show you how to add a plugin without modifying the core code such as pluginsInit.lua.

I think you're one of the first to request a feature for the status bar. (Most if anything, roll their own). So I might have to do some tweaking to allow this in the user config. I'll keep ya posted!

Right so that's the thing, I'm not requesting the feature to be added, and had full intentions of baking it in myself, but I had run into the issue of it not working based on the plugin's implementation instructions. I'm absolutely not expecting you to add this feature into your core config, I was more just looking if there was a specific thing I'm doing wrong for my own custom config.