Closed steven-omaha closed 2 years ago
Seems like you forgot to run the setup function. Just add the following line before lualine's setup
require("nvim-gps").setup()
So it would look like this
lua << END
local gps = require("nvim-gps")
gps.setup()
require("lualine").setup({
sections = {
lualine_c = {
{ gps.get_location, cond = gps.is_available },
}
}
})
END
Thanks for the quick reply! I have now copy-pasted your second code block into my vimrc. Unfortunately, I still don't get any output in my status bar.
Could you try this? keep your cursor somewhere inside a scope (function or class) and then run the following command
:lua print(require("nvim-gps").get_location())
let me know if this prints something
E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/treesitter/language.lua:25: no parser for 'python' language, see :help treesitter-parsers
stack traceback:
[C]: in function 'error'
/usr/share/nvim/runtime/lua/vim/treesitter/language.lua:25: in function 'require_language'
/usr/share/nvim/runtime/lua/vim/treesitter/query.lua:159: in function 'get_query'
...vim/bundle/nvim-treesitter/lua/nvim-treesitter/query.lua:91: in function 'get_query'
...e/timeshifter/.vim/bundle/nvim-gps/lua/nvim-gps/init.lua:228: in function 'get_location'
[string ":lua"]:1: in main chunk
What's interesting is that when I execute :TSUpdate
, treesitter tells me it is up to date already.
Looks like you haven't installed the treesitter parser. Try this
:TSInstall python
nvim-gps won't give you any output if there is no parser installed for that particular language.
That fixed it. Thanks!
Hi @SmiteshP , I am having the same issue, however I do not have any errors when running this
:lua print(require("nvim-gps").get_location())
It correctly shows a path where the cursor is. However, inside the lualine
there is no output at all.
I import nvim-gps
like so
local gps = require("nvim-gps")
gps.setup()
And add it to the lualine like so:
lualine.setup {
options = {
globalstatus = true,
icons_enabled = true,
theme = "auto",
component_separators = { left = "", right = "" },
section_separators = { left = "", right = "" },
disabled_filetypes = { "alpha", "dashboard" },
always_divide_middle = true,
},
sections = {
lualine_a = { "mode" },
lualine_b = {"branch"},
lualine_c = { diagnostics, { "nvim-gps", gps.get_location, cond = gps.is_available } },
lualine_x = { diff, spaces, "encoding", filetype },
lualine_y = { location },
lualine_z = { "progress" },
},
}
I have also tried without "nvim-gps" string literal in the table, like so:
lualine_c = { diagnostics, { gps.get_location, cond = gps.is_available } },
No luck
Thank you for writing and maintaining this project!
I am on neovim-0.6.1. I am aware of #55, but that doesn't seem to fix the problem for me.
Problem: I do not see an output in lualine.
The relevant part of my
vimrc
are (code copy and pasted from README.md)My complete
vimrc
is this: https://gist.github.com/steven-omaha/0ed4f29b6fd196a0a058ecb7c3ec4e6b