I'm Famiu (IPA pronunciation: fαmjʊ), I'm currently a student and like to contribute to Open Source projects in my free time.
- E-mail: [email protected]
- Element/Matrix: @moonglade:matrix.org
Plugin to easily reload your Neovim config
License: GNU General Public License v3.0
I'm Famiu (IPA pronunciation: fαmjʊ), I'm currently a student and like to contribute to Open Source projects in my free time.
Hi,
I'm getting the following when running ':Reload' or ':Restart':
E5108: Error executing lua ...e\pack\packer\start\nvim-reload\lua\nvim-reload\init.lua:107: bad argument #1 to 'gsub' (string expected, got nil)
I haven't added anything specific for nvim-reload to my init.lua or plugins.lua, which is called with require('plugins.lua') from init.lua (which lives under stdpath('config')). I'm just installing it and running it via packer, This is with nvim 0.5.0 on windows. nvim-reload and plenary are pulled as start plugins by packer:
-- Lua Reloading Related
use {
'famiu/nvim-reload',
opt = false,
requires = {
{'nvim-lua/plenary.nvim', opt = false}
}
}
Any idea what the issue might be?
I'm currently trying to build some auto reload functionality for the main packer file, however I noticed that feline drops highlights after the reload. Being able to add hooks in config to do this would be super neat.
I could see sth like the following (however I really have no experience with lua whatsoever, I'm just replicating what I've seen over the past days)
use {
'famiu/nvim-reload',
config = function()
local post_reload = function()
require('feline').reset_highlights()
vim.api.nvim_command('syntax on') -- no clue why but syntax seems slightly broken when reloading, probably another plugin
end
require('nvim-reload').setup {
post = post_reload
}
end
}
Hey there,
nice plugin, exactly what i need, though im having a little trouble.
Im using dein and it has a little bit of a weird policy for folders. As far as i understood it it has all the repos in ~/.cache/dein/repos/github.com/
and it caches them all together in a cache dir (~/.cache/dein/.cache/init.vim/.dein/
), so the rtp of vim isnt as cluttered. Anyway, i did this to setup your plugin:
`" nvim-reload
lua <<EOF
local reload = require('nvim-reload')
local plugin_dirs = os.getenv("HOME") .. '/.cache/dein/.cache/init.vim/.dein/*'
reload.vim_reload_dirs = {
vim.fn.stdpath('config'),
plugin_dirs
}
reload.lua_reload_dirs = {
vim.fn.stdpath('config'),
-- Note: the line below may cause issues reloading your config
plugin_dirs
}
EOF`
i dont know lua but it seems to work? but not quite.
when i do either :Reload or :Restart i get
Client 1 quit with exit code 1 and signal 0 Client 3 quit with exit code 1 and signal 0 Client 5 quit with exit code 1 and signal 0
(called it three times and the client count is increasing by 2 each time)
and also before the restart :LspInfo gives this
`Configured servers: clangd
Neovim logs at: /home/momo/.cache/nvim/lsp.log
1 client(s) attached to this buffer: clangd
Client: clangd (id 1)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index
1 active client(s):
Client: clangd (id 1)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index
Clients that match the filetype cpp:
Config: clangd
cmd: clangd --background-index
cmd is executable: True
identified root: ..
custom handlers:
`
and afterwards it gives this
`Configured servers: clangd
Neovim logs at: /home/momo/.cache/nvim/lsp.log
0 client(s) attached to this buffer:
1 active client(s):
Client: clangd (id 3)
root: ..
filetypes: c, cpp, objc, objcpp
cmd: clangd --background-index
Clients that match the filetype cpp:
Config: clangd
cmd: clangd --background-index
cmd is executable: True
identified root: ..
custom handlers:
`
there is some code to restart the lsp in your plugin but it isnt doing it properly for me at least. Any thoughts?
to make it easy to read up on it with the need to go to your github repo.
When executing Reload
the Command alias for the reload function disappears
but reload still works over module require
Hi. Good plugin, but i don't understand why when i run :Reload
lualine deletes all of its content until restart. Using packer.nvim
nvim-reload's config:
local reload = require('nvim-reload')
reload.lua_reload_dirs = {
vim.fn.stdpath('config')
}
Setup with Packer:
use { '~/git/nvim-reload', branch = 'experimental' }
Steps to reproduce error:
:Reload
or :Restart
Full error message:
CSV Syntax:Invalid column pattern, using default pattern %([^,]*,|$)
E5108: Error executing lua ...e/pack/packer/start/nvim-reload/lua/nvim-reload/in
it.lua:154: Vim(lua):E5108: Error executing lua /usr/share/nvim/runtime/lua/vim/
treesitter/query.lua:291: Overriding nth?
Probably the same error you getting with the branch... I haven't found the reason why this error is showing up, yet, gotta dive deeper in the code next week. With this error I am only able to use the experimental branch while working on the error, and that's why I will roll back to master for everyday use.
When I have vim-polyglot
installed via packer:
use 'sheerun/vim-polyglot'
And I attempt to run either Restart
or Reload
, I get the following error:
Error detected while processing BufWritePost Autocommands for "init.lua":
E5108: Error executing lua ...e/pack/packer/start/nvim-reload/lua/nvim-reload/init.lua:130: Vim:E492: Not an editor command: HaxeHiLink haxeError2 haxeError
When I remove vim-polyglot
from my configuration everything works fine. Is there a way to work around this? Maybe excluding vim-polyglot
from reloading?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.