Coder Social home page Coder Social logo

netrw.nvim's People

Contributors

issafalcon avatar prichrd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

netrw.nvim's Issues

create file without opening

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!

Add git support

It would be good to see the git status of a file within the file explorer.

Icons dont show when sign columns are set to no

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 want to do a PR, but I would like to read your opinion

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.