Skip to content

feature request: handle restricted UNC paths on Windows #404

@matu3ba

Description

@matu3ba

Did you check existing requests?

  • I have searched the existing issues

Describe the feature

I'd like to be able to use oil.nvim with locally mounted UNC paths on Windows for fast looking into files after search via fd and gf to open a file and use map('n', '<leader>ex', [[<cmd>lua require("oil").open()<CR>]], opts) -- open dir of current buffer instead of cwd to traverse the directory.

Provide background

Upon execution of <leader>ex mapped to

I get

E5108: Error executing lua ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: BufReadCmd Autokommandos für "oil://*": Vim(append):Error executing lua callback: ...fer/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/fs.lua:89: attempt to index local 'drive' (a nil value)                                                                                                                                                                                                                                                                  stack traceback:                                                                                                                                                                                                                                                                      ...fer/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/fs.lua:89: in function 'posix_to_os_path'                                                                                                                                                                                ...Local/nvim-data/lazy/oil.nvim/lua/oil/adapters/files.lua:229: in function 'normalize_url'                                                                                                                                                                                  ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:966: in function 'load_oil_buffer'                                                                                                                                                                                ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:1088: in function <...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:1087>                                                                                                                              [C]: in function 'edit'                                                                                                                                                                                                                                                       ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: in function 'open'                                                                                                                                                                                           [string ":lua"]:1: in main chunk                                                                                                                                                                                                                                      stack traceback:                                                                                                                                                                                                                                                                      [C]: in function 'edit'                                                                                                                                                                                                                                                       ...r/AppData/Local/nvim-data/lazy/oil.nvim/lua/oil/init.lua:399: in function 'open'                                                                                                                                                                                           [string ":lua"]:1: in main chunk

and a never finishing loading dialog

      Loading
                                                         [     ====         ]

What is the significance of this feature?

nice to have

Additional details

Why?
If one does frequent remote operations on Windows (in local ir VPN network), one will not want to mount remote pcs to hard drives like R:\ to prevent clashes of different machines or accidental copying/overwriting wrong machines.

The alternative is 1. to not use oil.nvim or 2. use yazi for inspection or 3. use :e \\ip\drive\pathtofile, 4. traverse via shell to the other files.

UNC paths with restrictions are quite feasible to implement, see https://github.com/ziglang/zig/blob/332fbb4b027a5529e58b1e46d785718a7faa75e6/lib/std/fs/path.zig#L1403.

If not, then please briefly explain scope of filepath shennanigans/complexity you're willing to handle in this plugin.
Thanks for the plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Not a priority. PRs welcomeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions