-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Better integration with plugins like oil #1077
Comments
Where you able to find some sort of solution to this problem? |
Nope |
You can use the So in this case you can set fmt option on branch and filename component to a function that gets rid of the things that don't need to be show from result of these component in case of oil filetype. A bit of filetype check and pattern matching should be enough. the fmt funciton will get the result of the component as it's argument and what ever the function returns will be rendered in lualine. https://github.com/nvim-lualine/lualine.nvim#general-component-options |
Wasn't this PR supposed to add this? My issue is that it says |
@kjuq Would you be able to weigh in on why we can't get the path to show? |
@DovieW Could you send me a minimal configuration, which probably enables only lualine and oil, to reproduce the issue? In my environment, the path is shown properly. |
Thanks for responding @kjuq. I was able to get the old See example config below using lazy.nvim for anyone that finds this. 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)
require('lazy').setup({
{
'nvim-lualine/lualine.nvim',
opts = {
options = {
theme = 'auto',
},
extensions = { 'oil' }
}
},
{
'stevearc/oil.nvim',
opts = {
default_file_explorer = true,
},
},
}, {}) |
just want to note here that in the oil buffer, the branch name is empty and not shown this is the part that gets the incorrect dir
I think lualine should somehow expose certain apis like So then we could pass in the config {
get_current_dir = function()
if vim.bo.filetype == "oil" then
return require(oil).get_current_dir()
end
-- else fallback
end
} |
Sorry for the ping but I opened this PR #1298 which adds filename component support for oil.nvim |
Should't this #1242 be inside the oil extension? |
Requested feature
With oil set as default explorer, when you jump out to current dir, you will be in a remote oil buffer. This means you are outside your git repo and your filename will be of the form oil://home/user/gitFolder/repoFolder/subDir...
This is pretty gross. Unfortunately the oil team did not have any solution.
I really like the branch and filename section types. And I use the diff symbols regularly when editting oil buffers. I'd just like to have my repo section and filename section working sensibly with oil directory buffers.
The filetype is recognized as "oil", so I'm wondering if it is possible to override the branch string and filename string receivers for given filetypes? I think it would be a pretty extensible feature and useful for other things too, maybe helpful with ssh.
Motivation
Sane & expected lualine appearance with oil or other plugins that do not operate directly in the apparent cwd.
The text was updated successfully, but these errors were encountered: