💾 Archived View for pwshnotes.flounder.online › gemlog › 2022-05-06-vim-modelines.gmi captured on 2024-08-31 at 11:56:15. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-06-04)

-=-=-=-=-=-=-

Vim Modelines

Temporarily setting Vim options like nowrap and guioptions+=b can be helpful for log files. But it is inconvenient to either set permanent options in vimrc or to type these options each time.

Vim modelines allow you to set Vim options per file.

The trade-off is that modelines appear directly in the file. So, you might have to work with a copy of a file if editing is not allowed.

Just add the modeline directly to the top or bottom of the file. Here is an example from my notes. The next time I open this file, the long lines will scroll off the edge and if I am using gVim then I will get a scroll bar at the bottom of the window.

vim:nowrap guioptions+=b

	https://www.youtube.com/watch?v=xRmDIL9l3b0
	https://fidoalliance.org/charting-an-accelerated-path-forward-for-passwordless-authentication-adoption/
	https://fidoalliance.org/world-password-day-had-a-good-run-now-were-celebrating-a-future-with-less-passwords/
...

References

modelines

Created: Friday, May 6, 2022

Updated: Friday, May 6, 2022