https://github.com/brisvag/starfile.vim

VIM syntax for STAR/CIF files.

https://github.com/brisvag/starfile.vim

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

VIM syntax for STAR/CIF files.

Basic Info
  • Host: GitHub
  • Owner: brisvag
  • License: gpl-3.0
  • Language: Vim Script
  • Default Branch: main
  • Homepage:
  • Size: 23.4 KB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

starfile.vim

A syntax file for vim for the STAR (Self-defining Text Archive and Retrieval) format (the underlying format behind the PDBx/mmCIF/CIF molecular structure files from the PDB, the .star files used by RELION, and a few others).

It highlights each column and header differently, in a way that makes easier to match specific columns to their headers in the otherwise inscrutable sea of characters. This is especially useful with many headers wrapping over multiple lines or continuing off the screen where it's hard to count columns.

vim screenshot

The colorscheme used above is gruvbox-dark, but it should work well with the builtin colorschemes; try for example :colorscheme slate.

How-to

For syntax highlighting to work, your vim needs to have the following settings active (in your ~/.vimrc for persistence):

vim filetype plugin indent on syntax on

Then, create or edit your filetype.vim file (likely inside ~/.vim/) so it contains something like this:

```vim if exists("didloadfiletypes") finish endif

augroup filetypedetect au! BufRead,BufNewFile .star,.cif setfiletype starfile augroup END ```

This will automatically detect the file extension and load the correct syntax file whenever you open a .star file.

Finally, put the starfile.vim provided here inside the syntax vim runtime directory (likely ~/.vim/syntax/) and everything should work.

Neovim

If you're on nvim, the aforementioned paths should all be inside .config/nvim/.

Known issues

  • if there's a newline between columns that belongs to the same line in a _loop construct (which is weird, but alas allowed in STAR), colors will be mismatched. This is unfortunately common in mmCIF files. (This is because with the limited vim syntax we can't distinguish between a new line of columns or just the next column on a new line.)

License is GPLv3; feel free to contribute and fork!

Owner

  • Name: Lorenzo Gaifas
  • Login: brisvag
  • Kind: user
  • Company: @gutsche-lab

PhD student at @gutsche-lab, doing computational stuff with cryo-ET data.

GitHub Events

Total
Last Year

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 1
  • Total pull requests: 0
  • Average time to close issues: less than a minute
  • Average time to close pull requests: N/A
  • Total issue authors: 1
  • Total pull request authors: 0
  • Average comments per issue: 0.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • brisvag (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels