Vim Tips Wiki
Advertisement

Proposed tip Please edit this page to improve it, or add your comments below (do not use the discussion page).

Please use new tips to discuss whether this page should be a permanent tip, or whether it should be merged to an existing tip.
created February 23, 2010 · complexity basic · version 7.0

I use a tab page for each file and often want to view a file in a new tab without editing it. So I now have a line in my .vimrc:

ab tabv tabnew\|set nomodifiable\|view

and then :tabv [file] just opens my file in a new tab read-only and nomodifiable.

Comments

How about this minor improvement, so that it only triggers in command-line mode, does not set the global nomodifiable option, and additionally uses fewer commands:

cabbrev tabv tab sview +setlocal\\ nomodifiable

I think this would be a good thing to merge into Quick tips for using tab pages. --Fritzophrenic 18:27, February 23, 2010 (UTC)

Advertisement