prichrd / netrw.nvim Goto Github PK
View Code? Open in Web Editor NEWIt's not because we use netrw that we cannot have nice things!
License: MIT License
It's not because we use netrw that we cannot have nice things!
License: MIT License
hi, love this plugin!
sometimes i want to create several files in a row without immediately opening any of them. i don't think vanilla netrw supports this, so it seems a custom mapping might be the way to go.
i'd really appreciate some guidance on how to achieve this!
It would be good to see the git status of a file within the file explorer.
Executable files don’t have the right icon. They are prepended with a ‘*’.
Not sure if this is really considered an issue because Im guessing that sign columns are the core of how this plugin works but if its not or there is an easy workaround this is an issue to note
I just wrote, a function that Toggle Netrw works under the logic of a single instance of Netrw shared between all tabs.
I would make myself very happy if you prove this code block and if you like:
-- Toggle Netrw
local netrw_info = {
bufid = -1,
winid = -1,
before_wind_id = -1,
hidden = false,
}
local function show_netrw(wind_id)
netrw_info.before_wind_id = wind_id
if netrw_info.bufid == -1 then
vim.cmd [[silent Lexplore]]
else
vim.cmd("topleft" .. vim.g.netrw_winsize + 15 .. " vs new | buffer " .. netrw_info.bufid)
end
netrw_info.hidden = false
netrw_info.bufid = vim.api.nvim_buf_get_number(0)
netrw_info.winid = vim.api.nvim_get_current_win()
end
local function toggle_netrw()
local buf_exist = vim.api.nvim_buf_is_valid(netrw_info.bufid)
local current_wind_id = vim.api.nvim_get_current_win()
if buf_exist then
if netrw_info.hidden then
show_netrw(current_wind_id)
else
vim.fn.win_gotoid(netrw_info.winid)
vim.cmd ":hide"
netrw_info.hidden = true
if current_wind_id ~= netrw_info.before_wind_id and current_wind_id ~= netrw_info.winid then
vim.fn.win_gotoid(current_wind_id)
show_netrw(current_wind_id)
end
end
else
show_netrw(current_wind_id)
end
end
local M = {}
function M.setup()
vim.cmd[[hi! link netrwMarkFile Search]]
vim.api.nvim_create_autocmd("FileType", {
pattern = "netrw",
callback = function()
vim.opt_local.bufhidden = "hide"
end,
})
vim.g.netrw_keepdir = 0
vim.g.netrw_liststyle = 3
vim.g.netrw_list_hide = [[.*\.swp$,.DS_Store,*/tmp/*,*.so,*.swp,*.zip,*.git,^\.\.\=/\=$]]
vim.g.netrw_banner = 0
vim.g.netrw_browse_split = 3
vim.g.netrw_winsize = 15
vim.g.netrw_localcopydircmd = "cp -r"
require("netrw").setup {
use_devicons = true,
}
vim.keymap.set("n", "<leader><leader>", toggle_netrw) -- open explorer in vertical split
end
return M
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.