Skip to content

silq-lang/vim-silq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vim-silq

Rudimentary Vim plugin for the Silq quantum programming language.

Features

  • Filetype detection for *.slq files
  • Syntax highlighting (keywords, comments, strings, primed identifiers)
  • Indentation matching silq-mode.el behaviour:
    • Tabs for structural indentation, spaces for token alignment
    • then/else align to their matching if token
    • else-chains align to the outermost if of the cascade
    • Closing delimiters } ) ] align with their opener's line

Installation

vim-plug

Plug 'silq-lang/vim-silq'

lazy.nvim

{ 'silq-lang/vim-silq' }

Manual

Copy the three directories into your ~/.vim/ (Vim) or ~/.config/nvim/ (Neovim):

ftdetect/silq.vim
syntax/silq.vim
indent/silq.vim

Notes

Vim's indentexpr returns a single integer (the target column), which cannot separately encode structural tabs and alignment spaces. To work around this, lines requiring alignment (i.e. then/else) return -1 from indentexpr and are instead handled by a custom s:ApplyIndent function that writes the correct tab+space prefix directly. This is hooked into <CR> in insert mode and ==/= in normal and visual mode.

About

Vim plugin for Silq.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors