From 6d8bedbf239ae8865bc44866ded062cc44ecdf64 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 9 Jun 2016 14:46:08 +0200 Subject: tv vim-plugin-showsyntax: init at 1.0.0 --- tv/2configs/vim.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tv') diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 5039fbadf..eb6c432bb 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -75,6 +75,30 @@ let '') (map (i: lpad 3 "0" (toString i)) (range 0 255))} ''; }))) + ((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() + ''; + }))) ]; dirs = { -- cgit v1.2.3