so, we all know of gf, :find, etc, but is there a read-only equivalent, the :view to their :edit?

i just want an easy shortcut to open system headers without creating a swapfile

:find +set\ noma\ ro <cfile> still creates a swapfile


You can also use the :noswapfile modifier to open the file with :find without creating a swapfile:

:nos find <cfile>
  • 1
    so i did nn hf :nos fin +setl\ ro\ noma <cfile><cr> in the end, thanks! – landfill baby Jul 24 at 1:25

oops! i forgot about findfile()!

no gf :<c-u>vie <c-r>=findfile(expand('<cfile>'))<cr><cr>

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.