I'm using arch linux and nvim. Everything is up to date.

I have a dir path /home/user/name@web_address.com/144_p/data-dir-2/data_structure_here

gf does not open the dir structure becasue @ is present.

So instead in .vimrc I tried this
:nnoremap gO :!xdg-open <cfile><CR>
it works with files without @ in the path, opening them with the default associated application, but the same hurdle exists, it does not open files with @ in the path.
It only captures the bit of the path after @ if the cursor is placed after the @,
and only captures the bit of the path before the @ if the cursor is placed before the @.

I also tried
let cfile=expand('<cfile>') | normal! gf cfile
but that also does not work and captures only path parts as described in the remap above.

I have also tried using this command (see :tab help isfname) to include the @ in the included character set as follows
set isfname+="@" and this one
set isfname+="@-@"
to set things up before using the above commands, to make sure @ is included as an available expression.

  • @maxim-kim thanks. I've updated the question to reflect my being a linux user. I also just tried set isfname+=64, didn't work for me either.
    – Kes
    Aug 6 at 13:14

set isfname+=@-@ should do the trick.

What you have tried set isfname+="@-@" also adds " which is not what you want. Help topic has it in quotes to separate from the rest of the text:

To include '@' itself use "@-@".

But set doesn't work this way (although with let &isfname .= ",@-@" it might work)

  • thank you. I wasn't looking at the "s and was going bananas in the process. Appreciated, thank you
    – Kes
    Aug 6 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.