diff options
author | lassulus <lassulus@lassul.us> | 2019-05-29 09:07:03 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2019-05-29 09:07:03 +0200 |
commit | 680d5b4cff45fa3de1adb50af576f796ae3762fa (patch) | |
tree | 647c746bb175c1613c3147a1e5985317c361e786 /tv/5pkgs/vim/showsyntax.nix | |
parent | 08ddffd7812f9ec42f9946dd2c4f8cc4eb7b656c (diff) | |
parent | 06f8c8986b01bd805191fa452c09369cdafb0777 (diff) |
Merge remote-tracking branch 'ni/master'
Diffstat (limited to 'tv/5pkgs/vim/showsyntax.nix')
-rw-r--r-- | tv/5pkgs/vim/showsyntax.nix | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tv/5pkgs/vim/showsyntax.nix b/tv/5pkgs/vim/showsyntax.nix new file mode 100644 index 00000000..a5547e46 --- /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() + ''; +})) |