0

There are some files like GEDCOM and ADIF that are plain text files, but many people tend to work with them through GUIs. Say I wanted to do data entry on these files directly without any GUI.There are a number of things that make this a little dangerous. Things like misspellings of necessary file-grammar, missing a necessary key, incorrect types for values, etc. There is also something to be said for the additional difficulty of having to type additional characters relative to a GUI.

From what I can tell by thinking about this for 15mins ;) is that having the following would make the job of plain text entry much easier.

  1. A formatter. I think of something like Python's Black which is a CLI that can be run on a file. It can let users know of bad formatting and can provide fixes.
  2. A linter. I think of flake8 to ensure the styling matches the standard.
  3. Autocomplete. The file type examples I showed above have a dictionary of key words. To save on typing it would be nice to have autocomplete.
  4. Syntax Highlighting. Having a way to know if my data entry is good or bad in real-time would be helpful.

It seems like requirements 1-2 could be solved by making a file specific CLIs that combs through plain text files.

Requirement 4 seems IDE specific. vim and vscode allow users to make syntax highlighting plugins. The problem is that this is normally solved by connecting to a language server. When you are not looking for a language server, but for key words and proper values in a plain text file how does let their IDE know that to look for? Is this just a regex soup solution or is there a better way?

Requirement 3 may also be IDE specific, but the same question applies as for requirement 4. When there is not a language server how can I let an IDE know what/how to autocomplete?

Any examples of plain text data entry made easier would be appreciated.

Thanks!

Alex
  • 2,603
  • 4
  • 40
  • 73
  • 1
    Features 1-3 could be implemented in [language servers](https://microsoft.github.io/language-server-protocol/) which Vim supports via third-party plugins. If you don't want to take the LSP route, you will have to write dedicated CLI formatters (#1), dedicated CLI linters (#2), completion functions in vimscript, and all the glue code to "integrate" all that in the form of proper filetype plugins. Vim does #4 via regular expressions. Either way, you have a lot on your plate. – romainl Aug 23 '22 at 12:59
  • So you are saying the language servers are not programming language specific? TIL. Thanks! – Alex Aug 23 '22 at 20:49
  • @romaini it looks like language servers are mostly for standard languages. These files are most like dictionaries of words. Are language servers still applicable? – Alex Aug 28 '22 at 12:06

0 Answers0