R.L. Dane :Debian: :OpenBSD: :FreeBSD: 🍵 :MiraLovesYou: on Nostr: #TIL you can use vim/nvim as a pager directly, like some_command |vim Even better ...
#TIL you can use vim/nvim as a pager directly, like
some_command |vim
Even better than that, you can redirect a file into vim like
vim < some_file.txt
The advantages of this over view/vim -R are twofold: one, it is literally impossible to overwrite the file, unless you manually type :w exact_filename within vim. Second, you can safely edit the buffer without getting any warnings of being in read-only mode, because you're editing an ephemeral buffer, not the file.
Disclaimers: I did not actually learn this today, but within the last 12 months. Also, this doesn't work in vanilla vi/nvi.
Published at
2026-02-12 15:27:23 UTCEvent JSON
{
"id": "ceebdee60c08065fa3b882abf77512d0a9edca8906b8984c1eafe4964e4c408b",
"pubkey": "3d393b82c3042be8ead657b609d054c8d934be0e269bf74c56f72f63ea48d0df",
"created_at": 1770910043,
"kind": 1,
"tags": [
[
"proxy",
"https://polymaths.social/users/rl_dane/statuses/01KH97DKN25DHMKR65G87GYRCF",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "#TIL you can use vim/nvim as a pager directly, like\n\nsome_command |vim\n\n\nEven better than that, you can redirect a file into vim like\n\nvim \u003c some_file.txt\n\n\nThe advantages of this over view/vim -R are twofold: one, it is literally impossible to overwrite the file, unless you manually type :w exact_filename within vim. Second, you can safely edit the buffer without getting any warnings of being in read-only mode, because you're editing an ephemeral buffer, not the file.\n\nDisclaimers: I did not actually learn this today, but within the last 12 months. Also, this doesn't work in vanilla vi/nvi.",
"sig": "da4910ccaa00d84a851b90444766cda7dc797d40a928804e1f5d6b4eefea0ba48af7b7875aa947bfaeaac29d2b48018c952184a186d62dab3b2901a6a8b81842"
}