Mercurial > vim
view runtime/indent/sass.vim @ 34713:cd116bc9ef9d v9.1.0235
patch 9.1.0235: filetype: supertux files are not recognized
Commit: https://github.com/vim/vim/commit/4ff83b904ea579e51a0da5d2c6c3873ccef4ac0e
Author: Wu, Zhenyu <wuzhenyu@ustc.edu>
Date: Sun Mar 31 18:58:34 2024 +0200
patch 9.1.0235: filetype: supertux files are not recognized
Problem: filetype: supertux files are not recognized
Solution: Supertux uses lisp to store hotkeys in config and game stage information,
so add a pattern for supertux files.
(Wu, Zhenyu)
Reference: https://github.com/SuperTux/supertux/wiki/S-Expression
closes: #14356
Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 31 Mar 2024 19:15:02 +0200 |
parents | 92fd65eac53a |
children |
line wrap: on
line source
" Vim indent file " Language: Sass " Maintainer: Tim Pope <vimNOSPAM@tpope.org> " Last Change: 2023 Dec 28 if exists("b:did_indent") finish endif let b:did_indent = 1 setlocal autoindent setlocal indentexpr=GetSassIndent() setlocal indentkeys=o,O,*<Return>,<:>,!^F let b:undo_indent = "setl ai< inde< indk<" " Only define the function once. if exists("*GetSassIndent") finish endif let s:property = '^\s*:\|^\s*[[:alnum:]#{}-]\+\%(:\|\s*=\)' let s:extend = '^\s*\%(@extend\|@include\|+\)' function! GetSassIndent() let lnum = prevnonblank(v:lnum-1) let line = substitute(getline(lnum),'\s\+$','','') let cline = substitute(substitute(getline(v:lnum),'\s\+$','',''),'^\s\+','','') let line = substitute(line,'^\s\+','','') let indent = indent(lnum) if line !~ s:property && line !~ s:extend && cline =~ s:property return indent + shiftwidth() else return -1 endif endfunction " vim:set sw=2: