-- Leo's gemini proxy

-- Connecting to gemini.ctrl-c.club:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

A .vimrc excerpt for gemtext files


Since I am primarily a Python programmer that is used to having an 80-column limit, my default Vim settings include a color column positioned at the 81st column and word wrapping turned off. Gemtext files expect each paragraph to be one continuous line, however, so having each line go off the right edge of the screen instead of wrapping around would make writing more difficult.


There is a way to automatically apply settings based on the type of file that is opened, fortunately. This excerpt from my .vimrc, which I wrote yesterday, is an example of this:


augroup gemtext
    autocmd FileType gemtext setlocal colorcolumn& linebreak wrap
augroup END

The above excerpt means that if the opened file is a gemtext file, automatically apply the following settings to that buffer only:

colorcolumn& - set the 'colorcolumn' setting to the default, which is to not display it at all

linebreak - if 'wrap' is on, break lines only at the characters specified in the 'breakat' setting, which is set to a reasonable set of characters by default

wrap - turn on word wrapping


This makes writing content for my Gemini capsule more comfortable without affecting how I work with other files. I used to set these settings manually every time I edited a gemtext file, but having these settings applied automatically gives me a few more precious seconds to spend on writing.


I wrote this post mainly to document what I did for myself, but if someone else is reading this, I hope they find this article useful.


Index

-- Response ended

-- Page fetched on Mon May 27 20:30:21 2024