-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hi 👋
I'm wondering what your view is on supporting the URI decoding of filenames. I'm trying open filenames like this
/Users/thomas.payne/git/yarn-pnp-demo/.yarn/cache/%40testing-library-react-npm-11.2.7-3a0469c756-389c9f3e83.zip%3A%3Anode_modules/%40testing-library/react/types/index.d.ts
I have a little function that I can wrap these up with but it would be super handy if vim-rzip could do the URI decoding for me that way I could drop my custom URI scheme yarnpnp:
function! YarnPnPRead(uri)
let l:parsed_uri = substitute(a:uri, '%\([a-fA-F0-9][a-fA-F0-9]\)', '\=nr2char("0x" . submatch(1))', "g")
let l:zipfile_uri = substitute(l:parsed_uri, '^yarnpnp', 'zipfile', "g")
call rzip#Read(l:zipfile_uri, 1)
endfunction
augroup YarnPnP
autocmd!
autocmd BufReadCmd yarnpnp:*,yarnpnp:*/* call YarnPnPRead(expand('<amatch>'))
augroup ENDWhat do you think?
Metadata
Metadata
Assignees
Labels
No labels