I regularly find myself doing the following sequence:

  :vnew
  :view some_readonly_file.txt

in order to avoid the "a swap-file already exists" or "this file is RO" messages.

While I know I can create a ":View" command to do this for me, I was wondering if there was something built-in I missed. Perhaps like the ":vert" prefix, if there was a "and put the following results in a new window" prefix that I missed or a flag for ":vsp" to specify that the file should be opened RO? I'd expect it to looks something like

  :vnew ++readonly some_readonly_file.txt
  :vert view some_readonly_file.txt

For now, I just have

  :command -nargs=1 -complete=file Vsp vnew|view <args>

which does the job. I just felt like I was missing something that Vim might provide.

-tim


--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to