Skip to content

Instantly share code, notes, and snippets.

@terminatorul
terminatorul / TabSizeChoice.md
Created June 12, 2021 00:37
On the "choice" of Tab size

#Tabs and Tab size

Once, long ago, when computers were not so wide-spread as they are today, using Tab characters was much simpler. Why ? Everybody new what the size of a tab character was. At the beginning, the tab size was 8.

You can still see this today. Printers could receive text for printing directly on the printer port (usually a parallel port or a serial port (RS-232C)), and would print it in a manner similar to a console or terminal, so without formatting and without using a word processor, like the one from Microsoft. I believe many printers can still do this today, and if you can identify the printer port by name, you can use the copy command to print a text file. And printers used a tab size of 8, and nobody questioned it, because at the time they had no reason to.

@terminatorul
terminatorul / commitdiff.ctags
Last active June 12, 2024 07:42
ctags optlib (regexp) parser for commit diffs (like the ones from git)
#
# Implement a CommitDiff format, where
# - the first pathname components stands for the old and new versions of the file.
# only the following path components (after the first) are found on the file system
# - the /dev/null file is used to identify file deletions and additions in the diff
# - if the file name is absolute (starts with a /) then the full file path is
# relevant and no leading path component is stripped
# - Some header lines about the commit, output by git, are matched and tagged
# (commit ID, Author, Date)
# - file names from the diff file are also scopes for their hunks
@terminatorul
terminatorul / vim9.ctags
Last active June 12, 2024 18:41
Update the default Vim script parser in ctags to support Vim9 script
# Copyright(C) 2024 Timothy Madden <terminatorul@gmail.com>
#
# Provided under the MIT No Attribution License: https://opensource.org/license/MIT-0
# This ctags configuration file builds on top of the default Vim script parser in ctags, and adds support for Vim9 script.
#
# Line continuation with backslashes not implemented, except for the function argument list
# List destructuring like [ g:rangeMin, g:rangeMax ] = getIntervalRange() also implemented
# Statements concatenated on a single line, using the pipe <Bar> character as a delimiter, are recognized as such