2019-05-21 19:57:24 +00:00
|
|
|
{ pkgs }:
|
|
|
|
|
2022-12-05 14:10:15 +00:00
|
|
|
pkgs.tv.vim.makePlugin (pkgs.writeTextFile (let
|
2019-05-21 19:57:24 +00:00
|
|
|
name = "showsyntax";
|
|
|
|
in {
|
|
|
|
name = "vim-plugin-${name}-1.0.0";
|
|
|
|
destination = "/plugin/${name}.vim";
|
|
|
|
text = /* vim */ ''
|
|
|
|
if exists('g:loaded_showsyntax')
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
let g:loaded_showsyntax = 0
|
|
|
|
|
|
|
|
fu! ShowSyntax()
|
|
|
|
let id = synID(line("."), col("."), 1)
|
|
|
|
let name = synIDattr(id, "name")
|
|
|
|
let transName = synIDattr(synIDtrans(id),"name")
|
|
|
|
if name != transName
|
|
|
|
let name .= " (" . transName . ")"
|
|
|
|
endif
|
|
|
|
echo "Syntax: " . name
|
|
|
|
endfu
|
|
|
|
|
|
|
|
command! -n=0 -bar ShowSyntax :call ShowSyntax()
|
|
|
|
'';
|
|
|
|
}))
|