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/2configs/vim.nix | 25 +------------------------ tv/5pkgs/vim/showsyntax.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 tv/5pkgs/vim/showsyntax.nix diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix index 18b69313f..819578661 100644 --- a/tv/2configs/vim.nix +++ b/tv/2configs/vim.nix @@ -19,33 +19,10 @@ let { pkgs.tv.vimPlugins.fzf pkgs.tv.vimPlugins.hack pkgs.tv.vimPlugins.jq + pkgs.tv.vimPlugins.showsyntax pkgs.tv.vimPlugins.vim pkgs.vimPlugins.fzfWrapper pkgs.vimPlugins.undotree - ((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() - ''; - }))) ((rtp: rtp // { inherit rtp; }) (pkgs.write "vim-tv" { # # Haskell 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