diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-03 17:01:25 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-03 20:03:44 +0100 |
| commit | 52cff9b8a81f641403df55cf5e081f6f1212d2fd (patch) | |
| tree | 167bf61f4dae3da5261b33757ece8c70c0d7cf44 /view.c | |
| parent | 8941f1138521317839e74dc55df275d584dc4350 (diff) | |
| download | vis-52cff9b8a81f641403df55cf5e081f6f1212d2fd.tar.gz vis-52cff9b8a81f641403df55cf5e081f6f1212d2fd.tar.xz | |
vis: use file(1) for file type detection
File type detection works as follows:
1) strip off suffixes to be ignored and test against a
set of known file extensions
2) run `file -bL --mime-type` and check against a set
of known mime types
3) read out the first few bytes of the file and pass
them to custom Lua file type detection functions
For now the configured file extensions are literal strings
which are matched against the end of the file name. Maybe
we should use Lua patterns instead.
We will need to add more mime types to our mapping table.
For now only the `bash` file type was associated with the
text/x-shellscript mime type.
Diffstat (limited to 'view.c')
0 files changed, 0 insertions, 0 deletions
