summaryrefslogtreecommitdiffstats
path: root/tv/2configs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-06-09 14:46:08 +0200
committertv <tv@krebsco.de>2016-06-10 16:04:55 +0200
commit8703594aad5ffc138d32c46c7445ce8506a4a6ed (patch)
treeef4f01ee79fb4a1bd47ca9e84dac6e487339c6b4 /tv/2configs
parentb70c126c803b1792dbbb065c455b2b2f62c1f1b0 (diff)
tv vim-plugin-showsyntax: init at 1.0.0
Diffstat (limited to 'tv/2configs')
-rw-r--r--tv/2configs/vim.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 5039fba..eb6c432 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 = {