From 35dcd45cd5245b7976ce68d63cbf0510f432808e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 21 May 2019 21:57:24 +0200 Subject: tv vim: move showsyntax to overlay --- tv/5pkgs/vim/showsyntax.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tv/5pkgs/vim/showsyntax.nix (limited to 'tv/5pkgs/vim') diff --git a/tv/5pkgs/vim/showsyntax.nix b/tv/5pkgs/vim/showsyntax.nix new file mode 100644 index 000000000..a5547e46a --- /dev/null +++ b/tv/5pkgs/vim/showsyntax.nix @@ -0,0 +1,26 @@ +{ pkgs }: + +(rtp: rtp // { inherit rtp; }) (pkgs.writeTextFile (let + 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() + ''; +})) -- cgit v1.2.3